@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
  /* Repurposed to a bright, kid-friendly palette (names kept for compatibility) */
  --space-navy: #1B1B3A;        /* ink / primary text */
  --space-navy-light: #2A2A4A;
  --starlight-white: #FDFBF7;   /* warm cream page background */
  --orbit-orange: #FF8F66;      /* coral — primary */
  --orbit-orange-hover: #FF7547;
  --nebula-purple: #8338EC;     /* cosmic purple */
  --comet-teal: #4CC9F0;        /* sky blue */
  --star: #FFB703;              /* star yellow */
  --success: #2DC653;
  --moon-gray: #E5E0D8;         /* light border */
  --border-med: #D1C9BE;
  --text-main: #1B1B3A;
  --text-muted: #8A8A9E;
  --text-soft: #585872;
  --white: #FFFFFF;
  --card: #FFFFFF;
  --dash-bg: #F4F7FB;
  --auth-bg: linear-gradient(160deg, #FFF6EF 0%, #FDFBF7 40%, #E9F7FE 100%);

  --font-heading: 'Fredoka', sans-serif;
  --font-body: 'Quicksand', sans-serif;
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem; --space-16: 4rem; --space-24: 6rem;
  --radius-sm: .5rem; --radius-md: 1rem; --radius-lg: 1.5rem; --radius-pill: 9999px;
  --shadow-sm: 0 2px 8px rgba(27,27,58,.04);
  --shadow-md: 0 8px 24px rgba(27,27,58,.08);
  --shadow-lg: 0 20px 40px rgba(27,27,58,.12);
  --shadow-glow: 0 8px 24px rgba(255,143,102,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text-main); background: var(--starlight-white); line-height: 1.65; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: var(--font-heading); line-height: 1.15; color: var(--space-navy); font-weight: 600; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { width: 1em; height: 1em; vertical-align: -0.125em; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-6); }
.section { padding: var(--space-24) 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.5px; font-size: .8rem; font-weight: 700; color: var(--orbit-orange); font-family: var(--font-heading); }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.mt-2{margin-top:var(--space-2)} .mt-4{margin-top:var(--space-4)} .mt-6{margin-top:var(--space-6)} .mt-8{margin-top:var(--space-8)}
.grid { display: grid; gap: var(--space-6); }
.flex { display: flex; } .items-center{align-items:center} .justify-between{justify-content:space-between}
.gap-2{gap:var(--space-2)} .gap-4{gap:var(--space-4)} .wrap{flex-wrap:wrap}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-heading); font-weight: 600; border-radius: var(--radius-pill);
  padding: .85rem 1.7rem; cursor: pointer; border: none; font-size: 1rem;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease; }
