/* Einstufungstest – Design auf Markenbasis von deutsch-intensivkurs.com:
   Navyblau, warmes Gold, heller warmer Hintergrund, elegante Serifen-Überschriften.
   Eigenständiges, modernes Quiz-Design — kein Nachbau der Startseite. */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&display=swap');

:root {
  --navy: #16243f;
  --navy-deep: #101a30;
  --gold: #c2922e;
  --gold-bright: #d7a63c;
  --gold-soft: #f4e8cf;
  --cream: #faf7f0;
  --cream-deep: #f3eddf;
  --card: #ffffff;
  --line: #e7dfcf;
  --text: #1c2638;
  --text-soft: #5d6575;
  --ok: #2e7d4f;
  --radius: 16px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 2px 14px rgba(22, 36, 63, .07);
  --shadow-lift: 0 8px 26px rgba(22, 36, 63, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 480px at 85% 8%, rgba(215, 166, 60, .14), transparent 65%),
    var(--cream);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Kopf & Fuß ---------- */

.site-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 22px; background: rgba(250, 247, 240, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.12rem; color: var(--navy); text-decoration: none; letter-spacing: .01em; }
.brand em { font-style: normal; color: var(--gold); }
.head-note {
  color: var(--gold); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em;
}

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 34px 18px 70px; }

.site-foot { padding: 22px 16px 34px; text-align: center; color: var(--text-soft); font-size: .85rem; }
.site-foot a { color: var(--navy); font-weight: 600; }

/* ---------- Karten & Typografie ---------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 30px; margin: 16px 0; box-shadow: var(--shadow);
  animation: cardIn .4s cubic-bezier(.2, .7, .3, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 { font-family: var(--serif); font-size: 2rem; line-height: 1.18; margin: .1em 0 .5em; color: var(--navy); }
h2 { font-family: var(--serif); font-size: 1.45rem; line-height: 1.25; margin: .15em 0 .55em; color: var(--navy); }
p.soft { color: var(--text-soft); }
.pre { white-space: pre-line; }

.area-tag {
  display: inline-block; color: var(--gold); background: none;
  font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: 8px;
}

/* ---------- Fortschritt ---------- */

.progress-wrap { margin: 2px 0 18px; }
.progress-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .85rem; color: var(--text-soft); margin-bottom: 7px;
}
.progress-label span:first-child { font-weight: 700; color: var(--navy); letter-spacing: .02em; }
.progress-bar { height: 7px; background: var(--cream-deep); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar > div {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width .45s cubic-bezier(.2, .7, .3, 1);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
  border-radius: 999px; padding: 14px 28px; border: 1.5px solid transparent;
  transition: background .18s, color .18s, box-shadow .18s, transform .12s;
  text-decoration: none; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); box-shadow: var(--shadow-lift); }
.btn-primary:disabled { background: var(--cream-deep); color: #a9a28f; cursor: not-allowed; box-shadow: none; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-bright); box-shadow: var(--shadow-lift); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-ghost:disabled { border-color: var(--line); color: #b5ae9b; background: transparent; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; justify-content: space-between; margin-top: 24px; flex-wrap: wrap; }
.btn-row .spacer { flex: 1; }

/* ---------- Formulare ---------- */

label { display: block; font-weight: 700; margin: 16px 0 6px; color: var(--navy); }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font: inherit; padding: 13px 15px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(194, 146, 46, .18);
}
/* Passwort / Schlüssel ein- und ausblenden */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 50px; }
.pw-toggle {
  position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 9px; background: none; cursor: pointer;
  color: var(--text-soft); transition: color .15s, background .15s;
}
.pw-toggle:hover { color: var(--navy); background: var(--cream-deep); }
.pw-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(194, 146, 46, .18); }
.pw-toggle svg { width: 20px; height: 20px; display: block; }

.checkline { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; }
.checkline input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--gold); }
.checkline a { color: var(--navy); }
.error {
  color: #a33a2e; background: #fbeeea; border: 1px solid #efcfc6;
  border-radius: 12px; padding: 11px 14px; margin-top: 14px;
}
.hint { font-size: .87rem; color: var(--text-soft); }

.tabs { display: flex; gap: 10px; margin: 6px 0 18px; }
.tabs button {
  flex: 1; font: inherit; font-weight: 700; padding: 11px; cursor: pointer;
  border: 1.5px solid var(--line); background: transparent; border-radius: 999px; color: var(--text-soft);
  transition: all .15s;
}
.tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Aufgaben ---------- */

