/* AI Academy components. Built only on tokens.css; see /design.html for every part in use. */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text); font-family: var(--font-sans); font-size: var(--text-md); line-height: var(--leading-body); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3, h4 { color: var(--text-strong); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-snug); line-height: var(--leading-snug); margin: 0 0 var(--space-3); }
h1, .display { font-size: var(--text-4xl); letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
h2 { font-size: var(--text-3xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-3); }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: var(--radius-sm); }
.em { color: var(--accent-strong); }
.lead { font-size: var(--text-lg); color: var(--text); max-width: 560px; }
.muted { color: var(--text-muted); }
.kicker { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent-strong); }

/* layout */
.container { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-gutter); }
.section { padding: var(--space-8) 0; }
.section + .section { border-top: 1px solid var(--line); }
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stack > * + * { margin-top: var(--space-3); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .section { padding: var(--space-7) 0; } }
@media (max-width: 600px) { :root { --page-gutter: 16px; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-md); border: 1px solid transparent; font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), transform var(--duration) var(--ease); }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text-strong); color: var(--surface); }
.btn-primary:hover { background: color-mix(in srgb, var(--text-strong) 85%, var(--surface)); color: var(--surface); }
.btn-accent { background: var(--accent-fill); color: var(--on-accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent-fill) 86%, #000); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--text-strong); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--text-strong); color: var(--text-strong); }
.btn-ghost { background: transparent; color: var(--text-strong); padding: 0 var(--space-3); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text-strong); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-sm { height: 34px; padding: 0 var(--space-4); font-size: var(--text-xs); }
.btn-lg { height: 52px; padding: 0 var(--space-6); font-size: var(--text-md); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }

/* icons: inline SVG from the sprite, stroke follows text color */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.icon-box { width: 40px; height: 40px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }

/* chips, badges, levels */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text); background: var(--surface-raised); }
.chip-accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent-strong); }
.chip-dark { background: var(--text-strong); color: var(--surface); border-color: transparent; }
.chip-warm { border-color: color-mix(in srgb, var(--warm) 45%, transparent); background: var(--warm-soft); color: var(--warm); }
.level { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-strong); }
.level .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.level .bars i { width: 3px; border-radius: 1px; background: var(--line-strong); }
.level .bars i:nth-child(1) { height: 5px; } .level .bars i:nth-child(2) { height: 8px; } .level .bars i:nth-child(3) { height: 12px; }
.level[data-level="1"] .bars i:nth-child(-n+1), .level[data-level="2"] .bars i:nth-child(-n+2), .level[data-level="3"] .bars i:nth-child(-n+3) { background: var(--accent); }

/* cards */
.card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.card-raised { box-shadow: var(--shadow-md); }
.card-link { display: block; color: inherit; transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease); }
.card-link:hover { border-color: var(--line-strong); text-decoration: none; color: inherit; transform: translateY(-2px); }
.card .card-foot { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: var(--text-sm); color: var(--text-muted); gap: var(--space-3); }
.card .card-foot b { color: var(--text-strong); font-weight: var(--weight-semibold); }

/* track card: the doors on the home page */
.track-card { position: relative; display: flex; flex-direction: column; }
.track-card::before { content: ''; position: absolute; left: var(--space-5); top: -1px; width: 36px; height: 3px; border-radius: 0 0 2px 2px; background: var(--accent); }
.track-card h3 { margin: var(--space-2) 0 var(--space-2); }
.track-card p { font-size: var(--text-sm); flex: 1; }
.track-card .meta { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.track-card.soon { background: transparent; border-style: dashed; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; height: var(--nav-height); display: flex; align-items: center; gap: var(--space-5); padding: 0 var(--page-gutter); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { font-weight: var(--weight-bold); font-size: var(--text-lg); letter-spacing: var(--tracking-snug); color: var(--text-strong); margin-right: auto; }
.brand:hover { text-decoration: none; color: var(--text-strong); }
.brand .dot { color: var(--accent); }
.nav a.link { color: var(--text); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.nav a.link:hover, .nav a.link.on { color: var(--text-strong); text-decoration: none; }
@media (max-width: 700px) { .nav a.link { display: none; } }

/* hero */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-7); align-items: center; padding: var(--space-9) 0 var(--space-8); }
.hero h1 { margin: var(--space-4) 0; }
.hero .actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); flex-wrap: wrap; }
.hero .proof { display: flex; gap: var(--space-5); margin-top: var(--space-6); font-size: var(--text-sm); color: var(--text-muted); flex-wrap: wrap; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: var(--space-7) 0; gap: var(--space-6); } }

