/* Get Custom Content funnel — modal, FAB, banner, hero ribbon.
   Uses existing design tokens from css/style.css (--primary, --accent, etc.). */

/* ---- Floating Action Button ---- */
.cc-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1080; /* above Bootstrap sticky-top (1020), below modal (1090) */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent, #f59e0b), var(--accent-hover, #d97706));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cc-fab:hover,
.cc-fab:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  outline: none;
}
.cc-fab:focus-visible { outline: 3px solid var(--primary, #0d7a6b); outline-offset: 2px; }

/* On small phones, collapse label to keep it out of the way of critical UI */
@media (max-width: 480px) {
  .cc-fab { right: 12px; bottom: 12px; padding: 12px; }
  .cc-fab .cc-fab-text { display: none; }
  .cc-fab .cc-fab-emoji { font-size: 1.25rem; }
}

/* ---- Inline banner (Study Material page) ---- */
.cc-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  background: var(--primary-bg, #f0faf7);
  border: 1px solid var(--primary-light, #0f9484);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 20px;
  text-align: center;
}
.cc-banner p { margin: 0; color: var(--primary-dark, #0a5c50); font-weight: 600; }
.cc-banner button {
  border: none;
  background: var(--primary, #0d7a6b);
  color: #fff;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.cc-banner button:hover { background: var(--primary-dark, #0a5c50); }
.cc-banner button:focus-visible { outline: 3px solid var(--accent, #f59e0b); outline-offset: 2px; }

/* ---- Hero ribbon (homepage) ---- */
.cc-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(2px);
}
.cc-ribbon:hover { background: rgba(255, 255, 255, 0.25); }
.cc-ribbon:focus-visible { outline: 3px solid var(--accent, #f59e0b); outline-offset: 2px; }

/* ---- Modal ---- */
.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(17, 24, 39, 0.55);
  overflow-y: auto;
}
.cc-overlay.cc-open { display: flex; }

.cc-modal {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  margin: auto;
  overflow: hidden;
}

.cc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 8px;
}
.cc-modal-header h2 { font-size: 1.3rem; font-weight: 700; margin: 0; color: #111827; }
.cc-modal-header p { margin: 4px 0 0; color: #6b7280; font-size: 0.9rem; }
.cc-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.cc-close:hover { background: #f3f4f6; color: #111827; }
.cc-close:focus-visible { outline: 3px solid var(--primary, #0d7a6b); }

.cc-modal-body { padding: 8px 22px 22px; }

.cc-field { margin-bottom: 14px; }
.cc-field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; color: #374151; }
.cc-field .cc-req { color: #dc2626; }
.cc-field input[type="text"],
.cc-field input[type="email"],
.cc-field input[type="tel"],
.cc-field input[type="date"],
.cc-field select,
.cc-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
.cc-field textarea { resize: vertical; min-height: 72px; }
.cc-field input:focus,
.cc-field select:focus,
.cc-field textarea:focus {
  outline: none;
  border-color: var(--primary, #0d7a6b);
  box-shadow: 0 0 0 3px rgba(13, 122, 107, 0.15);
}
.cc-field.cc-invalid input,
.cc-field.cc-invalid select,
.cc-field.cc-invalid textarea { border-color: #dc2626; }

.cc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .cc-row { grid-template-columns: 1fr; } }

.cc-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
@media (max-width: 480px) { .cc-checks { grid-template-columns: 1fr; } }
.cc-check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: #374151; }
.cc-check input { width: auto; }

.cc-error { display: none; color: #dc2626; font-size: 0.82rem; margin-top: 4px; }
.cc-field.cc-invalid .cc-error { display: block; }

.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.cc-btn-primary {
  flex: 1 1 auto;
  border: none;
  background: linear-gradient(135deg, var(--primary, #0d7a6b), var(--primary-dark, #0a5c50));
  color: #fff;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}
.cc-btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }
.cc-btn-whatsapp {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #25d366;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}
.cc-btn-whatsapp:hover { background: #1ebe57; color: #fff; }

.cc-form-error {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.9rem;
}
.cc-form-error.cc-show { display: block; }

/* Success state */
.cc-success { display: none; padding: 28px 22px 30px; text-align: center; }
.cc-success.cc-show { display: block; }
.cc-success .cc-tick {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--primary-bg, #f0faf7);
  color: var(--primary, #0d7a6b);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.cc-success h2 { font-size: 1.3rem; margin: 0 0 6px; color: #111827; }
.cc-success p { color: #6b7280; margin: 0 0 18px; }

.cc-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 8px;
  animation: cc-spin 0.7s linear infinite;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }
