/* Final visual polish layer: shared identity, clearer hierarchy and calmer interaction. */
:root {
  --ziel-navy: #10243e;
  --ziel-blue: #256f9f;
  --ziel-teal: #168f91;
  --ziel-gold: #e1aa18;
  --ziel-gold-deep: #b97900;
  --ziel-orange: #e1aa18;
  --ziel-paper: #fdfbf7;
  --ziel-border: #dce4ea;
  --ziel-shadow-sm: 0 8px 24px rgba(16, 36, 62, 0.07);
  --ziel-shadow-lg: 0 22px 60px rgba(16, 36, 62, 0.12);
}

::selection {
  background: rgba(240, 185, 11, 0.32);
  color: var(--ziel-navy);
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(37, 111, 159, 0.3);
  outline-offset: 3px;
}

.landing-shell {
  background:
    radial-gradient(circle at 14% 18%, rgba(240, 185, 11, 0.08), transparent 24rem),
    radial-gradient(circle at 86% 8%, rgba(37, 111, 159, 0.08), transparent 27rem),
    var(--ziel-paper);
}

.landing-header {
  border-bottom-color: rgba(16, 36, 62, 0.09);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 36px rgba(16, 36, 62, 0.06);
  backdrop-filter: blur(18px) saturate(1.2);
}

.landing-header::after {
  display: none;
}

.landing-brand {
  min-width: 0;
  min-height: 54px;
  padding: 0;
  gap: 11px;
  direction: ltr;
}

