@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113; }

:root {
  --teal: #1c6478; --teal-dark: #143f4e; --teal-pale: #e8f4f8;
  --pink: #e0378a; --pink-light: #f05da0; --pink-pale: #fdf0f6;
  --white: #fff; --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
  --gray-400: #94a3b8; --gray-600: #475569; --gray-800: #1e293b;
  --radius: 12px; --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06); --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: var(--gray-800); background: var(--gray-50); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
img { max-width: 100%; height: auto; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }

/* cabecera */
.top { background: var(--teal-dark); color: #fff; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--teal-light, #2a8099) 0%, var(--pink) 100%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); position: relative; flex: none; }
.brand .mark::after { content: ""; position: absolute; inset: 8px; border-radius: 3px; border: 2px solid rgba(255,255,255,.9); border-right-color: transparent; }
.brand .name { display: flex; flex-direction: column; font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; line-height: 1.1; }
.brand .name small { font-size: .66rem; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.65); }
.top nav a { color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600; font-size: .95rem; }
.top nav a:hover { color: #fff; }

/* portada */
.hero { background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%); color: #fff; padding: 56px 0 64px; }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pink-light); }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; margin: 12px 0 14px; max-width: 760px; text-wrap: balance; }
.hero p { font-size: 1.1rem; max-width: 640px; opacity: .9; }
.search { margin-top: 28px; max-width: 640px; position: relative; }
.search input { width: 100%; font: inherit; font-size: 1.05rem; padding: 16px 18px 16px 48px; border-radius: var(--radius); border: 2px solid transparent; outline: none; color: var(--gray-800); box-shadow: var(--shadow-md); }
.search input:focus { border-color: var(--pink); }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }

/* filtros y lista */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 8px; }
.chip { font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-600); }
.chip small { color: var(--gray-400); font-weight: 600; margin-left: 4px; }
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip[aria-pressed="true"] small { color: rgba(255,255,255,.7); }
.count { color: var(--gray-600); font-size: .92rem; margin: 14px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding-bottom: 72px; }
.card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px 20px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--teal); }
.card .area { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pink); }
.card h2 { font-size: 1.02rem; font-weight: 700; line-height: 1.3; color: var(--teal-dark); }
.card p { font-size: .9rem; color: var(--gray-600); line-height: 1.5; }
.card[hidden] { display: none; }
.empty { padding: 40px 0 80px; color: var(--gray-600); }

/* ficha */
.crumbs { font-size: .88rem; color: var(--gray-600); padding: 24px 0 0; }
.crumbs a { color: var(--gray-600); }
.ficha-head { padding: 18px 0 8px; }
.ficha-head .kicker { color: var(--pink); }
.ficha-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--teal-dark); margin: 8px 0 10px; text-wrap: balance; }
.ficha-head p { font-size: 1.1rem; color: var(--gray-600); }
.where { display: inline-block; margin-top: 18px; padding: 10px 16px; background: var(--teal-pale); border-left: 3px solid var(--teal); border-radius: 0 8px 8px 0; font-size: .95rem; }
.where b:first-child { color: var(--pink); margin-right: 8px; }
.steps { list-style: none; display: grid; gap: 14px; margin: 28px 0; counter-reset: step; }
.step { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px 22px 20px 66px; position: relative; box-shadow: var(--shadow-sm); counter-increment: step; }
.step::before { content: counter(step); position: absolute; left: 20px; top: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; font-size: .95rem; display: grid; place-items: center; }
.step p { font-size: 1.02rem; }
.step strong, .notes strong, .where strong { color: var(--teal-dark); }
.step figure { margin-top: 14px; }
.step img { display: block; border: 1px solid var(--gray-200); border-radius: 8px; cursor: zoom-in; }
.notes { background: var(--pink-pale); border: 1px solid #f4c4dc; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 32px; }
.notes h2 { font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--pink); margin-bottom: 8px; }
.notes ul { padding-left: 18px; display: grid; gap: 6px; }
.more h2 { font-size: 1.05rem; font-weight: 800; color: var(--teal-dark); margin-bottom: 12px; }
.more .grid { padding-bottom: 28px; }
.pager { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0 72px; }
.pager a { flex: 1; max-width: 48%; text-decoration: none; border: 1px solid var(--gray-200); background: var(--white); border-radius: var(--radius); padding: 14px 18px; font-weight: 700; color: var(--teal-dark); line-height: 1.3; }
.pager a small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 2px; }
.pager a.next { text-align: right; margin-left: auto; }
.pager a:hover { border-color: var(--teal); }
dialog.zoom { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; margin: auto; }
dialog.zoom::backdrop { background: rgba(15, 42, 53, .85); }
dialog.zoom img { display: block; max-width: 96vw; max-height: 96vh; border-radius: 8px; cursor: zoom-out; }