.btn:focus-visible { outline: 3px solid rgba(255,143,102,.5); outline-offset: 2px; }
.btn-primary { background: var(--orbit-orange); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); background: var(--orbit-orange-hover); box-shadow: 0 12px 30px rgba(255,143,102,.45); }
.btn-secondary { background: #E0F7FE; color: #0e7fa0; }
.btn-secondary:hover { background: #cdefff; transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--text-main); border: 2px solid var(--moon-gray); }
.btn-ghost:hover { border-color: var(--orbit-orange); color: var(--orbit-orange); transform: translateY(-2px); }
.btn-teal { background: var(--comet-teal); color: #06344a; box-shadow: 0 8px 24px rgba(76,201,240,.3); }
.btn-teal:hover { transform: translateY(-2px); background: #3ab6dd; }
.btn-sm { padding: .55rem 1.1rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius-lg); padding: var(--space-8);
  box-shadow: var(--shadow-md); border: 2px solid var(--moon-gray); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--orbit-orange); }

/* Inputs */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: var(--space-2); color: var(--space-navy); }
.input-field, select.input-field, textarea.input-field {
  width: 100%; padding: .8rem 1rem; border: 2px solid var(--moon-gray); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; color: var(--text-main); background: var(--white);
  transition: border-color .2s, box-shadow .2s; font-weight: 500; }
.input-field:focus { outline: none; border-color: var(--orbit-orange); box-shadow: 0 0 0 4px #FFE8E0; }
.field { margin-bottom: var(--space-4); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 560px){ .row-2 { grid-template-columns: 1fr; } }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: var(--radius-pill);
  font-size: .8rem; font-weight: 700; font-family: var(--font-heading); background: #EEF0F6; color: var(--space-navy); }
.badge-orange { background: #FFE8E0; color: #d1502a; }
.badge-teal { background: #E0F7FE; color: #0e7fa0; }
.badge-purple { background: #F2E8FD; color: #6a29c4; }
.badge-green { background: #E5F9EA; color: #1a8f3c; }
.badge-amber { background: #FFF3D6; color: #a9760a; }
.badge-red { background: #FDE8E8; color: #c53030; }

/* Navbar (light) */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(253,251,247,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--moon-gray); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; color: var(--space-navy); display: flex; align-items: center; gap: 8px; }
.brand span { color: var(--orbit-orange); }
.nav-links { display: flex; gap: var(--space-6); align-items: center; }
.nav-links a { color: var(--text-soft); font-weight: 600; font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: var(--orbit-orange); }
@media (max-width: 860px){ .nav-links .hide-sm { display: none; } }

/* Hero (light + playful) */
.hero { position: relative; background: var(--starlight-white); overflow: hidden; padding: var(--space-24) 0 var(--space-16);
  background-image: radial-gradient(circle at 8% 15%, #FFE8E0 0%, transparent 22%), radial-gradient(circle at 92% 25%, #E0F7FE 0%, transparent 26%), radial-gradient(circle at 75% 90%, #FFF3D6 0%, transparent 24%); }
.hero-glow { display: none; }
.hero .container { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--space-16); align-items: center; }
.hero h1 { color: var(--space-navy); }
.hero p.lead { font-size: 1.2rem; color: var(--text-soft); max-width: 34rem; }
.hero-cta { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-8); }
.hero-trust { display: flex; gap: var(--space-6); margin-top: var(--space-8); flex-wrap: wrap; color: var(--text-muted); font-size: .9rem; font-weight: 600; }
.hero-visual { position: relative; height: 420px; }
@media (max-width: 940px){ .hero .container { grid-template-columns: 1fr; } .hero-visual { height: 300px; } }

/* Planets & orbits (bright) */
.planet { border-radius: 50%; position: absolute; box-shadow: 0 10px 30px rgba(27,27,58,.12); }
.planet-teal { width: 160px; height: 160px; background: radial-gradient(circle at 32% 30%, #7ad9f7, var(--comet-teal)); top: 28%; left: 40%; }
.planet-orange { width: 70px; height: 70px; background: radial-gradient(circle at 32% 30%, #ffc7ad, var(--orbit-orange)); top: 6%; left: 10%; }
.planet-purple { width: 48px; height: 48px; background: radial-gradient(circle at 32% 30%, #c79bf5, var(--nebula-purple)); bottom: 10%; right: 12%; }
.orbit { border: 2px dashed #E4DED4; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.orbit-1 { width: 300px; height: 300px; animation: spin 26s linear infinite; }
.orbit-2 { width: 440px; height: 440px; animation: spin 40s linear infinite reverse; }
.orbit .sat { position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--star); box-shadow: 0 0 12px var(--star); }
.float { animation: float 6s ease-in-out infinite; }

@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes float { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-14px);} }
@keyframes fadeInUp { from{ opacity:0; transform: translateY(22px);} to{ opacity:1; transform: translateY(0);} }
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; animation: fadeInUp .7s ease forwards; }
  .d1{animation-delay:.1s}.d2{animation-delay:.25s}.d3{animation-delay:.4s}.d4{animation-delay:.55s}
}

/* Starfield -> soft colorful dots on light */
.starfield { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(3px 3px at 20% 30%, #FFD9C9, transparent),
    radial-gradient(3px 3px at 70% 20%, #BFEEFC, transparent),
    radial-gradient(4px 4px at 40% 70%, #FFE9AE, transparent),
    radial-gradient(3px 3px at 85% 60%, #E0CCFA, transparent),
    radial-gradient(3px 3px at 55% 40%, #FFD9C9, transparent),
    radial-gradient(3px 3px at 10% 80%, #BFEEFC, transparent),
    radial-gradient(3px 3px at 90% 85%, #FFE9AE, transparent);
  background-repeat: no-repeat; }

/* Bento / feature */
.bento { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: var(--space-6); }
.feature-icon { width: 56px; height: 56px; border-radius: var(--radius-md); display: grid; place-items: center; background: #FFE8E0; color: var(--orbit-orange); margin-bottom: var(--space-4); }
.feature-icon svg { width: 28px; height: 28px; }
.bento .card:nth-child(2) .feature-icon { background: #E0F7FE; color: #0e7fa0; }
.bento .card:nth-child(3) .feature-icon { background: #FFF3D6; color: #a9760a; }
.bento .card:nth-child(4) .feature-icon { background: #F2E8FD; color: #6a29c4; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
@media (max-width: 900px){ .pricing-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }
.price-card { position: relative; text-align: center; }
.price-card.popular { border: 3px solid var(--orbit-orange); box-shadow: var(--shadow-lg); }
.price-card .amount { font-family: var(--font-heading); font-size: 3rem; font-weight: 700; color: var(--space-navy); }
.price-card .amount small { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.price-tag { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); }
.price-list { list-style: none; text-align: left; margin: var(--space-6) 0; }
.price-list li { padding: 8px 0; display: flex; gap: 10px; color: var(--text-soft); font-weight: 500; }
.price-list li svg { color: var(--success); flex: none; width: 20px; height: 20px; }

/* Subjects */
.subjects-row { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.subject-chip { flex: 1; min-width: 200px; padding: var(--space-6); border-radius: var(--radius-lg); color:#fff; position: relative; overflow: hidden; box-shadow: var(--shadow-md); }
.subject-chip h3 { color: #fff; }
.subject-maths { background: linear-gradient(135deg, #FFA784, #FF7547); }
.subject-english { background: linear-gradient(135deg, #A46BF0, #8338EC); }
.subject-french { background: linear-gradient(135deg, #6BD6F5, #2BAFDB); }
.grade-pills { display:flex; gap: var(--space-2); flex-wrap: wrap; }
.grade-pill { padding: 10px 20px; border-radius: var(--radius-pill); background: var(--white); border: 2px solid var(--moon-gray); font-weight: 600; font-family: var(--font-heading); color: var(--space-navy); }

/* Colorful band (was dark-section) */
.dark-section { background: linear-gradient(135deg, #F2E8FD 0%, #E0F7FE 100%); position: relative; overflow: hidden; }
.dark-section h2, .dark-section h3 { color: var(--space-navy); }
.dark-section .card { background: #fff; }

/* Footer (soft) */
.footer { background: #FFF3EC; color: var(--text-soft); padding: var(--space-16) 0 var(--space-8); border-top: 1px solid var(--moon-gray); }
.footer a { color: var(--text-soft); }
.footer a:hover { color: var(--orbit-orange); }
.footer h4 { color: var(--space-navy) !important; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-8); }
@media (max-width:700px){ .footer-grid{ grid-template-columns: 1fr; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(27,27,58,.45); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 100; padding: var(--space-4); }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-lg); padding: var(--space-8); max-width: 460px; width: 100%; box-shadow: var(--shadow-lg); animation: fadeInUp .3s ease; max-height: 92vh; overflow:auto; }

/* Auth tabs */
.tabs { display: flex; gap: 6px; background: #F1EEE8; padding: 6px; border-radius: var(--radius-pill); margin-bottom: var(--space-6); }
.tab { flex: 1; text-align: center; padding: .6rem; border-radius: var(--radius-pill); font-weight: 600; font-family: var(--font-heading); cursor: pointer; color: var(--text-muted); transition: background-color .2s, color .2s; font-size: .9rem; }
.tab.active { background: var(--white); color: var(--orbit-orange); box-shadow: var(--shadow-sm); }

.alert { padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: var(--space-4); font-weight: 500; }
.alert-error { background: #FDE8E8; color: #c53030; }
.alert-success { background: #E5F9EA; color: #1a8f3c; }
.alert-info { background: #E0F7FE; color: #0e7fa0; }

/* Dashboard layout (all light) */
.dash { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--white); color: var(--text-main); padding: var(--space-6); position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--moon-gray); }
.sidebar .brand { margin-bottom: var(--space-8); }
.side-link { display: flex; align-items: center; gap: 12px; padding: .8rem 1rem; border-radius: var(--radius-md); color: var(--text-soft); font-weight: 600; font-family: var(--font-heading); cursor: pointer; transition: background-color .2s, color .2s; margin-bottom: 4px; }
.side-link:hover { background: #FFF3EC; color: var(--orbit-orange); }
.side-link.active { background: var(--orbit-orange); color: #fff; box-shadow: var(--shadow-glow); }
.side-link svg { width: 20px; height: 20px; flex: none; }
.dash-main { padding: var(--space-8); background: var(--dash-bg); }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-8); flex-wrap: wrap; gap: var(--space-4); }
.dash-header h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
@media (max-width: 820px){
  .dash { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 6px; border-right: none; border-bottom: 1px solid var(--moon-gray); }
  .sidebar .brand { width: 100%; margin-bottom: var(--space-4); }
  .side-link { flex: 1; justify-content: center; min-width: 120px; }
}

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: var(--space-4); }
.stat { background: var(--white); border-radius: var(--radius-lg); padding: var(--space-6); border: 2px solid var(--moon-gray); box-shadow: var(--shadow-sm); }
.stat .num { font-family: var(--font-heading); font-size: 2.4rem; font-weight: 700; color: var(--orbit-orange); }
.stat .lbl { color: var(--text-muted); font-size: .9rem; font-weight: 600; }

.panel { background: var(--white); border-radius: var(--radius-lg); border: 2px solid var(--moon-gray); box-shadow: var(--shadow-sm); padding: var(--space-6); margin-bottom: var(--space-6); }
.panel h3 { margin-bottom: var(--space-4); }
.view { display: none; }
.view.active { display: block; animation: fadeInUp .4s ease; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--moon-gray); font-size: .92rem; }
th { font-family: var(--font-heading); font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
tr:hover td { background: #FBF9F5; }
.table-wrap { overflow-x: auto; }

/* Progress bars */
.pbar { background: var(--moon-gray); border-radius: var(--radius-pill); height: 12px; overflow: hidden; }
.pbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--comet-teal), var(--orbit-orange)); border-radius: var(--radius-pill); transition: width .6s ease; }
.prog-row { margin-bottom: var(--space-4); }
.prog-row .flex { margin-bottom: 6px; font-weight: 600; font-size: .9rem; }

/* Lesson / countdown cards */
.lesson-card { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-6); border: 2px solid var(--moon-gray); border-radius: var(--radius-md); background: #fff; margin-bottom: var(--space-3); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.lesson-card:hover { transform: scale(1.01); box-shadow: var(--shadow-md); border-color: var(--comet-teal); }
.countdown-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: var(--space-4); }
.countdown-card { border-radius: var(--radius-lg); padding: var(--space-6); color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-md); }
.countdown-card .cd-time { font-family: var(--font-heading); font-size: 1.7rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.countdown-card .cd-time svg { width: 22px; height: 22px; }

/* Avatars */
.avatar-orb { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 32% 30%, #FFC7AD, var(--orbit-orange)); box-shadow: 0 6px 18px rgba(255,143,102,.35); flex: none; }
.avatar-orb svg { width: 34px; height: 34px; color: #fff; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.avatar-pick { border: 2px solid var(--moon-gray); border-radius: var(--radius-lg); padding: var(--space-3); cursor: pointer; text-align: center; background: var(--white); transition: border-color .2s, transform .2s; }
.avatar-pick:hover { transform: translateY(-3px); border-color: var(--comet-teal); }
.avatar-pick.selected { border-color: var(--orbit-orange); box-shadow: var(--shadow-glow); }

/* Stars */
.stars { display: inline-flex; gap: 3px; }
.stars svg { width: 20px; height: 20px; }

/* Student theme = light & joyful (no dark!) */
.theme-student { background: linear-gradient(170deg, #EAF7FE 0%, #FDFBF7 45%, #FFF3EC 100%); }
.theme-student .sidebar { background: var(--white); }
.theme-student .dash-main { background: transparent; }

/* Camera */
.camera-frame { position: relative; width: 260px; height: 260px; border-radius: 50%; overflow: hidden; margin: 0 auto var(--space-4); border: 4px dashed var(--orbit-orange); background: #F1EEE8; }
.camera-frame video, .camera-frame img, .camera-frame canvas { width: 100%; height: 100%; object-fit: cover; }

.workspace-q { border: 2px solid var(--moon-gray); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-3); background: #FBF9F5; }
.stage-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-6); }
.stage-btn { padding: .55rem 1.1rem; border-radius: var(--radius-pill); border: 2px solid var(--moon-gray); background: #fff; cursor: pointer; font-weight: 600; font-family: var(--font-heading); font-size: .85rem; transition: background-color .2s, color .2s, border-color .2s; }
.stage-btn.active { background: var(--orbit-orange); color: #fff; border-color: var(--orbit-orange); }

.hidden { display: none !important; }
.saving-dot { font-size: .8rem; color: var(--success); font-weight: 700; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--moon-gray); border-top-color: var(--orbit-orange); border-radius: 50%; animation: spin2 .8s linear infinite; margin: var(--space-8) auto; }
@keyframes spin2 { to { transform: rotate(360deg); } }