.landing-logo-mark {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.landing-logo-copy {
  display: grid;
  gap: 2px;
  text-align: left;
  white-space: nowrap;
}

.landing-logo-copy strong {
  color: var(--ziel-navy);
  font-size: 25px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.055em;
}

.landing-logo-copy strong b { color: #d71920; }
.landing-logo-copy small {
  color: #486177;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing-logo-flag {
  display: grid;
  width: 14px;
  overflow: hidden;
  border-radius: 3px;
}

.landing-logo-flag i { height: 4px; background: #111; }
.landing-logo-flag i:nth-child(2) { background: #d71920; }
.landing-logo-flag i:nth-child(3) { background: #ffce00; }

.landing-page {
  width: min(1220px, calc(100% - 40px));
  padding-top: clamp(32px, 5vh, 56px);
}

.landing-hero-copy {
  width: min(1060px, 100%);
}

.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid rgba(22, 143, 145, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #075e6b;
  box-shadow: var(--ziel-shadow-sm);
  font-size: 12px;
  font-weight: 850;
}

.landing-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22a653;
  box-shadow: 0 0 0 4px rgba(34, 166, 83, 0.13);
}

.landing-hero h1 {
  margin-top: 18px;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.landing-hero p {
  text-wrap: pretty;
}

.landing-cta .primary,
.landing-cta .secondary,
.landing-cta .landing-outline-button {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.landing-cta .primary {
  border-color: color-mix(in srgb, var(--ziel-gold-deep) 55%, var(--ziel-gold));
  background: linear-gradient(135deg, #f2c84b, var(--ziel-gold));
  color: var(--ziel-navy);
  box-shadow: 0 14px 30px rgba(185, 121, 0, 0.22);
}

.landing-cta .primary:hover {
  background: linear-gradient(135deg, #f5cf5d, #d49a0c);
  color: var(--ziel-navy);
  box-shadow: 0 18px 36px rgba(185, 121, 0, 0.28);
}

.landing-cta .secondary {
  box-shadow: 0 8px 20px rgba(16, 36, 62, 0.06);
}

.landing-benefits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
}

.landing-benefits span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(16, 36, 62, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #536174;
  font-size: 12px;
  font-weight: 720;
}

.landing-benefits b {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  background: #e7f6ee;
  color: #15803d;
  font-size: 11px;
}

.landing-section-grid {
  gap: 14px;
  margin-top: 28px;
}

.landing-section-card {
  position: relative;
  min-height: 154px;
  overflow: hidden;
  border-color: rgba(16, 36, 62, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.94));
  box-shadow: var(--ziel-shadow-sm);
  isolation: isolate;
}

.landing-section-card::before {
  content: "";
  position: absolute;
  inset: auto -26px -38px auto;
  z-index: -1;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(37, 111, 159, 0.06);
  transition: transform 180ms ease, background 180ms ease;
}

.landing-section-card:hover {
  transform: translateY(-5px);
  border-color: rgba(37, 111, 159, 0.28);
  box-shadow: var(--ziel-shadow-lg);
}

.landing-section-card:hover::before {
  transform: scale(1.24);
  background: rgba(240, 185, 11, 0.1);
}

.landing-card-number {
  position: absolute;
  top: 12px;
  inset-inline-start: 13px;
  color: rgba(16, 36, 62, 0.28);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.landing-section-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(37, 111, 159, 0.12);
  border-radius: 14px;
  background: #f7fbfd;
}

.landing-section-icon svg {
  width: 34px;
  height: 34px;
}

.landing-card-arrow {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 11px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(37, 111, 159, 0.12);
  border-radius: 50%;
  background: #fff;
  color: var(--ziel-blue);
  font-weight: 900;
}

.landing-simple-note {
  margin-top: 22px;
}

/* Clearer cards and controls across the inner app. */
.dashboard-card,
.start-panel,
.results-panel,
.audio-card,
.hoeren-question,
.teil2-question-card,
.passage-card,
.prompt-box,
.writing-source {
  border-color: rgba(16, 36, 62, 0.1);
  box-shadow: var(--ziel-shadow-sm);
}

.primary,
.secondary,
.ghost,
.answer-choice,
.rf-choice,
.teil2-choice {
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.answer-choice:hover,
.rf-choice:hover,
.teil2-choice:hover {
  border-color: rgba(37, 111, 159, 0.35);
  background: color-mix(in srgb, var(--blue-soft) 64%, var(--surface));
}

.pane-head h1,
.teil3-stage-title h1,
.start-panel h1,
.results-panel h1 {
  letter-spacing: -0.02em;
}

body[data-theme="dark"] .landing-shell {
  background:
    radial-gradient(circle at 14% 18%, rgba(240, 185, 11, 0.08), transparent 24rem),
    radial-gradient(circle at 86% 8%, rgba(37, 111, 159, 0.12), transparent 27rem),
    #08111c;
}

body[data-theme="dark"] .landing-kicker,
body[data-theme="dark"] .landing-benefits span {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(16, 27, 42, 0.78);
  color: #c4d0de;
}

body[data-theme="dark"] .landing-section-card {
  border-color: rgba(255, 255, 255, 0.11);
  background: linear-gradient(145deg, #142236, #101b2a);
}

body[data-theme="dark"] .landing-section-icon,
body[data-theme="dark"] .landing-card-arrow {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
  .landing-page {
    padding-top: 22px;
  }

  .landing-logo-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .landing-logo-copy strong { font-size: 21px; }
  .landing-logo-copy small { display: none; }
  .landing-logo-flag { display: none; }

  .landing-kicker {
    justify-content: center;
    margin-inline: auto;
  }

  .landing-hero h1 {
    margin-top: 14px;
  }

  .landing-benefits {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 360px);
    margin-inline: auto;
  }

  .landing-benefits span {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
  }

  .landing-section-card {
    min-height: 124px;
    border-radius: 14px;
  }

  .landing-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .landing-section-icon svg {
    width: 29px;
    height: 29px;
  }

  .landing-card-arrow {
    display: none;
  }
}

@media (max-width: 420px) {
  .landing-kicker {
    min-height: 31px;
    font-size: 11px;
  }

  .landing-benefits {
    gap: 7px;
    margin-top: 15px;
  }

  .landing-benefits span {
    min-height: 32px;
    padding-block: 6px;
    font-size: 11px;
  }

  .landing-section-grid {
    margin-top: 18px;
  }
}

/* Internal exam workspace: desktop reading comfort and consistent visual hierarchy. */
.app-shell.training-focus-shell,
.app-shell.training-focus-shell.menu-open {
  padding-top: 0;
}

.practice-focus-bar {
  position: relative;
  z-index: 40;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 10px 28px rgba(16, 36, 62, 0.055);
  backdrop-filter: blur(16px);
}

.practice-focus-bar .practice-menu-toggle {
  position: static;
  width: auto;
  min-width: 112px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--blue) 25%, var(--line));
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(16, 36, 62, 0.07);
  font-weight: 850;
}

.practice-focus-brand {
  display: grid;
  justify-items: end;
  gap: 1px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: right;
}

.practice-focus-brand strong { font-size: 17px; letter-spacing: 0.04em; }
.practice-focus-brand strong b { color: var(--red); }
.practice-focus-brand small { color: var(--muted); font-size: 10px; letter-spacing: 0.06em; }

.training-focus-shell .exam-main {
  height: calc(100dvh - 70px);
  background: radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--yellow) 7%, transparent), transparent 30%), var(--bg);
}

/* Exam material is German even when the surrounding interface is Arabic. */
.training-focus-shell .exam-main,
.training-focus-shell .exam-workspace,
.training-focus-shell .hoeren-layout,
.training-focus-shell .text-pane,
.training-focus-shell .answer-pane,
.training-focus-shell .task-copy,
.training-focus-shell .passage-card,
.training-focus-shell .teil2-question-card,
.training-focus-shell .hoeren-panel,
.training-focus-shell .hoeren-question {
  direction: ltr;
  text-align: left;
}

.training-focus-shell .text-pane {
  background: color-mix(in srgb, var(--surface) 96%, var(--bg));
  border-right-color: color-mix(in srgb, var(--line) 72%, transparent);
}

.training-focus-shell .answer-pane { background: color-mix(in srgb, var(--blue-soft) 24%, var(--bg)); }

.training-focus-shell .pane-head {
  padding-bottom: 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.training-focus-shell .pane-head .eyebrow { color: var(--blue); letter-spacing: 0.12em; }
.training-focus-shell .pane-head h1 { margin-top: 7px; letter-spacing: -0.025em; }

.training-focus-shell .passage-card,
.training-focus-shell .teil2-question-card,
.training-focus-shell .hoeren-question,
.training-focus-shell .audio-card,
.training-focus-shell .prompt-box,
.training-focus-shell .hoeren-answer-block {
  border-color: color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 8px 24px rgba(16, 36, 62, 0.045);
}

.training-focus-shell .teil2-choice,
.training-focus-shell .rf-choice {
  border-radius: 9px;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.training-focus-shell .teil2-choice:hover,
.training-focus-shell .rf-choice:hover { background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }

.training-focus-shell .teil2-choice.selected,
.training-focus-shell .rf-choice.selected { background: color-mix(in srgb, var(--blue) 11%, var(--surface)); }

@media (min-width: 721px) {
  .telegram-floating-link {
    left: 18px;
    width: 46px;
    padding: 10px;
    border-radius: 50%;
    transform: none;
  }

  .telegram-floating-link:hover { transform: translateY(-2px); }

  .telegram-floating-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .practice-focus-bar { min-height: 58px; padding: 7px 10px; }
  .practice-focus-bar .practice-menu-toggle { min-width: 44px; min-height: 42px; padding: 8px 10px; }
  .practice-focus-bar .practice-menu-toggle > span:last-child,
  .practice-focus-brand small { display: none; }
  .practice-focus-brand strong { font-size: 15px; }
  .training-focus-shell .exam-main { height: calc(100dvh - 58px); }
}

/* Premium finish: restrained motion, depth and long-session comfort. */
html {
  scrollbar-color: color-mix(in srgb, var(--blue) 42%, var(--line)) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 38%, var(--line));
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--blue) 62%, var(--line)); }

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:active:not(:disabled),
[role="button"]:active {
  transform: translateY(1px);
}

.dashboard-page {
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  box-shadow: 0 28px 70px rgba(16, 36, 62, 0.08);
}

.dashboard-page .welcome-panel {
  overflow: hidden;
  box-shadow: 0 16px 38px rgba(16, 36, 62, 0.075);
}

.dashboard-card {
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(16, 36, 62, 0.075);
}

.dashboard-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(16, 36, 62, 0.14);
}

.dashboard-cover::after {
  background: linear-gradient(180deg, transparent 52%, rgba(16, 35, 58, 0.18));
}

.dashboard-card-progress .progress-track {
  height: 6px;
  background: color-mix(in srgb, var(--line) 72%, var(--surface));
}

.dashboard-card-progress .progress-fill {
  background: linear-gradient(90deg, var(--green), color-mix(in srgb, var(--green) 62%, var(--blue)));
}

.training-focus-shell .task-copy,
.training-focus-shell .passage-body p,
.training-focus-shell .article-copy {
  text-wrap: pretty;
}

.training-focus-shell .article-copy {
  line-height: 1.68;
}

.training-focus-shell .exam-footer {
  box-shadow: 0 -12px 36px rgba(16, 36, 62, 0.09);
}

body[data-theme="dark"] .dashboard-page {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #111d2b, #0e1723);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
