/* Deutsch Deluxe – online placement test + question editor (uses tokens from site.css) */
.tst-hero { padding-block: 150px 64px; }
.tst-section { background: var(--mist); padding-block: 56px 96px; }
.tst-wrap { max-width: 860px; }
.tst-progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.tst-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: inherit; transition: width .4s ease; }
.tst-card { background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: 36px; box-shadow: 0 18px 50px rgba(0,28,48,.08); }
.tst-card h2.display { font-size: clamp(26px, 3vw, 36px); color: var(--navy); margin-bottom: 8px; }
.tst-card > p { margin: 0 0 14px; color: var(--muted); }
.tst-sub { font-weight: 700; color: var(--navy) !important; }
.tst-tip { background: #fff8e6; border: 1px solid #f6dc9a; color: #5d4204 !important; padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.tst-small { font-size: 14px; }
.tst-level { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 28px; padding-inline: 8px; border-radius: 8px; background: var(--navy); color: var(--white); font: 800 14px var(--font-body); vertical-align: middle; }
.tst-loading { min-height: 220px; display: grid; place-items: center; }
.tst-loading span { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold); animation: tst-spin 1s linear infinite; }
@keyframes tst-spin { to { transform: rotate(360deg); } }

/* form */
.tst-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 10px; }
.tst-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--navy); font-size: 15px; min-width: 0; }
.tst-wide { grid-column: 1 / -1; }
.tst-form input, .tst-form select, .adm input, .adm select, .adm textarea {
  font: inherit; font-weight: 500; color: var(--ink); background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%; }
.tst-form input:focus, .tst-form select:focus, .adm input:focus, .adm select:focus, .adm textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,180,35,.25); }

