/* Alippo Courses. A quiet frame for loud kitchen photos (docs/UI-PREMIUM-DESIGN.md):
   aubergine ink and white, one hairline grey, magenta only for the next action and "you are here". */
:root {
  --brand: #e30047;
  --brand-deep: #b4003a;
  --blush: #fcebf1;
  --ink: #221727;
  --ink-2: #4a3f4f;
  --muted: #6b6170;
  --line: #e7e2e9;
  --page: #f5f3f6;
  --surface: #ffffff;
  --stage: #1c1320;
  --focus: #2b5bd7;
  --r-photo: 14px;
  --r-panel: 20px;
  --r-sm: 10px;
  --pad: clamp(18px, 4.5vw, 40px);
  --wide: 1160px;
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); }
body { min-height: 100dvh; }
img { display: block; max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Type */
.t-display { font-size: clamp(1.85rem, 1.25rem + 2.6vw, 2.9rem); line-height: 1.08; font-weight: 780; letter-spacing: -0.028em; margin: 0; text-wrap: balance; }
.t-title { font-size: 1.25rem; line-height: 1.25; font-weight: 750; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.t-body { font-size: 1rem; }
.t-small { font-size: .875rem; color: var(--muted); }
.error { color: #b0001f; }

/* Buttons: one filled style for the next step, one quiet style for everything else */
.btn {
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0;
  background: var(--brand); color: #fff; letter-spacing: -0.005em;
  transition: background-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--brand-deep); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #c9bfcd; }
.btn.small { min-height: 44px; padding: 0 18px; font-size: .9375rem; }
.btn .play { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 2px; }
.text-btn { white-space: nowrap; font: inherit; font-size: .9375rem; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 4px; }
.text-btn:hover { color: var(--ink); }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar-in { max-width: var(--wide); margin: 0 auto; padding: 0 var(--pad); min-height: 60px; display: flex; align-items: center; gap: 12px; }
.bar .home { display: inline-flex; align-items: center; min-height: 44px; flex: none; color: var(--ink); text-decoration: none; }
.bar .home img { height: 24px; width: auto; }
.bar .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; margin-left: 14px; align-self: stretch; }
.tabs a { display: flex; align-items: center; white-space: nowrap; color: var(--muted); text-decoration: none; padding: 0 10px; font-weight: 600; font-size: .9375rem; box-shadow: inset 0 -2px 0 transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
@media (max-width: 420px) { .bar-in { gap: 6px; } .tabs { margin-left: 2px; } .tabs a { padding: 0 7px; } .bar .home img { height: 21px; } }
/* Smallest phones: the tabs take their own row under the logo */
@media (max-width: 359px) {
  .bar-in { flex-wrap: wrap; row-gap: 0; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 0 0 -7px; min-height: 44px; }
}

.page { max-width: var(--wide); margin: 0 auto; padding: 28px var(--pad) 72px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; background: var(--surface); }
.login-brand { background: var(--brand); color: #fff; padding: 28px var(--pad) 36px; display: flex; flex-direction: column; gap: 28px; position: relative; overflow: hidden; }
.login-brand img { height: 30px; width: auto; align-self: flex-start; }
.login-brand p { margin: 0; font-size: 1.6rem; line-height: 1.12; max-width: 14ch; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.login-form { padding: 36px var(--pad) 48px; width: 100%; max-width: 440px; margin: 0 auto; }
.login-form h1 { margin-bottom: 10px; }
.login-form .lead { margin: 0 0 28px; color: var(--muted); }
@media (min-width: 860px) {
  .login { grid-template-columns: minmax(340px, 5fr) 7fr; grid-template-rows: 1fr; }
  .login-brand { padding: 48px 56px; justify-content: space-between; }
  .login-brand p { font-size: clamp(2.6rem, 4vw, 3.6rem); line-height: 1.02; }
  .login-form { align-self: center; padding: 48px; }
}
label { display: block; font-weight: 650; font-size: .9375rem; margin: 0 0 8px; }
.field { display: flex; gap: 8px; }
input {
  font: inherit; width: 100%; min-height: 54px; padding: 0 16px; color: var(--ink);
  border: 1px solid #d6ccd9; border-radius: 14px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 4px rgba(34,23,39,.08); }
input.cc { width: 84px; flex: none; text-align: center; }
input.code { font-size: 1.7rem; font-weight: 650; letter-spacing: .45em; text-align: center; padding-left: .45em; }
.stack { display: grid; gap: 10px; margin-top: 20px; }
.stack .btn { width: 100%; }
.msg { min-height: 1.5em; margin: 14px 0 0; font-size: .9375rem; }

/* ---------- Shared page parts ---------- */
.narrow { max-width: 820px; margin-inline: auto; }
.hello { margin: 0 0 2px; color: var(--muted); font-weight: 600; }
.hello:empty { display: none; }
.h-page { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); line-height: 1.12; font-weight: 760; letter-spacing: -0.022em; margin: 0 0 18px; text-wrap: balance; }
.label { font-size: .9375rem; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.account { margin: 36px 0 0; display: flex; align-items: center; gap: 6px; }
.empty { border-top: 1px solid var(--line); padding: 24px 0 0; max-width: 560px; }
.empty h2 { margin: 0 0 6px; }
.ph { display: grid; place-items: center; background: var(--blush); color: var(--brand-deep); font-weight: 800; font-size: 1.4rem; width: 100%; height: 100%; }
progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 99px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 99px; }
.thumb { width: 64px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--blush); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- My courses: what to watch next, then every course with its progress ---------- */
.continue { margin: 0 0 28px; }
.continue-row, .course-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  color: inherit; text-decoration: none; background: var(--surface); border-radius: 16px; padding: 12px 14px 12px 12px;
  box-shadow: 0 0 0 1px var(--line);
}
.continue-row:hover, .course-row:hover { box-shadow: 0 0 0 1px #cfc5d3; }
.continue-row .what, .course-row .what { display: grid; gap: 4px; min-width: 0; }
.continue-row strong, .course-row strong { font-weight: 700; line-height: 1.3; }
.continue-row .what > span { color: var(--muted); font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.course-row progress { margin: 4px 0 0; max-width: 320px; }
.course-row .go { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); margin-right: 6px; }
@media (min-width: 720px) { .thumb { width: 76px; } .continue-row, .course-row { grid-template-columns: 76px minmax(0, 1fr) auto; padding: 14px 20px 14px 14px; gap: 18px; } }

/* ---------- Course page ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9375rem; min-height: 44px; margin: -12px 0 2px; }
.crumb:hover { color: var(--ink); }
.crumb::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.progress-line { display: grid; gap: 8px; margin: -6px 0 18px; }
.progress-line progress { max-width: 420px; }
.btn.wide { width: 100%; justify-content: flex-start; padding: 0 22px; min-height: 54px; }
.btn .resume-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (min-width: 720px) { .btn.wide { width: auto; max-width: 100%; } }
.lessons-head { display: grid; gap: 10px; margin: 26px 0 10px; }
.books { margin: 14px 0 0; background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--line); padding: 0 16px; }
.books .files { margin: 0 0 6px; }
@media (min-width: 720px) { .lessons-head { grid-template-columns: 1fr 280px; align-items: center; } }
.lessons-head input { min-height: 44px; border-radius: 999px; padding: 0 18px; font-size: .9375rem; }

/* Lessons, grouped by module (overview and the lesson view's side list) */
.modules { position: relative; background: var(--surface); border-radius: 16px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.module + .module { border-top: 1px solid var(--line); }
.module summary { list-style: none; cursor: pointer; padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; min-height: 56px; }
.module summary:hover { background: #faf9fb; }
.module summary::-webkit-details-marker { display: none; }
.module summary .name { font-weight: 650; line-height: 1.3; }
.module summary .n { grid-column: 1; color: var(--muted); font-size: .8125rem; }
.module summary::after { content: ""; grid-row: 1 / span 2; grid-column: 2; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 0; transition: transform .15s; }
.module[open] summary::after { transform: rotate(225deg); margin: 4px 4px 0 0; }
.module ol { list-style: none; margin: 0; padding: 0 0 6px; }
.lesson {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  min-height: 48px; padding: 8px 18px 8px 15px; border-left: 3px solid transparent;
  color: var(--ink-2); text-decoration: none; line-height: 1.35;
}
.lesson:hover { background: #faf9fb; color: var(--ink); }
.lesson .dur, .lesson .tag { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.lesson .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.lesson.video .mark { box-shadow: inset 0 0 0 1.5px #b7adbb; }
.lesson.video .mark::before { content: ""; border-left: 7px solid var(--ink-2); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; margin-left: 2px; }
.lesson.done .mark { background: #1f8a4c; }
.lesson.done .mark::before { content: ""; width: 5px; height: 9px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); margin-top: -2px; }
.lesson.none, .lesson.link { color: var(--muted); }
.lesson.link .mark { box-shadow: inset 0 0 0 1.5px #b7adbb; }
.lesson.link .mark::before { content: ""; width: 7px; height: 7px; border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: translate(-1px, 1px); }
.lesson.none .mark::before { content: ""; width: 10px; height: 1.5px; background: #b7adbb; }
.lesson[aria-current="true"] { background: var(--blush); border-left-color: var(--brand); color: var(--ink); font-weight: 650; }
.no-match { padding: 16px 18px; color: var(--muted); margin: 0; }
/* The list clips its corners, so focus rings go inside the row */
.lesson:focus-visible, .module summary:focus-visible { outline-offset: -3px; }

/* Folded sections: course books, about */
.section { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.fold summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 48px; font-weight: 750; font-size: 1.125rem; letter-spacing: -0.012em; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 0; }
.fold[open] summary::after { transform: rotate(225deg); margin: 4px 4px 0 0; }
.fold p { white-space: pre-line; margin: 6px 0 0; color: var(--ink-2); max-width: 68ch; }

/* Lesson view: the player first; on wide windows the lesson list sits on the right */
.layout { display: grid; gap: 28px; }
.layout > * { min-width: 0; }
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; }
  .side { position: sticky; top: 84px; max-height: calc(100dvh - 104px); display: flex; flex-direction: column; }
  .side .modules { overflow: auto; overscroll-behavior: contain; }
}
.side-title { font-size: 1.0625rem; margin: 0 0 10px; }
.side-title .narrow-only { display: none; }
@media (max-width: 979px) { .side-title .wide-only { display: none; } .side-title .narrow-only { display: inline; } }
/* Phones: under the video, only the module you're in ("All lessons" above goes back to the whole course) */
@media (max-width: 979px) { .side .module:not([open]) { display: none; } .side .module summary { display: none; } }
.stage .screen { margin: 0 calc(var(--pad) * -1); }
@media (min-width: 720px) { .stage .screen { margin: 0; } }
.screen { aspect-ratio: 16 / 9; background: var(--stage); color: rgba(255,255,255,.8); display: grid; place-items: center; text-align: center; padding: 24px; }
@media (min-width: 720px) { .screen { border-radius: var(--r-panel); } }
.screen:has(video) { padding: 0; }
.screen video { width: 100%; height: 100%; background: #000; display: block; border-radius: inherit; }
.screen .out { display: grid; gap: 16px; justify-items: center; max-width: 34ch; }
.screen .out p { margin: 0; font-size: 1.0625rem; }
.stage .screen.bare { aspect-ratio: auto; margin: 0; padding: 14px 16px; background: var(--surface); color: var(--ink-2); place-items: start; text-align: left; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.screen.bare .out { display: flex; align-items: center; gap: 12px; max-width: none; }
.screen.bare .out p { font-size: .9375rem; }
.screen .glyph { width: 22px; height: 28px; flex: none; border: 2px solid var(--muted); border-radius: 4px; position: relative; }
.screen .glyph::before { content: ""; position: absolute; left: 5px; right: 5px; top: 8px; height: 1.5px; background: var(--muted); box-shadow: 0 5px 0 var(--muted), 0 10px 0 var(--muted); }
.lesson-info { padding: 18px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.lesson-info .t-title { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); line-height: 1.15; letter-spacing: -0.02em; }
.lesson-info .where { margin: 0; }
.lesson-info .desc { margin: 6px 0 0; color: var(--ink-2); white-space: pre-line; max-width: 68ch; }
.lesson-info .desc:empty { display: none; }
.stepper { display: flex; justify-content: space-between; align-items: stretch; gap: 10px; margin-top: 14px; }
.next-up { flex: 0 1 auto; min-width: 0; max-width: min(100%, 420px); flex-direction: column; align-items: flex-start; gap: 0; padding: 7px 24px; line-height: 1.25; }
.stepper > #prev { min-height: auto; }
.next-up .next-label { font-size: .8125rem; font-weight: 600; }
.next-up .next-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-up .next-title:empty { display: none; }

/* Files: plain rows with a document mark */
.files { list-style: none; padding: 0; margin: 6px 0 0; display: grid; }
.files:empty { display: none; }
.files li + li { border-top: 1px solid var(--line); }
.files a { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; min-height: 56px; padding: 8px 2px; color: var(--ink); font-weight: 600; text-decoration: none; }
.files a::before { content: ""; width: 28px; height: 34px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 34'%3E%3Cpath d='M3 1h15l9 9v20a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3z' fill='%23fcebf1'/%3E%3Cpath d='M18 1v6a3 3 0 0 0 3 3h6' fill='%23f6c9d8'/%3E%3Ctext x='13' y='26' font-family='system-ui,sans-serif' font-size='8' font-weight='800' fill='%23b4003a' text-anchor='middle'%3EPDF%3C/text%3E%3C/svg%3E") center / contain no-repeat; }
.files a::after { content: "Open"; color: var(--muted); font-weight: 600; font-size: .875rem; }
.files a:hover::after { color: var(--ink); }