footer { background: var(--teal-dark); color: rgba(255,255,255,.7); font-size: .88rem; padding: 28px 0; }
footer a { color: #fff; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
@media (max-width: 640px) {
  .hero { padding: 40px 0 48px; }
  .grid { grid-template-columns: 1fr; }
  .brand .name small { display: none; }
  .step { padding: 62px 18px 18px; }
  .pager { flex-direction: column; } .pager a { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ── plataforma: botones, avisos, acceso, planes, cursos ── */
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a.on { color: #fff; box-shadow: 0 2px 0 var(--pink-light); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; padding: 12px 22px; border-radius: 10px; border: 2px solid var(--pink); background: var(--pink); color: #fff; transition: background .15s, border-color .15s; }
.btn:hover { background: #c92c79; border-color: #c92c79; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 7px 16px; font-size: .92rem; }
.top nav a.btn { color: #fff; }
.btn-outline { background: transparent; color: var(--teal-dark); border-color: var(--gray-200); }
.btn-outline:hover { background: var(--gray-100); border-color: var(--teal); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--teal); }
.btn-ghost:hover { background: var(--teal-pale); border-color: transparent; }
.btn-ms { background: #fff; color: #1e293b; border-color: var(--gray-200); width: 100%; }
.btn-ms:hover { background: var(--gray-100); border-color: var(--gray-400); }
button.link { font: inherit; background: none; border: 0; color: var(--teal); text-decoration: underline; cursor: pointer; }
.muted { color: var(--gray-600); }
.flash { margin: 18px 0 0; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.flash.ok { background: #e7f6ee; color: #14613a; border: 1px solid #b6e2c8; }
.flash.ko { background: #fdecec; color: #9b1c1c; border: 1px solid #f5c2c2; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); margin-right: 6px; }
.badge.ok { background: #e7f6ee; color: #14613a; }
.hero-sm { padding: 40px 0 44px; }
.hero-sm h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.hero .actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 22px; }
.progress-text { opacity: .85; font-size: .95rem; }
.panel { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 1.1rem; color: var(--teal-dark); margin-bottom: 6px; }
.panel p + p, .panel p + .btn { margin-top: 10px; }

.auth { display: grid; place-items: start center; padding: 56px 24px 96px; }
.auth .panel { width: 100%; max-width: 440px; }
.auth h1 { font-size: 1.6rem; color: var(--teal-dark); letter-spacing: -.02em; }
.auth .muted { margin: 6px 0 22px; }
.auth .hint { font-size: .85rem; color: var(--gray-600); margin-top: 10px; }
.auth .or { text-align: center; margin: 18px 0; color: var(--gray-400); position: relative; }
.auth .or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--gray-200); }
.auth .or span { position: relative; background: #fff; padding: 0 12px; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
input[type=email], input[type=number] { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 10px; outline: none; }
input[type=email]:focus, input[type=number]:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-pale); }
.auth form .btn { width: 100%; margin-top: 14px; }
.field-error { color: #9b1c1c; font-size: .88rem; margin-top: 6px; }

.paywall { background: var(--teal-dark); color: #fff; border-radius: var(--radius); padding: 28px 30px; margin: 8px 0 32px; }
.paywall .kicker { color: var(--pink-light); }
.paywall h2 { font-size: 1.3rem; font-weight: 800; margin: 6px 0 8px; }
.paywall p { color: rgba(255,255,255,.85); }
.paywall strong { color: #fff; }
.paywall .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.paywall .btn-ghost { color: #fff; }
.paywall .btn-ghost:hover { background: rgba(255,255,255,.12); }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 40px 24px 88px; align-items: stretch; }
.plan { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.plan.featured { border-color: var(--pink); box-shadow: var(--shadow-md); }
.plan h2 { font-size: 1.15rem; color: var(--teal-dark); }
.plan .price { font-size: 2rem; font-weight: 800; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.plan .price small { font-size: .9rem; font-weight: 600; color: var(--gray-600); }
.plan ul { list-style: none; display: grid; gap: 8px; margin: 6px 0 14px; flex: 1; }
.plan li { padding-left: 22px; position: relative; font-size: .95rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
.plan .btn { width: 100%; }
.plan form + form { margin-top: 2px; }
.seats { display: grid; grid-template-columns: auto 90px; gap: 8px 12px; align-items: center; }
.seats label { margin: 0; }
.seats .btn { grid-column: 1 / -1; }

.account { padding: 40px 24px 88px; display: grid; gap: 16px; }
.account h1 { font-size: 1.8rem; color: var(--teal-dark); letter-spacing: -.02em; }
.grid.courses { padding-top: 36px; }
.outline { padding: 36px 24px 88px; }
.outline h2 { font-size: 1.05rem; font-weight: 800; color: var(--teal-dark); margin: 28px 0 10px; }
.lessons { list-style: none; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.lessons li + li { border-top: 1px solid var(--gray-100); }
.lessons a { display: flex; align-items: center; gap: 12px; padding: 14px 18px; text-decoration: none; color: var(--gray-800); }
.lessons a:hover { background: var(--gray-50); }
.lessons .t { flex: 1; font-weight: 600; }
.lessons .meta { font-size: .85rem; color: var(--gray-600); white-space: nowrap; }
.free { color: var(--pink); margin-left: 6px; }
.dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--gray-200); display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; }
.dot.done { background: var(--teal); border-color: var(--teal); }

.lesson-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 36px; padding-top: 28px; max-width: 1280px; }
.toc { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; font-size: .92rem; }
.toc .back { display: block; font-weight: 700; text-decoration: none; margin-bottom: 14px; }
.toc h2 { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-600); margin: 16px 0 6px; }
.toc ol { list-style: none; }
.toc li a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--gray-800); line-height: 1.35; }
.toc li a:hover { background: var(--gray-100); }
.toc li a.current { background: var(--teal-pale); font-weight: 700; color: var(--teal-dark); }
.toc .dot { width: 18px; height: 18px; font-size: .65rem; }
.lesson .kicker { color: var(--pink); }
.lesson h1 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; color: var(--teal-dark); line-height: 1.15; margin: 6px 0 20px; }
.pdf iframe { width: 100%; height: min(86vh, 1100px); border: 1px solid var(--gray-200); border-radius: var(--radius); background: #fff; display: block; }
.pdf-links { font-size: .9rem; margin: 10px 0 24px; }
.video { position: relative; aspect-ratio: 16 / 9; margin-bottom: 24px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.prose { max-width: 70ch; margin-bottom: 24px; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { color: var(--teal-dark); line-height: 1.25; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.complete { margin: 8px 0 28px; }
@media (max-width: 900px) {
  .plans { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; order: 2; border-top: 1px solid var(--gray-200); padding-top: 20px; margin-bottom: 40px; }
  .top nav { gap: 14px; font-size: .9rem; }
}

/* ── material de apoyo: glosario, errores, chuleta, itinerarios ── */
.material { padding: 32px 24px 80px; }
.material h2 { font-size: 1.15rem; font-weight: 800; color: var(--teal-dark); margin: 30px 0 12px; scroll-margin-top: 16px; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; }
.letters a { font-weight: 800; text-decoration: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--white); border: 1px solid var(--gray-200); }
.letters a:hover { border-color: var(--pink); color: var(--pink); }
.gloss { display: grid; gap: 10px; }
.gloss > div, .err { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px 18px; scroll-margin-top: 16px; }
.gloss dt { font-weight: 800; color: var(--teal-dark); }
.gloss dd { color: var(--gray-600); }
:target { box-shadow: 0 0 0 3px var(--pink-pale), 0 0 0 4px var(--pink); }
.err { margin-bottom: 12px; }
.err-tag { font-size: .78rem; font-weight: 700; color: var(--gray-600); }
.err-tag small { color: var(--gray-400); margin-left: 6px; }
.k { display: inline-block; padding: 2px 8px; border-radius: 999px; margin-right: 6px; background: var(--gray-100); }
.k-error { background: #fdecec; color: #9b1c1c; } .k-aviso { background: #fff7e6; color: #8a5a00; } .k-pregunta, .k-mensaje { background: var(--teal-pale); color: var(--teal-dark); }
.err h3 { font-size: 1rem; color: var(--teal-dark); margin: 6px 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.err dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 14px; font-size: .95rem; }
.err dt { font-weight: 700; color: var(--pink); }
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.sheet h2 { margin-top: 0; }
.sheet dl > div { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--gray-100); font-size: .93rem; scroll-margin-top: 16px; }
.sheet dt { flex: none; min-width: 120px; }
.sheet kbd { font: inherit; font-size: .82rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--gray-200); background: var(--gray-50); color: var(--teal-dark); }
.route-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; scroll-margin-top: 16px; }
.route-card h2 { margin-top: 0; }
.route-card .mods { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.route-card summary { cursor: pointer; font-weight: 700; color: var(--pink); }
.route-card ol { margin: 10px 0 0 22px; display: grid; gap: 4px; }
@media (max-width: 640px) { .err dl { grid-template-columns: 1fr; } }
