:root {
  --blue: #035ba4;
  --blue-dark: #013b75;
  --blue-light: #dfeefe;
  --ink: #0d1726;
  --muted: #5f6f82;
  --line: rgba(3, 91, 164, 0.14);
  --paper: #ffffff;
  --wash: #f5f9ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: linear-gradient(180deg, #f5faff 0%, #ffffff 38%); font-family: Georgia, "Times New Roman", serif; line-height: 1.65; }
button, input, textarea { font: inherit; }
a { color: inherit; }
.page-width { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.test-header { padding: 1rem 0; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { color: var(--blue); font: 800 1.1rem Inter, Arial, sans-serif; text-decoration: none; }
.back-link { color: var(--muted); font: 700 .9rem Inter, Arial, sans-serif; text-decoration: none; }
.test-main { padding: 3rem 0 5rem; }
.test-hero { text-align: center; margin-bottom: 2rem; }
.eyebrow, .part-label, .chip { display: inline-block; color: var(--blue); background: var(--blue-light); border-radius: 999px; padding: .35rem .75rem; font: 800 .75rem Inter, Arial, sans-serif; }
h1, h2, h3 { line-height: 1.2; }
h1 { margin: 1rem 0 .6rem; font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { margin: .5rem 0 1rem; color: var(--blue-dark); font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { margin: 1.5rem 0 .5rem; }
.test-hero p { color: var(--muted); margin: 0 auto; max-width: 700px; }
.auth-required, .test-section { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 30px rgba(3,91,164,.06); padding: clamp(1.2rem, 4vw, 2rem); margin-top: 1.5rem; }
.auth-required { text-align: center; }
.auth-required p { color: var(--muted); }
.timer-panel { position: sticky; top: 70px; z-index: 4; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: center; background: var(--blue-dark); color: #fff; border-radius: 16px; padding: 1rem 1.25rem; margin-top: 1.5rem; box-shadow: 0 12px 30px rgba(3,91,164,.18); }
.timer-panel strong { display: block; font: 800 clamp(1.35rem, 3vw, 2rem) Inter, Arial, sans-serif; letter-spacing: .04em; }
.timer-label { display: block; color: rgba(255,255,255,.72); font: 700 .72rem Inter, Arial, sans-serif; text-transform: uppercase; }
.timer-panel p { grid-column: 1 / -1; margin: 0; color: rgba(255,255,255,.86); font: 600 .9rem Inter, Arial, sans-serif; }
.test-section.section-locked { position: relative; opacity: .58; }
.test-section.section-locked::after { content: "Esta parte está cerrada"; position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; border-radius: inherit; background: rgba(245,249,255,.9); color: var(--blue-dark); font: 800 1.1rem Inter, Arial, sans-serif; text-align: center; }
.section-start { margin: 0 0 1rem; }
.section-start[disabled] { opacity: .55; cursor: not-allowed; }
.section-finish { margin: 0 0 1rem .5rem; background: var(--blue-light); color: var(--blue-dark); }
.section-finish[disabled] { opacity: .55; cursor: not-allowed; }
.action-link, .score-button { display: inline-block; border: 0; border-radius: 10px; padding: .8rem 1.1rem; background: var(--blue); color: #fff; font: 700 .95rem Inter, Arial, sans-serif; text-decoration: none; cursor: pointer; }
.instructions { background: var(--wash); border-left: 4px solid var(--blue); padding: 1rem 1.2rem; margin: 1rem 0 1.5rem; }
.instructions ul { margin-bottom: 0; }
.reading-text, .audio-script { background: #fbfdff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; white-space: pre-line; }
.question-list { padding-left: 1.5rem; }
.question { margin: 1.2rem 0; padding: .9rem 1rem; background: #fff; border: 1px solid rgba(3,91,164,.1); border-radius: 10px; }
.question p { margin: 0 0 .5rem; font-weight: 700; }
.option { display: block; margin: .35rem 0; font-weight: 400; }
.option input { accent-color: var(--blue); margin-right: .45rem; }
.audio-controls { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; }
.tts-button { border: 1px solid var(--blue); border-radius: 8px; padding: .55rem .8rem; background: #fff; color: var(--blue); font: 700 .85rem Inter, Arial, sans-serif; cursor: pointer; }
.tts-button:hover, .tts-button:focus { background: var(--blue-light); }
textarea { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: .9rem; color: var(--ink); background: #fbfdff; }
.rubric { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .94rem; }
.rubric th, .rubric td { border: 1px solid var(--line); padding: .65rem; text-align: left; vertical-align: top; }
.rubric th { background: var(--blue-light); color: var(--blue-dark); }
.score-result { margin-top: 1rem; color: var(--blue-dark); font-weight: 700; }
.evaluator-score { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; color: var(--blue-dark); font-weight: 700; }
.evaluator-score input { width: 74px; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; color: var(--ink); }
.final-result { margin-top: 1.2rem; padding: 1rem 1.2rem; border-left: 4px solid var(--blue); border-radius: 8px; background: var(--blue-light); color: var(--blue-dark); }
.final-result strong { display: block; font: 800 1.25rem Inter, Arial, sans-serif; }
.final-result p { margin: .35rem 0 0; }
.certificate-contact { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(3,91,164,.16); }
.certificate-contact strong { display: block; color: var(--blue-dark); font: 800 1.08rem Inter, Arial, sans-serif; }
.certificate-contact p { margin: .35rem 0 .8rem; }
.whatsapp-button { display: inline-block; padding: .75rem 1rem; border-radius: 10px; background: #128c7e; color: #fff; font: 700 .92rem Inter, Arial, sans-serif; text-decoration: none; }
.whatsapp-button:hover, .whatsapp-button:focus { background: #0b6f63; }
.final-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.final-table th, .final-table td { border-bottom: 1px solid var(--line); padding: .7rem; text-align: left; }
.final-table th { color: var(--blue-dark); }
@media (max-width: 640px) { .header-inner { align-items: flex-start; flex-direction: column; } .test-main { padding-top: 2rem; } .rubric { display: block; overflow-x: auto; } .timer-panel { top: 0; } }
