/* ============================================================
   Youth for Freedom — Parent Portal
   Design tokens + base styles
   ============================================================ */

:root {
  /* Brand */
  --blue:        #2B388F;
  --blue-700:    #232e75;
  --blue-800:    #1b2460;
  --blue-50:     #eef0fa;
  --blue-100:    #e0e3f5;

  --orange:      #F69320;
  --orange-600:  #e07e0c;
  --orange-soft: #fff3e3;

  --teal:        #008E97;
  --teal-700:    #007078;
  --teal-soft:   #e2f3f4;

  /* Neutrals (cool, subtly tinted) */
  --ink:    #1b1f3b;
  --ink-2:  #3a3f5c;
  --muted:  #6b7186;
  --faint:  #9aa0b4;
  --line:   #e7e9f2;
  --line-2: #eef0f6;
  --bg:     #f3f5fb;
  --card:   #ffffff;

  /* Accent — overridable by Tweaks (defaults to orange "energy") */
  --accent:        var(--orange);
  --accent-600:    var(--orange-600);
  --accent-soft:   var(--orange-soft);

  --radius:    20px;
  --radius-sm: 13px;
  --radius-lg: 28px;

  --shadow-sm: 0 1px 2px rgba(27,31,59,.04), 0 2px 8px rgba(27,31,59,.05);
  --shadow:    0 2px 6px rgba(27,31,59,.05), 0 14px 34px rgba(27,31,59,.09);
  --shadow-lg: 0 12px 28px rgba(27,31,59,.10), 0 30px 60px rgba(27,31,59,.16);

  --ease: cubic-bezier(.22,.61,.36,1);
  --spring: cubic-bezier(.34,1.56,.64,1);

  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Hanken Grotesque', -apple-system, system-ui, sans-serif;
}

/* Animation master switch (toggled by Tweaks) */
.anim-off * {
  animation: none !important;
  transition: none !important;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
}

#root { min-height: 100%; }

/* Decorative ambient blobs — very subtle brand color wash.
   Also carries the base background so scrolled regions never reveal a
   blank/black canvas (fixed = always fills the viewport). */
.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background: var(--bg);
}
.ambient span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .22;
}
.ambient .b1 { width: 460px; height: 460px; background: var(--blue);   top: -180px; left: -120px; }
.ambient .b2 { width: 420px; height: 420px; background: var(--teal);   bottom: -200px; right: -100px; opacity:.16; }
.ambient .b3 { width: 300px; height: 300px; background: var(--orange); top: 40%; right: 12%; opacity: .08; }

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* Typographic helpers */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: .96;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--font-display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-600);
  font-size: 15px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: translateY(1px) scale(.992); }
.btn:focus-visible { outline: 3px solid var(--blue-100); outline-offset: 2px; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(43,56,143,.26);
}
.btn-primary:hover { background: var(--blue-700); box-shadow: 0 10px 22px rgba(43,56,143,.32); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(246,147,32,.30);
}
.btn-accent:hover { background: var(--accent-600); box-shadow: 0 10px 22px rgba(246,147,32,.36); transform: translateY(-1px); }

.btn-teal {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,142,151,.28);
}
.btn-teal:hover { background: var(--teal-700); transform: translateY(-1px); }

.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: #cfd3e3; background: #fafbff; }

.btn-quiet {
  background: transparent;
  color: var(--muted);
  min-height: 0;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: none;
}
.btn-quiet:hover { color: var(--blue); }

.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-lg { min-height: 58px; font-size: 17px; padding: 16px 30px; }

/* ============================================================
   Card surfaces
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============================================================
   Top nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { height: 30px; display: block; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-name { color: var(--muted); font-weight: 600; font-size: 14px; }

/* Mobile hamburger — hidden on desktop, shown via the 720px media query. */
.nav-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 9px; background: transparent; border: none; cursor: pointer;
}
.nav-burger span { display: block; height: 2.5px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.nav-menu { display: none; }
.nav-menu-name { padding: 12px 16px 4px; color: var(--muted); font-weight: 700; font-size: 13px; }
.nav-menu-item {
  text-align: left; background: transparent; border: none; padding: 14px 16px;
  font-size: 16px; font-weight: 600; color: var(--ink); border-radius: 10px; cursor: pointer;
}
.nav-menu-item:hover { background: var(--blue-50); color: var(--blue); }
.nav-accent-line {
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--teal) 55%, var(--orange));
}

/* ============================================================
   Progress bar (linear)
   ============================================================ */
.pbar {
  height: 9px;
  border-radius: 999px;
  background: var(--blue-50);
  overflow: hidden;
  position: relative;
}
.pbar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), #28b3bb);
  transition: width .9s var(--ease);
  position: relative;
}
.pbar-fill.is-active {
  background: linear-gradient(90deg, var(--teal), var(--accent));
}
.pbar-fill.is-complete {
  background: linear-gradient(90deg, var(--teal), #15a59f);
}
/* shimmer to show "working / progress" */
.pbar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: translateX(-100%);
  animation: shimmer 2.1s var(--ease) infinite;
}
.anim-off .pbar-fill::after { display: none; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ============================================================
   Spinner / working indicator
   ============================================================ */
.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.spinner.dark { border-color: var(--blue-100); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dots loader */
.dots { display: inline-flex; gap: 6px; align-items: center; }
.dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.1s var(--ease) infinite;
}
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,80%,100%{ transform: translateY(0); opacity:.5 } 40%{ transform: translateY(-7px); opacity:1 } }

/* ============================================================
   Animated checkmark
   ============================================================ */
.check-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--teal);
}
.check-circle svg { width: 60%; height: 60%; }
.check-path {
  stroke: #fff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 28;
  stroke-dashoffset: 0; /* visible at rest — never stuck hidden */
}
.check-path.draw { animation: draw .5s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 28; } to { stroke-dashoffset: 0; } }

/* ============================================================
   Entrance animations
   Transform-only (no persistent opacity:0) so content is ALWAYS
   visible at rest — if an animation is throttled/paused the element
   simply sits at a small offset rather than disappearing.
   ============================================================ */
@keyframes fadeUp { from { transform: translateY(14px); } to { transform: none; } }
@keyframes fadeIn { from { transform: translateY(6px); } to { transform: none; } }
@keyframes popIn  { 0% { transform: scale(.9);} 60%{ transform: scale(1.02);} 100%{ transform: scale(1);} }
@keyframes slideInR { from { transform: translateX(30px); } to { transform: none; } }
@keyframes slideInL { from { transform: translateX(-30px); } to { transform: none; } }

.fade-up { animation: fadeUp .55s var(--ease) both; }
.fade-in { animation: fadeIn .45s var(--ease) both; }
.pop-in  { animation: popIn .5s var(--spring) both; }
.slide-r { animation: slideInR .45s var(--ease) both; }
.slide-l { animation: slideInL .45s var(--ease) both; }

.anim-off .fade-up, .anim-off .fade-in, .anim-off .pop-in,
.anim-off .slide-r, .anim-off .slide-l { animation: none; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