/* progress */
.progress { height: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.progress > b { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.progress-steps { list-style: none; margin: 0; padding: 0; }
.progress-steps li { display: flex; align-items: center; gap: var(--space-3); padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--text-sm); }
.progress-steps li .n { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; font-weight: var(--weight-bold); color: var(--text-muted); flex: none; }
.progress-steps li.done .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.progress-steps li.now { color: var(--text-strong); font-weight: var(--weight-semibold); }
.progress-steps li.now .n { border-color: var(--accent); color: var(--accent-strong); }

/* agenda: a lesson's timeline */
.agenda { display: flex; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); }
.agenda > div { flex: var(--min) 1 0; padding: var(--space-2) var(--space-3); font-size: var(--text-xs); border-right: 1px solid var(--line); min-width: 0; }
.agenda > div:last-child { border-right: 0; }
.agenda > div b { display: block; color: var(--text-strong); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda > div.hl { background: var(--accent-soft); }
@media (max-width: 700px) { .agenda { flex-direction: column; } .agenda > div { border-right: 0; border-bottom: 1px solid var(--line); } }

/* forms */
.field { display: block; margin-bottom: var(--space-4); }
.field > span { display: block; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-strong); margin-bottom: 6px; }
.field small { display: block; color: var(--text-muted); font-size: var(--text-xs); margin-top: 6px; }
.input, .select, .textarea { width: 100%; height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--text-strong); font: inherit; font-size: var(--text-sm); transition: border-color var(--duration) var(--ease); }
.textarea { height: auto; min-height: 96px; padding: var(--space-3); resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.field.error .input { border-color: var(--danger); }
.field.error small { color: var(--danger); }
.check { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent-fill); flex: none; }
.segmented { display: inline-flex; padding: 3px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); padding: 6px 14px; border-radius: calc(var(--radius-md) - 3px); cursor: pointer; }
.segmented button.on { background: var(--surface-raised); color: var(--text-strong); box-shadow: var(--shadow-sm); }

/* feedback */
.notice { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-raised); font-size: var(--text-sm); }
.notice .icon { margin-top: 2px; }
.notice-success { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); color: var(--text-strong); }
.notice-success .icon { color: var(--accent-strong); }
.notice-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); color: var(--text-strong); }
.notice-error .icon { color: var(--danger); }
.empty { text-align: center; padding: var(--space-7) var(--space-5); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty .icon-box { margin: 0 auto var(--space-3); }

/* tables (backoffice) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-raised); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 560px; }
.table th { text-align: left; font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); background: var(--surface-sunken); }
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); color: var(--text); }
.table tr:last-child td { border-bottom: 0; }
.table td strong { color: var(--text-strong); font-weight: var(--weight-semibold); }
.dot-cell { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dot-cell.on { background: var(--accent); }

/* slides: 16:9 frames for the classroom screen */
.slide { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface-raised); padding: 6%; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; container-type: inline-size; }
.slide.dark { background: var(--graphite-950); border-color: var(--graphite-800); --text-strong: #F4F4F6; --text: var(--graphite-300); --accent-strong: var(--emerald-300); --line: var(--graphite-800); }
.slide h2 { font-size: 6cqi; margin: 2cqi 0; }
.slide p { font-size: 2.6cqi; max-width: 70%; }
.slide .kicker { font-size: 1.8cqi; }
.slide .slide-foot { position: absolute; left: 6%; right: 6%; bottom: 5%; display: flex; justify-content: space-between; font-size: 1.6cqi; color: var(--text-muted); }

/* certificate */
.seal { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent-strong); display: grid; place-items: center; font-weight: var(--weight-bold); font-size: var(--text-sm); letter-spacing: var(--tracking-snug); flex: none; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: var(--space-6) var(--page-gutter); font-size: var(--text-sm); color: var(--text-muted); display: flex; gap: var(--space-5); flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--text); }

@media print { .nav, .footer, .no-print { display: none !important; } body { background: #fff; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