.context-box {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px; margin: 14px 0;
  white-space: pre-line;
}
.audio-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 18px; flex-wrap: wrap; }
.audio-note { font-size: .85rem; color: var(--text-soft); }

.question-text { font-size: 1.08rem; }

.choices { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 6px; }
.choice {
  position: relative;
  display: flex; gap: 15px; align-items: center; border: 1.5px solid var(--line);
  border-radius: 14px; padding: 18px 20px; cursor: pointer; background: #fff;
  font-size: 1.02rem;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.choice:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-1px); }
.choice:focus-within { outline: 3px solid rgba(194, 146, 46, .4); outline-offset: 2px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-letter {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--line); color: var(--text-soft); font-weight: 800;
  transition: all .15s; flex-shrink: 0;
}
.choice.selected {
  border-color: var(--navy); background: linear-gradient(0deg, rgba(244, 232, 207, .45), rgba(244, 232, 207, .45)), #fff;
  box-shadow: var(--shadow-lift);
}
.choice.selected .choice-letter { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Ordnen ---------- */

.order-list { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.order-item {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px;
  transition: box-shadow .15s;
}
.order-item:hover { box-shadow: var(--shadow); }
.order-item .pos {
  display: flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; border-radius: 50%;
  background: var(--cream-deep); color: var(--navy); font-weight: 800; font-size: .9rem;
}
.order-item .txt { flex: 1; }
.order-item .mv { display: flex; flex-direction: column; gap: 3px; }
.order-item .mv button {
  font: inherit; line-height: 1; padding: 5px 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--cream); border-radius: 8px; color: var(--navy);
  transition: all .12s;
}
.order-item .mv button:hover:not(:disabled) { background: var(--navy); color: #fff; border-color: var(--navy); }
.order-item .mv button:disabled { opacity: .3; cursor: default; }

/* ---------- Schreiben ---------- */

textarea.writing { min-height: 230px; resize: vertical; line-height: 1.7; }
.wordcount { text-align: right; font-size: .85rem; color: var(--text-soft); margin-top: 6px; }
ul.task-bullets { margin: 10px 0 0 1.25em; padding: 0; }
ul.task-bullets li { margin: 4px 0; }

/* ---------- Ergebnis ---------- */

.score-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.score-table th, .score-table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
.score-table th { color: var(--text-soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.score-table .pass { color: var(--ok); font-weight: 700; }
.score-table .work { color: var(--gold); font-weight: 700; }
.result-label {
  background: var(--navy); color: #fff; border-radius: 14px;
  padding: 20px 22px; font-family: var(--serif); font-size: 1.3rem; font-weight: 700;
  margin: 14px 0 20px; box-shadow: var(--shadow-lift);
}
.option-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

/* ---------- Erfolgsmoment (Overlay) ---------- */

.overlay {
  position: fixed; inset: 0; background: rgba(16, 26, 48, .55);
  display: flex; align-items: center; justify-content: center; padding: 22px; z-index: 50;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay.hidden { display: none; }
.overlay-card {
  position: relative; background: var(--navy); color: #fff; border-radius: 20px;
  max-width: 440px; width: 100%; padding: 40px 30px 32px; text-align: center;
  overflow: hidden; animation: pop .4s cubic-bezier(.2, .7, .3, 1);
  box-shadow: 0 20px 60px rgba(16, 26, 48, .45);
}
.overlay-card::before {
  content: "✨"; display: block; font-size: 2rem; margin-bottom: 10px;
  position: relative; z-index: 2;
}
.overlay-card p {
  white-space: pre-line; font-size: 1.05rem; margin: 4px 0 24px;
  position: relative; z-index: 2; line-height: 1.65;
}
.overlay-card .btn { position: relative; z-index: 2; background: var(--gold); color: #fff; }
.overlay-card .btn:hover { background: var(--gold-bright); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.sparkle {
  position: absolute; top: -14px; font-size: 12px; opacity: .5; color: var(--gold-bright);
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(120vh) rotate(480deg); opacity: 0; }
}

/* ---------- Mobil ---------- */

@media (max-width: 500px) {
  main { padding: 22px 14px 56px; }
  .card { padding: 24px 18px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  .btn { width: 100%; }
  .btn-row { flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .overlay, .overlay-card { animation: none; }
  .sparkle { display: none; }
}

/* Audioplayer: Pause / Weiter / Von vorn */
.btn-small { padding: 8px 14px; font-size: .9rem; }
.audio-time { font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--navy); font-weight: 600; }
.audio-row [hidden] { display: none !important; }

/* ---------- Feierlicher Abschluss (Feuerwerk, Medaille, Pokal) ---------- */
body.no-scroll { overflow: hidden; }
.celebration {
  position: fixed; inset: 0; z-index: 80;
  background: radial-gradient(ellipse at 50% 35%, #22355c 0%, var(--navy) 45%, var(--navy-deep) 100%);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  overflow-y: auto; animation: fadeIn .35s ease;
}
.celebration.leaving { opacity: 0; transition: opacity .35s ease; }
.cel-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cel-card {
  position: relative; z-index: 2; width: 100%; max-width: 460px; text-align: center; color: #fff;
  padding: 28px 22px 26px; border-radius: 22px;
  background: rgba(16, 26, 48, .55); border: 1px solid rgba(226, 176, 74, .35);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: pop .6s cubic-bezier(.2, .7, .3, 1);
}
.cel-award { margin: 0 auto 10px; width: 150px; filter: drop-shadow(0 10px 22px rgba(226, 176, 74, .45)); }
.cel-award.is-trophy { width: 170px; }
.award-svg { display: block; width: 100%; height: auto; animation: awardIn 1s cubic-bezier(.2, .9, .3, 1.2) both, awardGlow 2.8s ease-in-out 1s infinite; }
@keyframes awardIn { from { transform: translateY(-40px) scale(.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes awardGlow { 50% { transform: translateY(-4px); } }
.cel-card h2 { font-family: var(--serif); color: #fff; font-size: clamp(1.35rem, 4.6vw, 1.75rem); line-height: 1.25; margin: 6px 0 14px; }
.cel-caption { margin: 0; color: var(--gold-soft); font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.cel-level {
  font-family: var(--serif); font-weight: 700; line-height: 1; margin: 6px 0 8px;
  font-size: clamp(3.6rem, 16vw, 5.2rem);
  background: linear-gradient(180deg, #fff6d8 0%, #f0c96b 45%, #c2922e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(240, 201, 107, .25);
}
.cel-sub { margin: 0 0 12px; font-size: 1.02rem; color: #fff; opacity: .92; }
.cel-gift { margin: 0 0 20px; font-size: .95rem; color: var(--gold-soft); }
.cel-card .btn { background: var(--gold); border-color: var(--gold); color: #fff; min-width: 220px; }
.cel-card .btn:hover, .cel-card .btn:focus-visible { background: var(--gold-bright); border-color: var(--gold-bright); }
@media (min-width: 760px) { .cel-card { padding: 36px 34px 32px; } .cel-award { width: 170px; } .cel-award.is-trophy { width: 190px; } }
@media (prefers-reduced-motion: reduce) { .award-svg, .cel-card, .celebration { animation: none; } }

/* C2-Hinweis nach bestandenem C1.2 */
.c2-card { border: 2px solid var(--gold); background: linear-gradient(180deg, #fffdf7, var(--gold-soft)); }
.c2-text { font-size: 1.08rem; font-weight: 600; color: var(--navy); margin: 0 0 16px; }

/* ---------- Hero des Teststarts (Above the fold) ---------- */

main:has(.hero) { max-width: 1040px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}
.hero-copy h1 { margin-top: 0; }
.hero-sub {
  font-size: 1.1rem; color: var(--text-soft);
  margin: 0 0 20px; max-width: 34ch;
}
.hero-points { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; }
.hero-points li {
  position: relative; padding-left: 30px;
  font-weight: 600; color: var(--navy);
}
.hero-points li::before {
  content: ""; position: absolute; left: 0; top: .34em;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9.6 17.2 4.4 12l1.5-1.5 3.7 3.7 8.5-8.5L19.6 7z'/%3E%3C/svg%3E") center/112% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9.6 17.2 4.4 12l1.5-1.5 3.7 3.7 8.5-8.5L19.6 7z'/%3E%3C/svg%3E") center/112% no-repeat;
}
.btn-hero { font-size: 1.04rem; padding: 15px 26px; box-shadow: var(--shadow-lift); }

.hero-media { min-width: 0; }
.hero-media img {
  display: block; width: 100%; height: auto;
  border-radius: 14px;
}

.intro-note { color: var(--text-soft); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 26px; }
  .hero-sub { max-width: none; }
  .hero-media { max-width: 460px; margin: 0 auto; }
}

/* ---------- Frühere Durchgänge / Test erneut machen ---------- */

.versuch-liste { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; }
.versuch-liste li {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--cream); color: var(--text);
}
.neustart-frage { margin-top: 4px; }
.neustart-frage p { margin-top: 0; }
