/* Look and feel. Rules: /workspace/.work-home/practice-tests-es/VISUAL-DESIGN.md (2026-11-24)
   - body text 7:1 contrast or better; never red/green for meaning; question screens stay bare
   - one font, self-hosted (Atkinson Hyperlegible Next, OFL); motion only as short fades, off with "Menos movimiento" */
@font-face { font-family: "AHN"; src: url("../fonts/AtkinsonHyperlegibleNext.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root, [data-look="a"] {
  /* A · Cálido papel */
  --bg: #FFF8EC; --card: #FFFFFF; --ink: #2B2118; --soft: #5A4636; --line: #E8DCC6;
  --main: #1F5F5B; --main-ink: #FFFFFF; --warm: #9A3B12; --warm-ink: #FFFFFF;
  --mark: #FFE7A8; --calm: #E6F0EE; --es: #7A3410; --en: #1F5F5B;
  --radius: 16px; --shadow: 0 2px 0 rgba(43,33,24,.06), 0 6px 18px rgba(43,33,24,.07);
  --photo-filter: none; --hero-bg: linear-gradient(160deg, #1F5F5B, #174845);
}
[data-look="b"] {
  /* B · Azul claro */
  --bg: #F6F9FC; --card: #FFFFFF; --ink: #14243A; --soft: #3D4F66; --line: #D6E2EF;
  --main: #1D4F91; --main-ink: #FFFFFF; --warm: #8B3A00; --warm-ink: #FFFFFF;
  --mark: #FFE7A8; --calm: #DCEBFA; --es: #8B3A00; --en: #1D4F91;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,36,58,.08), 0 4px 12px rgba(20,36,58,.06);
  --hero-bg: linear-gradient(160deg, #1D4F91, #163E73);
}
[data-look="c"] {
  /* C · Colores por tema (warm paper base, each topic its own colour) */
  --bg: #FFF8EC; --card: #FFFFFF; --ink: #2B2118; --soft: #5A4636; --line: #E8DCC6;
  --main: #2B2118; --main-ink: #FFFFFF; --warm: #9A3B12; --warm-ink: #FFFFFF;
  --mark: #FFE7A8; --calm: #F3EADB; --es: #7A3410; --en: #2B2118;
  --radius: 20px; --shadow: 0 6px 20px rgba(43,33,24,.12);
  --hero-bg: linear-gradient(160deg, #2B2118, #463526);
}
[data-contrast="more"] { --soft: var(--ink); --line: #9A8B76; --bg: #FFFFFF; }

html { font-size: 20px; color-scheme: light only; }
html[data-text="big"] { font-size: 23px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: "AHN", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.48; -webkit-text-size-adjust: 100%; }
main { max-width: 560px; margin: 0 auto; padding: 14px 16px calc(130px + env(safe-area-inset-bottom)); min-height: 100vh; }
.screen { animation: fadein .18s ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
[data-motion="less"] .screen, [data-motion="less"] .known-toast { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .screen, .known-toast { animation: none !important; } }

.test-banner { background: #4B2A7A; color: #fff; text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: .04em; padding: 4px 8px; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 6px 0 10px; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 22px 0 8px; }
p { margin: 8px 0; }
.small { font-size: .82rem; color: var(--soft); }
.muted { color: var(--soft); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--main); font-size: 1.05rem; margin: 2px 0 12px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--calm); color: var(--main); margin-right: 6px; }
.lang { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.lang.en { color: var(--en); } .lang.es { color: var(--es); }
.q-en { font-size: 1.4rem; font-weight: 700; line-height: 1.28; margin: 2px 0 10px; }
.q-es { font-size: 1.1rem; color: var(--es); margin: 2px 0 10px; line-height: 1.4; }
.ans-en { font-size: 1.55rem; font-weight: 800; line-height: 1.25; margin: 4px 0; }
.ans-es { font-size: 1.1rem; color: var(--es); }
mark { background: var(--mark); color: inherit; padding: 0 3px; border-radius: 5px; box-shadow: inset 0 -3px 0 rgba(154,59,18,.35); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.row.gap { margin: 12px 0 14px; }
button, .btn { font: inherit; font-size: 1rem; min-height: 54px; border-radius: 14px; border: 2px solid var(--main);
  background: var(--card); color: var(--main); font-weight: 700; padding: 10px 14px; cursor: pointer; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; touch-action: manipulation; }
button:focus-visible, .btn:focus-visible { outline: 3px solid #E0A526; outline-offset: 2px; }
button.main, .btn.main { background: var(--main); color: var(--main-ink); font-size: 1.12rem; min-height: 60px; border-color: var(--main); }
button.plain, .btn.plain { border-color: var(--line); color: var(--ink); }
button.knew { background: var(--main); color: var(--main-ink); border-color: var(--main); }
button.notyet { background: var(--card); color: var(--warm); border-color: var(--warm); }
.icon { font-size: 1.15em; line-height: 1; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, var(--bg) 72%, transparent);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); z-index: 5; }
.dock .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.dock .inner > * { flex: 1; }
.speed { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.speed button { min-height: 44px; border: 0; border-radius: 0; font-size: .88rem; padding: 6px 16px; }
.speed button[aria-pressed="true"] { background: var(--main); color: var(--main-ink); }
.say { background: var(--calm); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.warm { background: #FFF1D6; border-radius: 12px; padding: 12px 14px; font-weight: 700; color: #4A2A10; }
.bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--main); border-radius: 999px; }
details { margin: 10px 0; }
summary { cursor: pointer; font-weight: 700; color: var(--main); min-height: 44px; display: flex; align-items: center; }
ul { padding-left: 1.2em; margin: 6px 0; } li { margin: 4px 0; }
label { display: block; font-weight: 700; margin: 12px 0 4px; }
input[type=date], input[type=time], input[type=text], textarea { font: inherit; font-size: 1rem; width: 100%; min-height: 54px; padding: 10px 12px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
textarea { min-height: 90px; font-size: .78rem; }
.choice { display: block; width: 100%; text-align: left; justify-content: flex-start; margin: 10px 0; padding: 16px; line-height: 1.3; }
.choice small { display: block; font-weight: 400; color: var(--soft); font-size: .85rem; margin-top: 4px; }
.stats p { margin: 6px 0; }
.big { font-size: 1.28rem; font-weight: 800; }
a { color: var(--main); }
.links { display: grid; gap: 10px; margin-top: 16px; }
.links .btn { width: 100%; }
.loading { padding: 40px 0; text-align: center; color: var(--soft); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.steps li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--main); color: var(--main-ink); display: grid; place-items: center; font-weight: 800; }

/* pictures */
.pic { margin: 12px 0 4px; }
.pic img { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: calc(var(--radius) - 4px); background: var(--line); }
.pic.tall img { max-height: 280px; object-fit: contain; background: #F1E9DA; }
.pic figcaption { font-size: .64rem; color: var(--soft); margin-top: 4px; line-height: 1.3; }

/* footer (every screen) */
.foot { margin: 28px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); font-size: .74rem; color: var(--soft); line-height: 1.45; }
.foot a { color: var(--soft); }

/* home */
.hero { background: var(--hero-bg); color: #fff; border-radius: var(--radius); padding: 16px 18px; margin: 4px 0 14px; }
.hero .hello { font-size: .86rem; margin: 0; }
.hero .count { font-size: 1.3rem; font-weight: 800; margin: 2px 0 8px; }
.hero .bar { background: rgba(255,255,255,.28); }
.hero .bar > span { background: #FFE7A8; }
.hero .sub { font-size: .82rem; margin: 6px 0 0; }
.countdown { display: inline-block; background: rgba(255,255,255,.18); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; margin-bottom: 8px; }
.door { display: grid; grid-template-columns: 96px 1fr; width: 100%; text-align: left; align-items: stretch; gap: 0; margin: 12px 0;
  padding: 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink); min-height: 108px; overflow: hidden; box-shadow: var(--shadow); }
.door .door-pic { background-size: cover; background-position: center; filter: var(--photo-filter); position: relative; }
.door .door-txt { padding: 14px; display: block; position: relative; }
.door b { display: block; font-size: 1.15rem; color: var(--main); }
.door small { display: block; font-weight: 400; color: var(--soft); font-size: .84rem; margin-top: 2px; line-height: 1.3; }
.door .door-status { color: var(--es); font-weight: 700; margin-top: 6px; }
.door-main { border: 2px solid var(--main); }
/* map */
.map { display: grid; gap: 8px; }
.map-row { display: grid; grid-template-columns: 48px 1fr auto; grid-template-areas: "p t n" "p d d"; gap: 2px 10px; width: 100%; text-align: left;
  justify-content: stretch; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 10px 10px; min-height: 0; color: var(--ink); background: var(--card); align-items: center; }
.map-pic { grid-area: p; width: 48px; height: 48px; border-radius: 10px; background-size: cover; background-position: center; }
.map-title { grid-area: t; font-size: .92rem; }
.map-n { grid-area: n; font-size: .82rem; color: var(--soft); }
.map-dots { grid-area: d; display: flex; flex-wrap: wrap; gap: 1px; line-height: 1; }
.d { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin: 0 2px 2px 0; vertical-align: middle; border: 2px solid var(--main); }
.d-known { background: var(--main); }
.d-learning { background: linear-gradient(90deg, var(--main) 50%, var(--card) 50%); }
.d-new { border-color: #B5AD9C; background: var(--card); }
.legend .d { margin-left: 6px; }
/* guide */
.back { min-height: 44px; font-size: .88rem; padding: 6px 12px; }
.chapter { display: grid; grid-template-columns: 72px 1fr auto; width: 100%; text-align: left; gap: 12px; margin: 10px 0; padding: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.chapter .ch-pic { width: 72px; height: 72px; border-radius: 12px; background-size: cover; background-position: center; }
.chapter b { display: block; color: var(--main); }
.chapter small { display: block; font-weight: 400; color: var(--soft); font-size: .8rem; }
.ring { --p: 0; flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--main) calc(var(--p) * 1%), var(--line) 0); }
.ring > span { width: 42px; height: 42px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: .7rem; font-weight: 800; }
.ch-head { margin: 4px 0 12px; height: 160px; border-radius: var(--radius); background-size: cover; background-position: center; position: relative; overflow: hidden; }
.ch-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.62), transparent 65%); }
.ch-head h1 { position: absolute; left: 14px; right: 14px; bottom: 8px; color: #fff; z-index: 1; margin: 0; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.qlist { display: grid; gap: 6px; margin: 12px 0; }
.qrow { display: flex; width: 100%; text-align: left; justify-content: flex-start; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-weight: 600; font-size: .94rem; }
.qrow small { display: block; font-weight: 400; color: var(--es); font-size: .84rem; margin-top: 2px; }
.qnum { flex: none; width: 30px; color: var(--soft); font-size: .84rem; padding-top: 2px; }
.qtext { flex: 1; }
.st { flex: none; }
.qrow .st .d { width: 14px; height: 14px; }
.navrow { margin-top: 10px; }
button[disabled] { opacity: .35; }
/* exam history */
.hist { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; }
.hcol { flex: 1; max-width: 70px; display: flex; flex-direction: column; align-items: center; }
.hwrap { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100px; border-top: 2px dashed #C98A1A; }
.hbar { display: block; width: 70%; background: #B9C9CF; border-radius: 6px 6px 0 0; }
.hbar.ok { background: var(--main); }
.hcol small { font-size: .76rem; font-weight: 700; }
.hcol .hdate { font-weight: 400; color: var(--soft); }
/* the "known" moment: one 400 ms fade-and-scale, nothing else */
.known-toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 20; background: var(--main); color: var(--main-ink);
  border-radius: 999px; padding: 10px 18px; font-weight: 800; box-shadow: 0 8px 24px rgba(0,0,0,.2); display: flex; gap: 10px; align-items: center;
  animation: known .4s ease-out; white-space: nowrap; }
.known-toast .ck { width: 28px; height: 28px; border-radius: 50%; background: #FFE7A8; color: #1F5F5B; display: grid; place-items: center; font-size: 1rem; }
@keyframes known { from { opacity: 0; transform: translateX(-50%) scale(.85); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
/* settings */
.toggles { display: grid; gap: 8px; }
.toggle { justify-content: space-between; width: 100%; border-color: var(--line); color: var(--ink); }
.toggle .sw { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.toggle[aria-pressed="true"] .sw { background: var(--main); }
.toggle[aria-pressed="true"] .sw::after { left: 21px; }

/* C · topic colours and big picture doors */
[data-look="c"] .door { border: 0; color: #fff; min-height: 156px; grid-template-columns: 1fr; position: relative; }
[data-look="c"] .door .door-pic { position: absolute; inset: 0; }
[data-look="c"] .door .door-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,14,8,.9) 35%, rgba(20,14,8,.1)); }
[data-look="c"] .door .door-txt { z-index: 1; padding-top: 72px; }
[data-look="c"] .door b, [data-look="c"] .door small { color: #fff; }
[data-look="c"] .door .door-status { color: #FFE7A8; }
[data-look="c"] .chapter { border: 0; border-left: 8px solid var(--tc, var(--main)); }
[data-look="c"] .chapter b { color: var(--tc, var(--main)); }
[data-look="c"] .ring { background: conic-gradient(var(--tc, var(--main)) calc(var(--p) * 1%), var(--line) 0); }
[data-look="c"] .map-row { border-left: 6px solid var(--tc, var(--main)); }
[data-look="c"] .map-row .d { border-color: var(--tc, var(--main)); }
[data-look="c"] .map-row .d-known { background: var(--tc, var(--main)); }
[data-look="c"] .map-row .d-learning { background: linear-gradient(90deg, var(--tc, var(--main)) 50%, #fff 50%); }
[data-look="c"] .map-row .d-new { border-color: #B5AD9C; }
/* B · flatter, no shadows */
[data-look="b"] .door, [data-look="b"] .card, [data-look="b"] .chapter { box-shadow: none; }
[data-look="c"] .tc-scope { --main: var(--tc); --en: var(--tc); }
.pic.small-pic img { max-height: 170px; }
/* iPhone: date/time boxes ignore width and spill past the screen unless their native look is turned off */
input[type=date], input[type=time], input[type=text] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; border-radius: 14px; }
input::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { opacity: .7; }
.form { display: grid; gap: 10px; }
.form > * { width: 100%; margin: 0; }
.form label { margin: 10px 0 0; }
.form details { border: 2px solid var(--line); border-radius: 14px; padding: 2px 14px; background: var(--card); }
input[type=date], input[type=time], input[type=text] { height: 54px; min-height: 54px; padding-top: 0; padding-bottom: 0; line-height: 50px; }
.form details > summary { justify-content: center; text-align: center; color: var(--ink); min-height: 50px; }
/* step lists: one text block per step (iPhone split bold words into columns when the li itself was the flex row) */
.steps li > span { flex: 1; min-width: 0; text-align: left; }
.ico { width: 1.35em; height: 1.35em; vertical-align: -0.3em; color: var(--main); background: var(--calm); border-radius: 6px; padding: 2px; margin-left: 2px; }
.form details[open] { padding-bottom: 10px; }
