:root { font-family: "DM Sans", system-ui, sans-serif; color: #243e38; background: #f6f7f2; font-synthesis: none; --green: #244b42; --muted: #71817a; --border: #dce4dc; --theme-color: #244b42; }
* { box-sizing: border-box; }
body { margin: 0; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
button, textarea, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, a:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #d88a42; outline-offset: 4px; }
.site-header { max-width: 1160px; margin: auto; padding: 27px 32px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--green); font-size: 25px; font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; place-items: center; background: var(--green); color: white; height: 43px; width: 43px; border-radius: 14px; font-size: 24px; }
.brand-subtitle { display: block; font-size: 9px; letter-spacing: 2px; margin-top: 2px; }
.header-tag { font-size: 12px; border: 1px solid var(--border); border-radius: 30px; padding: 9px 14px; }
main { max-width: 1100px; margin: auto; padding: 55px 32px 30px; }
h1, h2, h3 { font-family: Manrope, system-ui, sans-serif; }
h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -2px; line-height: 1.15; margin: 14px 0 19px; }
h2 { line-height: 1.4; letter-spacing: -.5px; }
p { line-height: 1.65; }
.eyebrow { color: #658778; font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.hero { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 42px; margin-bottom: 45px; }
.hero p { color: var(--muted); max-width: 500px; font-size: 16px; }
.accent { color: #78947a; }
.hero-art { position: relative; min-height: 220px; border-radius: 28px; background: #e7eee0; display: grid; place-items: center; overflow: hidden; }
.hero-art::before, .hero-art::after { content: ""; position: absolute; border: 1px solid #c8d8be; width: 280px; height: 280px; border-radius: 50%; }
.hero-art::after { width: 190px; height: 190px; }
.exam-alert { position: relative; overflow: hidden; margin: 0 0 42px; padding: 25px 30px; border: 2px solid #e6ad31; border-radius: 18px; background: linear-gradient(115deg, #fff4cf, #fffdf5 52%, #ffe6a3); color: #493b1e; text-align: center; box-shadow: 0 8px 24px #b47b1b24; }
.exam-alert::before, .exam-alert::after { content: "✦"; position: absolute; color: #e0a323; font-size: 27px; animation: exam-sparkle 2.2s ease-in-out infinite; }
.exam-alert::before { top: 15px; left: 6%; }
.exam-alert::after { right: 6%; bottom: 15px; animation-delay: 1.1s; }
.exam-alert-kicker { margin: 0; color: #995d00; font-size: 12px; font-weight: 900; letter-spacing: 3px; }
.exam-alert-title { display: table; position: relative; margin: 6px auto; color: #805000; font-size: clamp(23px, 4vw, 35px); font-weight: 900; letter-spacing: 1px; animation: exam-flash 2s ease-in-out infinite; }
.exam-alert > p:not(.exam-alert-kicker) { margin: 5px 0 13px; font-size: 14px; }
.exam-alert a { display: inline-block; padding: 10px 17px; border-radius: 10px; background: #805000; color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; }
.exam-alert a:hover { background: #603900; }
.exam-alert a:focus-visible { outline: 3px solid #d88a42; outline-offset: 4px; }
.exam-alert-language { margin-bottom: 15px; }
.exam-alert-compact { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 42px; padding: 12px 18px; border-width: 1px; border-radius: 13px; box-shadow: 0 3px 12px #b47b1b14; }
.exam-alert-compact::before, .exam-alert-compact::after { display: none; }
.exam-alert-compact .exam-alert-kicker { font-size: 9px; letter-spacing: 1.5px; }
.exam-alert-compact .exam-alert-title { margin: 0; font-size: 16px; letter-spacing: .3px; }
.exam-alert-compact > p:not(.exam-alert-kicker) { margin: 0; font-size: 12px; }
.exam-alert-compact a { padding: 8px 12px; font-size: 11px; }
.exam-alert.exam-alert-language { border-color: #d89aa2; background: linear-gradient(115deg, #f9e8ea, #fffafa 52%, #f3dadd); color: #4e3036; box-shadow: 0 8px 24px #923f4820; }
.exam-alert.exam-alert-language::before, .exam-alert.exam-alert-language::after { color: #d88893; }
.exam-alert.exam-alert-language .exam-alert-kicker { color: #923f48; }
.exam-alert.exam-alert-language .exam-alert-title { color: #762e38; animation-name: exam-flash-language; }
.exam-alert.exam-alert-language a { background: #923f48; }
.exam-alert.exam-alert-language a:hover { background: #762e38; }
@keyframes exam-flash-language { 0%, 100% { opacity: 1; text-shadow: 0 0 0 #f2b5bd; } 50% { opacity: .78; text-shadow: 0 0 12px #e9a3ad, 0 0 20px #f7c6cc; } }
@keyframes exam-flash { 0%, 100% { opacity: 1; text-shadow: 0 0 0 #ffc94d; } 50% { opacity: .72; text-shadow: 0 0 13px #f2ae20, 0 0 22px #ffd870; } }
@keyframes exam-sparkle { 0%, 100% { opacity: .45; transform: scale(.8) rotate(0deg); } 50% { opacity: 1; transform: scale(1.25) rotate(25deg); } }
.book { position: relative; z-index: 1; transform: rotate(-9deg); background: var(--green); color: #e8efdf; border-radius: 5px 14px 14px 5px; padding: 27px 25px; width: 137px; box-shadow: 9px 9px 0 #c5d2b9, 15px 18px 26px #244b4222; border-left: 7px solid #183c34; text-align: center; }
.book strong { font-family: Georgia, serif; font-size: 21px; display: block; margin: 18px 0; }
.book span { letter-spacing: 3px; font-size: 8px; }
.art-note { position: absolute; right: 17px; bottom: 20px; background: white; padding: 10px 14px; font-size: 12px; z-index: 2; border-radius: 12px; box-shadow: 0 3px 12px #244b4210; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-heading h2 { font-size: 21px; margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mode-card { border: 1px solid var(--border); background: white; border-radius: 20px; padding: 25px; display: flex; flex-direction: column; align-items: flex-start; transition: transform .2s, box-shadow .2s; }
.mode-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px #244b420c; }
.mode-icon { width: 47px; height: 47px; border-radius: 14px; display: grid; place-items: center; font-size: 23px; background: #e9f0e5; color: #416b4c; }
.mode-card:nth-child(2) .mode-icon { background: #faf0df; color: #aa7436; }
.mode-card:nth-child(3) .mode-icon { background: #eceafa; color: #7868a3; }
.pill { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: #71817a; margin-top: 20px; }
.mode-card h3 { font-size: 20px; margin: 9px 0 0; }
.mode-card p { color: var(--muted); font-size: 13px; margin-bottom: 24px; flex: 1; }
.primary, .secondary { border-radius: 11px; padding: 12px 19px; font-weight: 600; font-size: 13px; border: 1px solid var(--border); }
.primary { background: var(--green); border-color: var(--green); color: white; }
.primary:hover { background: #173d33; }
.secondary { background: white; color: var(--green); }
a.secondary { text-decoration: none; display: inline-block; }
a.primary { text-decoration: none; }
.danger { color: #a25045; border-color: #e6c8c1; }
.danger:hover { background: #fbe9e5; }
.reset-area { margin: 24px 0; }
.student-strip { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; padding: 14px 18px; margin-top: 15px; background: #eaf0e5; border-radius: 12px; }
input:not([type="checkbox"]), select { width: 100%; border: 1px solid var(--border); background: white; color: var(--green); border-radius: 9px; padding: 12px; margin-bottom: 17px; }
input:focus-visible, select:focus-visible { outline: 3px solid #d88a42; outline-offset: 2px; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; line-height: 1.6; }
.consent input { margin-top: 4px; flex-shrink: 0; }
.form-error { color: #a25045; font-size: 13px; line-height: 1.6; }
.ranking { margin: 28px 0; background: white; padding: 24px; border: 1px solid var(--border); border-radius: 18px; }
.ranking select { max-width: 260px; margin-bottom: 0; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: left; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f3f6ef; font-size: 11px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mode-card .primary { width: 100%; text-align: left; display: flex; justify-content: space-between; }
.info-strip { display: flex; gap: 25px; margin: 27px 0; padding: 18px 22px; background: #eaf0e5; border-radius: 13px; font-size: 12px; flex-wrap: wrap; }
.source-note { color: var(--muted); font-size: 12px; line-height: 1.7; }
.source-note summary { cursor: pointer; color: var(--green); }
footer { text-align: center; color: #89958c; font-size: 11px; padding: 25px 20px 32px; }
.exam-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.exam-top h1 { font-size: 30px; letter-spacing: -1px; margin: 10px 0; }
.progress { margin: 23px 0 30px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 10px; color: var(--muted); }
progress { appearance: none; width: 100%; height: 7px; border: 0; border-radius: 10px; overflow: hidden; background: #e0e6dc; }
progress::-webkit-progress-bar { background: #e0e6dc; }
progress::-webkit-progress-value { background: #78947a; border-radius: 10px; }
progress::-moz-progress-bar { background: #78947a; }
.question-card { background: white; border: 1px solid var(--border); padding: 35px; border-radius: 22px; }
.question-card h2 { font-size: 23px; margin: 12px 0 26px; }
.options { display: grid; gap: 12px; }
.option { text-align: left; background: white; border: 1px solid var(--border); padding: 18px; border-radius: 12px; display: flex; gap: 15px; align-items: center; color: #3f514a; line-height: 1.5; font-size: 14px; }
.option-letter { display: grid; place-items: center; border-radius: 8px; background: #f2f4ef; min-width: 31px; height: 31px; font-weight: 700; }
.option.selected { border-color: var(--green); background: #edf3e9; box-shadow: inset 0 0 0 1px var(--green); }
.option.selected .option-letter { background: var(--green); color: white; }
textarea { width: 100%; min-height: 170px; resize: vertical; border: 1px solid #cdd8cf; border-radius: 13px; padding: 18px; color: var(--green); background: #fcfdf9; line-height: 1.6; }
.input-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.nav { display: flex; justify-content: space-between; gap: 15px; margin-top: 25px; flex-wrap: wrap; }
.nav-right { display: flex; gap: 10px; }
.jump-list { display: flex; gap: 6px; flex-wrap: wrap; margin: 24px 0; }
.jump { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: white; color: var(--muted); font-size: 11px; }
.jump.answered { background: #e3eddf; color: var(--green); }
.jump.active { border: 2px solid var(--green); color: var(--green); font-weight: 700; }
.matching { position: relative; display: grid; grid-template-columns: 1fr 80px 1fr; gap: 0; }
.match-column { display: grid; gap: 13px; align-content: start; z-index: 1; }
.match-item { text-align: left; width: 100%; min-height: 83px; background: #fcfdf9; border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-size: 13px; line-height: 1.45; color: var(--green); display: flex; align-items: center; gap: 10px; }
.match-item.active { outline: 2px solid #b57f42; background: #fff6e8; }
.match-item.connected { border-color: #88a18a; background: #edf3e9; }
.match-badge { flex-shrink: 0; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #dde8d5; font-size: 11px; font-weight: 700; }
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: #78947a; }
.match-help { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.result-hero { text-align: center; margin-bottom: 35px; }
.result-hero h1 { font-size: 37px; }
.grade-circle { border: 7px solid #dce8d4; background: #eff5e9; border-radius: 50%; width: 145px; height: 145px; margin: 25px auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.grade-circle strong { font-size: 45px; letter-spacing: -2px; }
.grade-circle span { color: var(--muted); font-size: 12px; }
.stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.stat { padding: 13px 21px; background: white; border: 1px solid var(--border); border-radius: 12px; font-size: 13px; }
.stat strong { display: block; font-size: 22px; margin-bottom: 3px; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 25px; flex-wrap: wrap; }
.review { border: 1px solid var(--border); background: white; border-radius: 16px; padding: 23px; margin: 13px 0; }
.review h3 { font-size: 16px; margin: 14px 0; }
.review p, .review ul { font-size: 13px; line-height: 1.7; margin: 10px 0; }
.status { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 5px 10px; text-transform: uppercase; }
.status.bien { color: #3b6a45; background: #e4efdf; }
.status.regular { color: #956420; background: #fbefd6; }
.status.mal { color: #a25045; background: #fbe9e5; }
.model-answer { background: #eff5e9; border-radius: 10px; padding: 12px 16px; }
.notice:not(:empty) { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #244b42; color: white; border-radius: 12px; padding: 13px 20px; max-width: min(90vw, 600px); z-index: 20; box-shadow: 0 5px 25px #0002; font-size: 13px; }
dialog { border: 1px solid var(--border); border-radius: 20px; padding: 28px; max-width: min(480px, 90vw); color: var(--green); }
dialog::backdrop { background: #173d3355; }
dialog h2 { margin-top: 0; }
dialog .nav { justify-content: flex-end; }
:root[data-theme="dark"] { color-scheme: dark; color: #e0ece5; background: #14211d; --green: #b3dbc6; --muted: #a9bdb1; --border: #41564b; --theme-color: #14211d; }
[data-theme="dark"] .mode-card, [data-theme="dark"] .ranking, [data-theme="dark"] .question-card,
[data-theme="dark"] .stat, [data-theme="dark"] .review, [data-theme="dark"] dialog,
[data-theme="dark"] .secondary, [data-theme="dark"] .option, [data-theme="dark"] .jump,
[data-theme="dark"] input:not([type="checkbox"]), [data-theme="dark"] select,
[data-theme="dark"] textarea, [data-theme="dark"] .match-item { background: #1f3028; color: #e0ece5; }
[data-theme="dark"] .primary, [data-theme="dark"] .brand-mark,
[data-theme="dark"] .option.selected .option-letter { background: #b3dbc6; color: #14211d; }
[data-theme="dark"] .primary:hover { background: #cce9d9; }
[data-theme="dark"] .hero-art, [data-theme="dark"] .student-strip, [data-theme="dark"] .info-strip,
[data-theme="dark"] th, [data-theme="dark"] .option-letter, [data-theme="dark"] .match-badge,
[data-theme="dark"] .model-answer, [data-theme="dark"] .jump.answered,
[data-theme="dark"] .option.selected, [data-theme="dark"] .match-item.connected { background: #2c4436; }
[data-theme="dark"] .hero-art::before, [data-theme="dark"] .hero-art::after { border-color: #41564b; }
[data-theme="dark"] .book { background: #244b42; box-shadow: 9px 9px 0 #41564b; }
[data-theme="dark"] .art-note { background: #1f3028; }
[data-theme="dark"] .eyebrow, [data-theme="dark"] .accent { color: #b3dbc6; }
[data-theme="dark"] .pill, [data-theme="dark"] footer { color: var(--muted); }
[data-theme="dark"] .grade-circle { background: #2c4436; border-color: #527360; }
[data-theme="dark"] .danger, [data-theme="dark"] .form-error { color: #ffb4a7; }
[data-theme="dark"] .danger:hover, [data-theme="dark"] .status.mal { background: #513028; color: #ffb4a7; }
[data-theme="dark"] .match-item.active, [data-theme="dark"] .status.regular { background: #4a3c26; color: #f8d39b; }
[data-theme="dark"] .status.bien { background: #2c4436; color: #c5e8b9; }
[data-theme="dark"] .mode-icon { background: #2c4436; color: #c5e8b9; }
[data-theme="dark"] .mode-card:nth-child(2) .mode-icon { background: #4a3c26; color: #f8d39b; }
[data-theme="dark"] .mode-card:nth-child(3) .mode-icon { background: #3c3550; color: #d5c5ff; }
[data-theme="dark"] progress, [data-theme="dark"] progress::-webkit-progress-bar { background: #41564b; }
[data-theme="dark"] textarea { border-color: var(--border); }

[data-subject="math"] {
  --green: #245681;
  --muted: #61778b;
  --border: #d5e1ec;
  --math-text: #253f56;
  --math-surface: #fff;
  --math-soft: #e7eff8;
  --math-accent: #527ba5;
  --math-button-text: #fff;
  --math-hover: #193f64;
  --math-book: #245681;
  --theme-color: #245681;
}
:root[data-subject="math"] { color: var(--math-text); background: #f3f6fa; }
:root[data-subject="math"][data-theme="dark"] {
  color: var(--math-text);
  background: #14202d;
  --green: #b3d3f2;
  --muted: #a9bdd1;
  --border: #3d5269;
  --math-text: #e0eaf5;
  --math-surface: #1e2f43;
  --math-soft: #293f59;
  --math-accent: #b3d3f2;
  --math-button-text: #14202d;
  --math-hover: #cce2f8;
  --theme-color: #14202d;
}
[data-subject="math"] .primary,
:root[data-subject="math"] .brand-mark,
:root[data-subject="math"] .option.selected .option-letter { background: var(--green); color: var(--math-button-text); }
[data-subject="math"] .primary:hover { background: var(--math-hover); }
[data-subject="math"].mode-card .mode-icon,
:root[data-subject="math"] .mode-card:first-child .mode-icon { background: var(--math-soft); color: var(--green); }
:root[data-subject="math"] .eyebrow, :root[data-subject="math"] .accent,
:root[data-subject="math"] .arrows { color: var(--math-accent); }
:root[data-subject="math"] .hero-art, :root[data-subject="math"] .student-strip,
:root[data-subject="math"] .info-strip, :root[data-subject="math"] th,
:root[data-subject="math"] .option-letter, :root[data-subject="math"] .match-badge,
:root[data-subject="math"] .model-answer, :root[data-subject="math"] .jump.answered,
:root[data-subject="math"] .option.selected, :root[data-subject="math"] .match-item.connected,
:root[data-subject="math"] .grade-circle { background: var(--math-soft); }
:root[data-subject="math"] .hero-art::before, :root[data-subject="math"] .hero-art::after,
:root[data-subject="math"] .grade-circle { border-color: var(--border); }
:root[data-subject="math"] .book {
  background: var(--math-book); color: #e8f1fc; border-left-color: #193f64;
  box-shadow: 9px 9px 0 var(--border), 15px 18px 26px #24568122;
}
:root[data-subject="math"] .art-note { background: var(--math-surface); box-shadow: 0 3px 12px #24568110; }
:root[data-subject="math"] .mode-card:hover { box-shadow: 0 12px 30px #2456810c; }
:root[data-subject="math"] .pill, :root[data-subject="math"] footer { color: var(--muted); }
:root[data-subject="math"] .mode-card, :root[data-subject="math"] .ranking,
:root[data-subject="math"] .question-card, :root[data-subject="math"] .stat,
:root[data-subject="math"] .review, :root[data-subject="math"] dialog,
:root[data-subject="math"] .option, :root[data-subject="math"] .match-item,
:root[data-subject="math"] textarea { background: var(--math-surface); color: var(--math-text); }
:root[data-subject="math"] textarea { border-color: var(--border); }
:root[data-subject="math"] .match-item.connected { background: var(--math-soft); border-color: var(--math-accent); }
:root[data-subject="math"] .option.selected { background: var(--math-soft); }
:root[data-subject="math"] .status.bien { background: var(--math-soft); color: var(--green); }
:root[data-subject="math"] progress,
:root[data-subject="math"] progress::-webkit-progress-bar { background: var(--border); }
:root[data-subject="math"] progress::-webkit-progress-value { background: var(--math-accent); }
:root[data-subject="math"] progress::-moz-progress-bar { background: var(--math-accent); }
:root[data-subject="math"] .notice:not(:empty) { background: var(--math-book); }
:root[data-subject="math"] dialog::backdrop { background: #193f6455; }
:root[data-subject="math"][data-theme="dark"] .secondary,
:root[data-subject="math"][data-theme="dark"] .jump,
:root[data-subject="math"][data-theme="dark"] input:not([type="checkbox"]),
:root[data-subject="math"][data-theme="dark"] select { background: var(--math-surface); color: var(--math-text); }
:root[data-subject="math"][data-theme="dark"] .jump.answered { background: var(--math-soft); color: var(--green); }
:root[data-subject="math"][data-theme="dark"] .secondary.danger { color: #ffb4a7; }
:root[data-subject="math"] .match-item.active { background: #fff6e8; }
:root[data-subject="math"][data-theme="dark"] .match-item.active { background: #4a3c26; color: #f8d39b; }

[data-subject="language"].mode-card { --green: #923f48; }
[data-subject="language"].mode-card .primary { background: var(--green); color: white; }
[data-subject="language"].mode-card .primary:hover { background: #762e38; }
[data-subject="language"].mode-card .mode-icon { background: #f5e5e7; color: var(--green); }

[data-subject="english"].mode-card { --green: #946800; }
[data-subject="english"].mode-card .primary { background: var(--green); color: white; }
[data-subject="english"].mode-card .primary:hover { background: #775300; }
[data-subject="english"].mode-card .mode-icon { background: #fff1bf; color: var(--green); }

@media (max-width: 760px) {
  .site-header { padding: 20px; }
  .site-header { gap: 12px; flex-wrap: wrap; }
  main { padding: 30px 20px; }
  .hero { gap: 20px; grid-template-columns: 1fr; margin-bottom: 30px; }
  .hero-art { min-height: 180px; }
  .book { padding: 14px 20px; width: 120px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { padding: 23px; }
  .header-tag { font-size: 10px; padding: 8px; }
  .question-card { padding: 22px 17px; }
  .question-card h2 { font-size: 19px; }
  .exam-top h1 { font-size: 23px; }
  .section-heading { gap: 12px; }
  .info-strip { gap: 12px; }
  .exam-alert { margin-bottom: 32px; padding: 23px 20px; }
  .matching { grid-template-columns: 1fr 32px 1fr; }
  .match-item { padding: 10px 7px; font-size: 11px; min-height: 100px; flex-direction: column; align-items: flex-start; gap: 5px; overflow-wrap: anywhere; }
  .match-column { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .exam-alert::before, .exam-alert::after, .exam-alert-title { animation: none; }
}