/* buttons */
button.btn { cursor: pointer; font-family: inherit; font-size: inherit; }
.btn-line { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-line:hover { border-color: var(--navy); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.tst-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.tst-msg { margin: 16px 0 0; color: #a3251b !important; font-weight: 700; }
.btn-wa { gap: 10px; }
.tst-link { background: none; border: 0; color: var(--gold-ink); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; }
.tst-link:hover { text-decoration: underline; }

/* player */
.tst-player { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--navy); color: var(--white); border-radius: 18px; padding: 16px 20px; margin: 18px 0 8px; }
.tst-play { display: inline-flex; align-items: center; gap: 10px; background: var(--gold); color: var(--navy); border: 0; border-radius: 999px; padding: 10px 22px 10px 16px; min-height: 52px; font: inherit; font-weight: 800; cursor: pointer; }
.tst-play[disabled] { opacity: .45; cursor: not-allowed; }
.tst-wave { display: inline-flex; align-items: center; gap: 4px; height: 30px; }
.tst-wave i { width: 4px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.4); }
.tst-wave.on i { background: var(--gold); animation: tst-wave 1s ease-in-out infinite; }
.tst-wave.on i:nth-child(2) { animation-delay: .1s } .tst-wave.on i:nth-child(3) { animation-delay: .2s } .tst-wave.on i:nth-child(4) { animation-delay: .3s }
.tst-wave.on i:nth-child(5) { animation-delay: .4s } .tst-wave.on i:nth-child(6) { animation-delay: .5s } .tst-wave.on i:nth-child(7) { animation-delay: .6s }
@keyframes tst-wave { 0%, 100% { height: 8px } 50% { height: 28px } }
.tst-left { margin-inline-start: auto; font-size: 14px; color: #c9d6e2; }

/* questions */
.tst-qs { list-style: none; counter-reset: q; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.tst-qs > li { counter-increment: q; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.tst-q { margin: 0 0 12px; font-weight: 700; color: var(--navy); font-size: 18px; text-align: left; }
.tst-q::before { content: counter(q) ". "; color: var(--gold-ink); }
.tst-gap { display: inline-block; min-width: 70px; border-bottom: 2px solid var(--gold); margin-inline: 4px; }
.tst-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.tst-opt { position: relative; display: inline-flex; align-items: center; min-height: 46px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; background: var(--white); }
.tst-opt:hover { border-color: var(--gold); }
.tst-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tst-opt:has(input:checked) { background: var(--navy); color: var(--white); border-color: var(--navy); }
.tst-opt:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.tst-opt-x { color: var(--muted); border-style: dashed; }

/* speaking */
.tst-speak { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.tst-speak > li { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.tst-sp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; font-weight: 700; color: var(--muted); flex-wrap: wrap; }
.tst-sentence { margin: 0; font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 26px); color: var(--navy); line-height: 1.35; text-align: left; width: 100%; }
html[lang="ar"] .tst-sentence { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #e0483e; flex: none; }
.btn-rec { background: #fdecea; color: #a3251b; border-color: #f3b8b2; }
.btn-rec.on .rec-dot { animation: tst-pulse 1s ease-in-out infinite; }
@keyframes tst-pulse { 50% { opacity: .25; transform: scale(.7); } }
.tst-score { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tst-pill { display: inline-flex; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--mist); color: var(--navy); }
.tst-pill.good { background: #e3f5e9; color: #17663a; } .tst-pill.mid { background: #fff4d6; color: #7a5300; } .tst-pill.low { background: #fdecea; color: #a3251b; }
.tst-heard { font-size: 14px; color: var(--muted); }
.tst-speak audio { width: 100%; max-width: 420px; height: 40px; }

/* result */
.tst-badges { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 6px 0 18px; }
.tst-badge { background: var(--navy); color: var(--white); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.tst-badge span { color: #c9d6e2; font-weight: 600; }
.tst-badge strong { font: 400 46px/1 var(--font-display); font-family: "DM Serif Display", Georgia, serif; }
.tst-badge.gold { background: var(--gold); color: var(--navy); } .tst-badge.gold span { color: var(--navy); }
.tst-kpis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tst-kpis li { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.tst-kpis b { font-size: 22px; color: var(--navy); }
.tst-h3 { margin: 24px 0 10px; color: var(--navy); font-size: 18px; }
.tst-bars { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tst-bars li { display: grid; grid-template-columns: 50px 1fr 52px; gap: 12px; align-items: center; }
.tst-bar { height: 12px; background: var(--mist); border-radius: 999px; overflow: hidden; direction: ltr; }
.tst-bar span { display: block; height: 100%; background: #9fb0c0; border-radius: inherit; }
.tst-bar span.pass { background: var(--gold); }

@media (max-width: 640px) {
  .tst-card { padding: 22px 18px; border-radius: 18px; }
  .tst-form, .tst-badges { grid-template-columns: 1fr; }
  .tst-kpis { grid-template-columns: 1fr; }
  .tst-nav .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .tst-wave.on i, .btn-rec.on .rec-dot, .tst-loading span { animation: none; } }

/* ---------- question editor (admin.html) ---------- */
.adm { max-width: 980px; }
.adm-bar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--white); }
.adm-bar .wrap { display: flex; align-items: center; gap: 14px; padding-block: 12px; flex-wrap: wrap; }
.adm-bar img { height: 42px; width: auto; }
.adm-bar h1 { font-size: 18px; margin: 0; margin-inline-end: auto; }
.adm-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 18px; }
.adm-sec { display: flex; flex-direction: column; gap: 14px; }
.adm-item { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.adm-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adm-row > label { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; color: var(--navy); min-width: 0; }
.adm-row > label.adm-lv { flex: 0 0 110px; }
.adm-num { font-weight: 800; color: var(--gold-ink); }
.adm-opts { display: flex; flex-direction: column; gap: 8px; }
.adm-opt { display: flex; gap: 8px; align-items: center; }
.adm-opt input[type="radio"] { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: #17663a; }
.adm-opt input[type="text"] { flex: 1; min-height: 42px; padding-block: 8px; }
.adm-sub { border: 1px dashed var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--mist); }
.adm-x { background: none; border: 1px solid var(--line); border-radius: 10px; min-width: 42px; min-height: 42px; cursor: pointer; color: #a3251b; font: inherit; font-weight: 800; }
.adm-x:hover { border-color: #a3251b; }
.adm-mini { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.adm-hint { font-size: 13px; color: var(--muted); margin: 0; }
.adm-audio { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adm-audio audio { height: 40px; max-width: 100%; }
.adm-toast { position: fixed; inset-inline: 16px; bottom: 20px; margin-inline: auto; max-width: 420px; background: var(--navy); color: var(--white); padding: 14px 18px; border-radius: 14px; font-weight: 700; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.3); text-align: center; }
.adm-toast.err { background: #a3251b; }
.adm-login { max-width: 420px; margin: 80px auto; }
.adm textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
[dir="ltr"].adm-de, .adm-de { direction: ltr; text-align: left; }
