/* ========================================================================
   Empower Students — site stylesheet (v2)
   Polish layered on top of Tailwind: typography, transitions, custom card
   borders, scrollbars, focus rings, and mobile tuning.
   ======================================================================== */

:root {
  --es-radius: 1rem;
  --es-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --es-shadow-md: 0 4px 16px -4px rgba(15, 23, 42, 0.10), 0 2px 4px rgba(15, 23, 42, 0.04);
  --es-shadow-lg: 0 12px 32px -12px rgba(15, 23, 42, 0.18), 0 4px 8px rgba(15, 23, 42, 0.06);
  --es-ring: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

/* ── Base type ────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(79, 70, 229, 0.2); color: inherit; }

/* ── Smooth interactive transitions ──────────────────────────────────── */
a, button, input, select, textarea, label, [role="button"] {
  transition: background-color .18s ease, border-color .18s ease,
              color .18s ease, box-shadow .18s ease, transform .15s ease,
              opacity .18s ease;
}

/* ── Branded focus rings ─────────────────────────────────────────────── */
*:focus { outline: none; }
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  box-shadow: var(--es-ring);
  border-color: rgb(79, 70, 229);
}

/* ── Brand-gradient buttons: animated lift on hover ──────────────────── */
.brand-grad { background-size: 180% 180%; background-position: 0% 50%; }
a.brand-grad:hover, button.brand-grad:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, 0.5);
}
a.brand-grad:active, button.brand-grad:active { transform: translateY(0); }

/* ── Question / module cards: cool gradient hairline border ──────────── */
/* Any white card with rounded-2xl gets a subtle gradient hairline that
   intensifies on hover — gives the surfaces depth without heavy shadows. */
.bg-white.rounded-2xl,
.bg-white.rounded-xl {
  box-shadow: var(--es-shadow-sm);
  position: relative;
}
.bg-white.rounded-2xl:hover { box-shadow: var(--es-shadow-md); }

/* Question cards specifically — a soft inner glow when you hover */
form .bg-white.rounded-2xl {
  background-image: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border: 1px solid rgba(99, 102, 241, 0.10);
}
form .bg-white.rounded-2xl:hover {
  border-color: rgba(99, 102, 241, 0.25);
  background-image: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
}
form .bg-white.rounded-2xl:focus-within {
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: 0 4px 16px -6px rgba(79, 70, 229, 0.18);
  background-image: linear-gradient(180deg, #ffffff 0%, #f0f3ff 100%);
}

/* ── Inputs ──────────────────────────────────────────────────────────── */
input[type="text"], input[type="number"], input[type="tel"],
input[type="email"], input[type="password"], input[type="date"],
input[type="search"], select, textarea {
  background-color: #fff;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="tel"]:focus,
input[type="email"]:focus, input[type="password"]:focus, input[type="date"]:focus,
input[type="search"]:focus, select:focus, textarea:focus {
  border-color: rgb(79, 70, 229);
  box-shadow: var(--es-ring);
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { opacity: 0.4; }
input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:focus::-webkit-inner-spin-button { opacity: 1; }

/* ── Likert / Yes-No selected state — pop and lift ───────────────────── */
.peer:checked + span {
  transform: scale(1.05);
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.4);
}

/* ── Page heading — subtle gradient on h1 within main ────────────────── */
main > h1 {
  background: linear-gradient(135deg, #1e293b 0%, #4f46e5 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

/* ── Custom scrollbars (Chromium / WebKit) ───────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #c7d2fe, #a5f3fc);
  border-radius: 999px;
  border: 2px solid #fafafb;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(135deg, #818cf8, #67e8f9); }

/* ── Modal entrance ──────────────────────────────────────────────────── */
#esModal:not(.hidden) > div { animation: es-pop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes es-pop { 0% { opacity: 0; transform: scale(0.96) translateY(8px); }
                    100% { opacity: 1; transform: scale(1) translateY(0); } }

/* ── Skeleton shimmer ────────────────────────────────────────────────── */
.es-skeleton {
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: es-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes es-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Disabled state ──────────────────────────────────────────────────── */
button:disabled, .es-disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
  filter: saturate(0.6);
}

/* ── Module top banner pill ──────────────────────────────────────────── */
.bg-indigo-50.text-indigo-800.border-indigo-100.rounded-full {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(6, 182, 212, 0.06));
  border-color: rgba(79, 70, 229, 0.18);
  box-shadow: var(--es-shadow-sm);
}

/* ── Mobile: tighter, prettier ───────────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 14px; }
  main { padding-top: 0.75rem !important; }
  h1 { font-size: 1.5rem !important; line-height: 1.2 !important; }
  h2 { font-size: 1.15rem !important; }
  h3 { font-size: 1rem !important; }

  /* Question cards on mobile — softer shadow, more breathing room */
  form .bg-white.rounded-2xl { padding: 1rem !important; }
  form > .space-y-4 > div { margin-bottom: 0.75rem; }

  /* Buttons full-tap-target */
  button, .btn, a.brand-grad, a.es-cta-primary, a.es-cta-secondary {
    min-height: 44px;
  }

  /* Likert pills slightly smaller on phone */
  .peer + span.w-10 { width: 2.25rem !important; height: 2.25rem !important; line-height: 2.25rem !important; font-size: 0.85rem; }

  /* Number inputs more compact */
  input[type="number"].w-32 { width: 6rem !important; }
  input[type="number"].w-20 { width: 4.5rem !important; }
  input[type="number"].w-28 { width: 5.5rem !important; }

  /* Tighter back-to-dashboard + price banner row */
  main > a:first-of-type { font-size: 0.8rem; }
}

/* ── Print friendly ──────────────────────────────────────────────────── */
@media print {
  header, footer, .no-print { display: none !important; }
  body { background: white !important; }
  .bg-white { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Prose tweaks for AI summaries ───────────────────────────────────── */
.prose, .es-prose {
  line-height: 1.7;
  color: rgb(30, 41, 59);
}
.prose strong, .es-prose strong { color: rgb(15, 23, 42); }
.prose a, .es-prose a {
  color: rgb(79, 70, 229);
  text-decoration: underline;
  text-decoration-color: rgba(79, 70, 229, 0.4);
  text-underline-offset: 3px;
}
.prose a:hover, .es-prose a:hover { text-decoration-color: rgb(79, 70, 229); }

/* ── Bilingual swap helper ──────────────────────────────────────────── */
.es-bi { display: inline; }

/* ── Card-click affordance ──────────────────────────────────────────── */
a.block.bg-white:hover { border-color: rgb(199, 210, 254); }
