/* Deutsch1 Einstufungstest – mobile-first, kein Framework */
:root {
  --petrol: #0f5257;
  --petrol-dark: #0a3a3e;
  --petrol-light: #e5f0f0;
  --accent: #f2a03d;
  --ink: #1c2526;
  --grey: #5f6b6c;
  --bg: #f7fafa;
  --card: #ffffff;
  --ok: #2e8b57;
  --err: #c0392b;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100dvh; display: flex; flex-direction: column;
  line-height: 1.5;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: var(--card); border-bottom: 1px solid #e3eaea;
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--petrol); letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.lang-select {
  border: 1.5px solid var(--petrol); background: #fff; color: var(--petrol);
  border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: .8rem; cursor: pointer;
  font-family: inherit; appearance: none; -webkit-appearance: none;
}

/* RTL (Arabisch): UI spiegelt, deutsche Inhalte bleiben per Inline-dir LTR */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .progress-label { flex-direction: row-reverse; }
html[dir="rtl"] .consent { text-align: right; }

.app { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }

.progress-wrap { margin-bottom: 18px; }
.progress-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--grey); margin-bottom: 5px; font-weight: 600; }
.progress-bar { height: 8px; background: #dfe9e9; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--petrol), #1b7f86); border-radius: 999px; transition: width .35s ease; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: 0 2px 14px rgba(15, 82, 87, .07);
}
.kicker { color: var(--accent); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
h1 { font-size: 1.5rem; line-height: 1.25; margin-bottom: 12px; color: var(--petrol-dark); }
h2 { font-size: 1.18rem; line-height: 1.35; margin-bottom: 14px; color: var(--petrol-dark); }
.sub { color: var(--grey); margin-bottom: 18px; font-size: .95rem; }
.meta-row { display: flex; gap: 14px; margin: 16px 0 20px; flex-wrap: wrap; }
.meta-chip { background: var(--petrol-light); color: var(--petrol-dark); border-radius: 999px; padding: 6px 13px; font-size: .82rem; font-weight: 700; }

.instr { font-size: .85rem; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.qtext { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; }
.hint { color: var(--grey); font-size: .88rem; margin-bottom: 8px; }
.reading { background: var(--petrol-light); border-radius: 10px; padding: 14px; font-size: .93rem; margin: 10px 0 14px; max-height: 250px; overflow-y: auto; }

.qimg { width: 100%; max-width: 340px; border-radius: 12px; display: block; margin: 6px auto 14px; }

.audio-box { display: flex; align-items: center; gap: 12px; background: var(--petrol-light); border-radius: 12px; padding: 12px 14px; margin: 8px 0 14px; }
.audio-play {
  width: 46px; height: 46px; min-width: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--petrol); color: #fff; font-size: 1.15rem; display: flex; align-items: center; justify-content: center;
}
.audio-track { flex: 1; height: 6px; background: #c8dcdc; border-radius: 999px; overflow: hidden; }
.audio-track-fill { height: 100%; width: 0; background: var(--petrol); }
.audio-label { font-size: .8rem; color: var(--petrol-dark); font-weight: 700; }

.opts { display: grid; gap: 10px; margin-top: 14px; }
.opt {
  text-align: left; border: 2px solid #dfe9e9; background: #fff; border-radius: 12px;
  padding: 13px 15px; font-size: 1rem; cursor: pointer; transition: border-color .12s, background .12s;
  color: var(--ink); font-family: inherit;
}
.opt:active { background: var(--petrol-light); }
.opt.sel { border-color: var(--petrol); background: var(--petrol-light); font-weight: 700; }

.gap-input {
  width: 100%; border: 2px solid #dfe9e9; border-radius: 12px; padding: 13px 15px;
  font-size: 1.05rem; font-family: inherit; margin-top: 12px; background: #fff;
}
.gap-input:focus { outline: none; border-color: var(--petrol); }

.btn {
  display: block; width: 100%; border: none; cursor: pointer; text-align: center; text-decoration: none;
  background: var(--petrol); color: #fff; font-weight: 800; font-size: 1.05rem; font-family: inherit;
  padding: 15px 18px; border-radius: 12px; margin-top: 20px; transition: background .15s;
}
.btn:hover { background: var(--petrol-dark); }
.btn:disabled { background: #b7c8c9; cursor: not-allowed; }
.btn.ghost { background: none; color: var(--petrol); border: 2px solid var(--petrol); }
.btn.accent { background: var(--accent); color: #3a2506; }

.email-field {
  width: 100%; border: 2px solid #dfe9e9; border-radius: 12px; padding: 14px 15px;
  font-size: 1.05rem; font-family: inherit; margin-top: 14px;
}
.email-field:focus { outline: none; border-color: var(--petrol); }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: .85rem; color: var(--grey); }
.consent input { margin-top: 3px; width: 18px; height: 18px; min-width: 18px; accent-color: var(--petrol); }
.consent a { color: var(--petrol); }

.level-teaser {
  text-align: center; background: linear-gradient(135deg, var(--petrol), #17727a);
  color: #fff; border-radius: var(--radius); padding: 26px 20px; margin-bottom: 18px;
}
.level-teaser .small { opacity: .85; font-size: .9rem; font-weight: 600; }
.level-teaser .big { font-size: 2rem; font-weight: 800; margin: 6px 0; }
.err-msg { color: var(--err); font-size: .88rem; margin-top: 10px; display: none; }
.err-msg.show { display: block; }

.reco { border: 2px solid var(--petrol-light); border-radius: 12px; padding: 16px; margin-top: 14px; }
.reco .tag { font-size: .75rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.reco h3 { color: var(--petrol-dark); margin: 4px 0 6px; font-size: 1.05rem; }
.reco p { font-size: .9rem; color: var(--grey); }

.foot { display: flex; gap: 18px; justify-content: center; padding: 18px; font-size: .8rem; }
.foot a { color: var(--grey); text-decoration: none; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 640px) {
  .app { padding-top: 36px; }
  .card { padding: 32px 30px; }
  h1 { font-size: 1.8rem; }
}
