/* ===== Stellair Academy — styles ===== */
:root {
  --navy: #131E29; --navy-2: #1b2a38; --lime: #CDEA80; --teal: #28606E; --light: #DDE5ED; --orange: #FF5600;
  --bg: #f4f7fa; --paper: #ffffff; --ink: #1b2430; --muted: #5b6774; --rule: #d6dee6; --soft: #eef2f6;
  --lime-soft: #eef7d5; --orange-soft: #fff0e8; --teal-soft: #e4eef1;
  --ok: #2f9e44; --warn: #e8a100; --bad: #d6336c;
  --font-display: "Orbitron", "Avenir Next", sans-serif;
  --font-body: "Inter", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --radius: 12px; --shadow: 0 6px 24px rgba(19,30,41,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0e151d; --paper: #15202b; --ink: #e8eef4; --muted: #9fb0c0; --rule: #2a3946; --soft: #1b2733; --lime-soft: #26331a; --orange-soft: #3a2316; --teal-soft: #17313a; --navy-2: #0b1219; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; margin-top: 1.6em; padding-bottom: .3em; border-bottom: 2px solid var(--lime); }
h3 { font-size: .85rem; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .05em; margin-top: 1.3em; }
p { margin: 0 0 .8em; }
strong { color: var(--ink); font-weight: 700; }
em { color: var(--teal); font-style: normal; font-weight: 600; }
ul, ol { margin: .3em 0 1em 1.25em; padding: 0; }
li { margin-bottom: .35em; }
li::marker { color: var(--orange); font-weight: 700; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.kw { display: inline-block; background: var(--lime); color: #131E29; border-radius: 4px; padding: 0 .4em; font-weight: 700; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: .5em; border: 0; border-radius: 10px; padding: .7em 1.2em; font-weight: 700; cursor: pointer; background: var(--orange); color: #fff; transition: transform .08s, box-shadow .2s; font-family: var(--font-display); font-size: .85rem; letter-spacing: .02em; }
.btn:hover { box-shadow: 0 6px 18px rgba(255,86,0,.35); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--rule); }
.btn.lime { background: var(--lime); color: #131E29; }
.btn.sm { padding: .45em .8em; font-size: .75rem; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(255,86,0,.45); outline-offset: 2px; }

/* ---- Forms ---- */
.field { display: grid; gap: .3em; margin-bottom: 1em; }
.field label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select { width: 100%; padding: .7em .9em; border: 1.5px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); }
textarea { min-height: 5em; resize: vertical; }
.error { color: var(--bad); font-weight: 600; font-size: .9rem; min-height: 1.2em; }
.notice { background: var(--teal-soft); border-left: 4px solid var(--teal); padding: .7em 1em; border-radius: 8px; margin: 1em 0; }

/* ---- Auth page ---- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: var(--navy); color: #fff; position: relative; overflow: hidden; padding: clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero .glow { position: absolute; right: -30%; top: -30%; width: 90%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,86,0,.8), rgba(255,86,0,.15) 45%, transparent 70%); }
.auth-hero .glow2 { position: absolute; left: -30%; bottom: -40%; width: 90%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(40,96,110,.9), rgba(40,96,110,.2) 45%, transparent 70%); }
.auth-hero > * { position: relative; }
.auth-hero img { width: 180px; }
.auth-hero .kicker { font-family: var(--font-display); letter-spacing: .3em; font-size: .7rem; color: var(--lime); text-transform: uppercase; margin-bottom: .6em; }
.auth-hero h1 { color: #fff; font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); font-weight: 900; }
.auth-hero h1 span { color: var(--orange); }
.auth-hero p { color: var(--light); max-width: 34ch; font-size: 1.05rem; }
.auth-hero .meta { font-family: var(--font-display); font-size: .65rem; letter-spacing: .12em; color: var(--light); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 64px); }
.auth-card { width: 100%; max-width: 420px; }
.tabs { display: flex; gap: .4em; margin-bottom: 1.4em; border-bottom: 1.5px solid var(--rule); }
.tabs button { background: none; border: 0; padding: .6em 1em; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; font-family: var(--font-display); font-size: .8rem; }
.tabs button.active { color: var(--ink); border-color: var(--orange); }
@media (max-width: 820px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { min-height: 40vh; } }

/* ---- App shell ---- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 1.2em; padding: .6em max(16px, 3vw); }
.topbar img { height: 26px; }
.topbar nav { display: flex; gap: .2em; margin-left: auto; }
.topbar nav a { color: var(--light); padding: .45em .8em; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar .who { font-size: .8rem; color: var(--light); }
.topbar .who b { color: var(--lime); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.6em max(16px, 3vw) 4em; }
.reading { max-width: 780px; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 1em; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 .4em; }

/* ---- Dashboard ---- */
.hero-card { background: linear-gradient(135deg, var(--navy), #1f3a46 70%, #2c5663); color: #fff; border-radius: 16px; padding: 1.6em 1.8em; display: grid; grid-template-columns: 1fr auto; gap: 1.5em; align-items: center; margin-bottom: 1.6em; }
.hero-card h1 { color: #fff; margin-bottom: .2em; }
.hero-card p { color: var(--light); margin: 0; }
.ring { --p: 0; width: 110px; height: 110px; border-radius: 50%; background: conic-gradient(var(--lime) calc(var(--p) * 1%), rgba(255,255,255,.15) 0); display: grid; place-items: center; position: relative; }
.ring::after { content: ""; position: absolute; inset: 10px; background: var(--navy); border-radius: 50%; }
.ring span { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--lime); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1em; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1em 1.2em; box-shadow: var(--shadow); }
.module-card { display: grid; gap: .6em; cursor: pointer; transition: transform .1s; }
.module-card:hover { transform: translateY(-2px); }
.module-card .num { font-family: var(--font-display); font-weight: 900; color: var(--orange); font-size: 1.4rem; }
.module-card h3 { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 1rem; margin: 0; }
.module-card p { font-size: .9rem; color: var(--muted); margin: 0; }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--lime); width: 0; transition: width .4s; }
.bar.orange i { background: var(--orange); }
.pill { display: inline-block; font-family: var(--font-display); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; padding: .25em .6em; border-radius: 99px; background: var(--soft); color: var(--muted); font-weight: 700; }
.pill.ok { background: #e3f6e8; color: #1f7a33; }
.pill.warn { background: #fff4d6; color: #8a5a00; }
.pill.bad { background: #ffe3ec; color: #a8174f; }
.pill.lime { background: var(--lime); color: #131E29; }
.pill.orange { background: var(--orange); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.ok { background: #1c3a26; color: #8fe0a3; } :root:not([data-theme="light"]) .pill.warn { background: #3d2f0a; color: #ffd36e; } :root:not([data-theme="light"]) .pill.bad { background: #43182a; color: #ff9ac0; } }

/* ---- Module page / lesson list ---- */
.lesson-list { display: grid; gap: .6em; }
.lesson-row { display: grid; grid-template-columns: 36px 1fr auto; gap: .9em; align-items: center; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: .8em 1em; color: var(--ink); }
.lesson-row:hover { border-color: var(--teal); }
.lesson-row .n { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: .8rem; background: var(--navy); color: #fff; }
.lesson-row.done .n { background: var(--lime); color: #131E29; }
.lesson-row .t { font-weight: 600; }
.lesson-row .s { font-size: .8rem; color: var(--muted); }

/* ---- Lesson content (port of the PDF styles) ---- */
.lesson { background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; padding: clamp(1.2em, 3vw, 2.4em); box-shadow: var(--shadow); }
.lesson .lesson-head { border-bottom: 2px solid var(--lime); padding-bottom: 1em; margin-bottom: 1.4em; }
.lesson .lesson-head .pill { margin-bottom: .6em; }
.lesson .summary { font-size: 1.05rem; color: var(--muted); border-left: 4px solid var(--orange); padding: .3em 0 .3em .9em; margin: 1em 0; }
.lesson table { width: 100%; border-collapse: collapse; margin: .8em 0 1.2em; font-size: .9rem; }
.lesson th { background: var(--navy); color: #fff; font-family: var(--font-display); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: .6em .7em; }
.lesson td { padding: .55em .7em; border-bottom: 1px solid var(--rule); vertical-align: top; }
.lesson tr:nth-child(even) td { background: var(--soft); }
.lesson td.k { font-weight: 700; }
.lesson .tbl-wrap, .lesson .tbl-scroll { overflow-x: auto; }
.lesson .box { border-radius: 10px; padding: .9em 1.1em; margin: 1em 0; }
.lesson .box .t { font-family: var(--font-display); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin-bottom: .4em; }
.lesson .box p:last-child, .lesson .box ul:last-child { margin-bottom: 0; }
.lesson .pat { background: var(--orange-soft); border-left: 5px solid var(--orange); } .lesson .pat .t { color: var(--orange); }
.lesson .rule { background: var(--navy); color: #fff; border-left: 5px solid var(--lime); } .lesson .rule .t { color: var(--lime); } .lesson .rule strong { color: var(--lime); } .lesson .rule em { color: #fff; } .lesson .rule li::marker { color: var(--lime); }
.lesson .tip { background: var(--lime-soft); border-left: 5px solid #9fc84a; } .lesson .tip .t { color: #5e7f1a; }
.lesson .info { background: var(--teal-soft); border-left: 5px solid var(--teal); } .lesson .info .t { color: var(--teal); }
.lesson .script { background: var(--soft); border: 1px solid var(--rule); border-radius: 10px; padding: 1em 1.2em; margin: 1em 0; font-size: .95rem; }
.lesson .script .t { font-family: var(--font-display); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); font-weight: 700; margin-bottom: .4em; }
.lesson .script .q { font-weight: 700; }
.lesson .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9em; margin: .9em 0; }
.lesson .grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8em; margin: .9em 0; }
.lesson .card { box-shadow: none; padding: .9em 1em; }
.lesson .card .h { font-family: var(--font-display); font-size: .75rem; font-weight: 700; margin-bottom: .4em; }
.lesson .card .h .n { display: inline-block; background: var(--orange); color: #fff; border-radius: 4px; padding: .05em .45em; margin-right: .4em; }
.lesson .card p, .lesson .card ul { font-size: .9rem; margin-bottom: .3em; }
.lesson .card.navy { background: var(--navy); color: #fff; border-color: var(--navy); } .lesson .card.navy .h { color: var(--lime); } .lesson .card.navy strong { color: var(--lime); } .lesson .card.navy li::marker { color: var(--lime); }
.lesson .card.lime { background: var(--lime-soft); } .lesson .card.teal { background: var(--teal-soft); }
.lesson .steps { counter-reset: step; margin: .9em 0; display: grid; gap: .7em; }
.lesson .step { display: grid; grid-template-columns: 40px 1fr; gap: .8em; align-items: start; }
.lesson .step::before { counter-increment: step; content: counter(step); font-family: var(--font-display); font-weight: 800; color: #fff; background: var(--navy); border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; }
.lesson .step .s { font-weight: 700; display: block; }
.lesson .step p { margin-bottom: .2em; font-size: .95rem; }
.lesson .flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: .4em; margin: 1em 0; }
.lesson .flow .n { flex: 1 1 120px; background: var(--soft); border: 1px solid var(--rule); border-radius: 8px; padding: .6em; font-size: .8rem; text-align: center; }
.lesson .flow .n b { display: block; font-family: var(--font-display); font-size: .65rem; margin-bottom: .2em; }
.lesson .flow .n.hot { background: var(--orange); color: #fff; border-color: var(--orange); }
.lesson .flow .n.go { background: var(--lime); color: #131E29; border-color: var(--lime); }
.lesson .flow .a { display: flex; align-items: center; color: var(--orange); font-weight: 900; }
.lesson .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7em; margin: 1em 0; }
.lesson .stat { background: var(--navy); color: #fff; border-radius: 10px; padding: .9em .7em; text-align: center; }
.lesson .stat .v { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--lime); }
.lesson .stat .l { font-size: .75rem; color: var(--light); margin-top: .3em; }
.lesson .stat.o { background: var(--orange); } .lesson .stat.o .v { color: #fff; } .lesson .stat.t { background: var(--teal); }
.lesson .check li { list-style: none; position: relative; padding-left: 1.6em; }
.lesson .check li::before { content: ""; position: absolute; left: 0; top: .35em; width: .9em; height: .9em; border: 2px solid var(--teal); border-radius: 4px; }
.lesson .obj { border: 1px solid var(--rule); border-radius: 10px; margin: .9em 0; overflow: hidden; }
.lesson .obj .o { background: var(--navy); color: #fff; padding: .6em 1em; font-weight: 600; }
.lesson .obj .o::before { content: "OBJECTION  "; font-family: var(--font-display); font-size: .6rem; color: var(--orange); letter-spacing: .12em; }
.lesson .obj .r { padding: .7em 1em; font-size: .95rem; background: var(--paper); }
.lesson .obj .r::before { content: "RÉPONSE"; display: block; font-family: var(--font-display); font-size: .6rem; color: var(--teal); letter-spacing: .12em; margin-bottom: .3em; }
.lesson figure { margin: 1.2em 0; overflow-x: auto; }
.lesson figure svg { width: 100%; height: auto; min-width: 560px; display: block; background: #fff; border-radius: 8px; }
.lesson figcaption { font-size: .8rem; color: var(--muted); margin-top: .4em; text-align: center; font-family: var(--font-display); }
.lesson .quote { font-style: italic; border-left: 3px solid var(--lime); padding-left: .9em; }
.lesson .tag { font-family: var(--font-display); font-size: .6rem; background: var(--teal); color: #fff; border-radius: 3px; padding: .1em .5em; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1em; margin-top: 1.5em; flex-wrap: wrap; }
.lesson-nav .btn { flex: 1 1 auto; justify-content: center; }
.done-banner { background: var(--lime-soft); border: 1px solid #cfe39a; border-radius: 10px; padding: .8em 1em; margin-top: 1.5em; display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; }

/* ---- Exam ---- */
.exam-section-title { font-family: var(--font-display); color: var(--orange); font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; margin: 2em 0 .8em; }
.q { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 1.1em 1.2em; margin-bottom: .9em; }
.q .qn { font-family: var(--font-display); font-weight: 800; color: var(--orange); margin-right: .5em; }
.q .qp { font-weight: 600; margin-bottom: .7em; }
.q .opts { display: grid; gap: .4em; }
.q .opts label { display: flex; gap: .6em; align-items: flex-start; padding: .5em .7em; border: 1.5px solid var(--rule); border-radius: 8px; cursor: pointer; }
.q .opts label:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.q .hint { font-size: .8rem; color: var(--muted); margin-top: .4em; }
.exam-footer { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--rule); padding: .9em max(16px, 3vw); display: flex; justify-content: space-between; align-items: center; gap: 1em; margin: 2em calc(-1 * max(16px, 3vw)) -4em; }
.result-hero { text-align: center; padding: 2em 1em; }
.result-hero .big { font-family: var(--font-display); font-size: 3rem; font-weight: 900; color: var(--orange); }

/* ---- Admin ---- */
table.data { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 12px; overflow: hidden; font-size: .9rem; }
table.data th { background: var(--navy); color: #fff; text-align: left; padding: .7em .8em; font-family: var(--font-display); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
table.data td { padding: .65em .8em; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.data tr:hover td { background: var(--soft); }
.scroll-x { overflow-x: auto; }
.grade-q { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 1em 1.2em; margin-bottom: .8em; display: grid; gap: .6em; }
.grade-q .ans { background: var(--soft); border-radius: 8px; padding: .7em .9em; white-space: pre-wrap; }
.grade-q .exp { font-size: .9rem; color: var(--muted); border-left: 3px solid var(--lime); padding-left: .8em; }
.grade-btns { display: flex; gap: .4em; }
.grade-btns button { border: 1.5px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: .4em .9em; cursor: pointer; font-weight: 700; }
.grade-btns button.sel { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8em; margin-bottom: 1.4em; }
.kpi { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 1em; }
.kpi .v { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--orange); }
.kpi .l { font-size: .8rem; color: var(--muted); }
.toast { position: fixed; bottom: 1.2em; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .7em 1.2em; border-radius: 10px; box-shadow: var(--shadow); z-index: 50; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
