/* ============================================================
   CSS Custom Properties – TLM Corporate Design
   ============================================================ */
:root {
  --tlm-red:      #E3002D;
  --tlm-red-dark: #C5001F;
  --tlm-blue:     #00427D;
  --tlm-bg:       #FAFAFA;
  --tlm-surface:  #FFFFFF;
  --tlm-text:     #242526;
  --tlm-border:   #E5E7EB;
  --tlm-muted:    #5B6477;

  --shadow-card: 0 2px 12px rgba(0, 66, 125, 0.08);
  --shadow-lift: 0 6px 24px rgba(0, 66, 125, 0.14);
  --shadow-btn:  0 4px 14px rgba(227, 0, 45, 0.32);

  --radius-card:  14px;
  --radius-input: 8px;
  --radius-btn:   8px;

  --transition-fast: 150ms ease;
  --transition-med:  200ms ease;

  --font: 'Montserrat', sans-serif;
  --container: 780px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--tlm-text);
  background: var(--tlm-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

[hidden] {
  display: none !important;
}

/* ============================================================
   Layout Helpers
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ============================================================
   Screen Switching
   ============================================================ */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
}

/* ============================================================
   Header & Logo
   ============================================================ */
.header {
  background: var(--tlm-surface);
  border-bottom: 1px solid var(--tlm-border);
  padding-block: 14px;
  z-index: 100;
}

.header--sticky {
  position: sticky;
  top: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-wrap {
  flex-shrink: 0;
  line-height: 1;
}

.logo {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-fallback {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
}

.logo-tl { color: var(--tlm-blue); }
.logo-m  { color: var(--tlm-red);  }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--tlm-border);
  border-radius: 2px;
  overflow: hidden;
  min-width: 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--tlm-red);
  border-radius: 2px;
  transition: width 300ms ease;
}

.progress-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tlm-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
  min-width: 38px;
  text-align: right;
}

/* ============================================================
   Screen 1 — Landing
   ============================================================ */
.landing-main {
  flex: 1;
  padding-block: 52px 72px;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 44px;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tlm-red);
  margin-bottom: 16px;
}

.hero-headline {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 700;
  color: var(--tlm-blue);
  line-height: 1.18;
  margin-bottom: 20px;
  text-wrap: pretty;
}

.hero-sub {
  font-size: 15px;
  color: var(--tlm-muted);
  line-height: 1.7;
  max-width: 520px;
  margin-inline: auto;
  text-wrap: pretty;
}

/* Form Card */
.form-card {
  background: var(--tlm-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--tlm-border);
  box-shadow: var(--shadow-card);
  padding: 36px 32px 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--tlm-text);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--tlm-border);
  border-radius: var(--radius-input);
  font-family: var(--font);
  font-size: 15px;
  color: var(--tlm-text);
  background: var(--tlm-bg);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-input::placeholder {
  color: #B0B7C3;
  font-weight: 400;
}

.form-input:focus-visible {
  border-color: var(--tlm-blue);
  box-shadow: 0 0 0 3px rgba(0, 66, 125, 0.12);
}

.form-input.invalid {
  border-color: var(--tlm-red);
  box-shadow: 0 0 0 3px rgba(227, 0, 45, 0.1);
}

.dsgvo-micro {
  font-size: 12px;
  color: var(--tlm-muted);
  line-height: 1.6;
  margin-bottom: 26px;
  text-wrap: pretty;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  background: var(--tlm-red);
  color: #ffffff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  letter-spacing: 0.015em;
  text-decoration: none;
  user-select: none;
}

.btn-primary:hover {
  background: var(--tlm-red-dark);
  box-shadow: var(--shadow-btn);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-primary:focus-visible {
  outline: 3px solid var(--tlm-red);
  outline-offset: 3px;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-full {
  width: 100%;
}

/* ============================================================
   Error Box
   ============================================================ */
.error-box {
  background: #FFF5F7;
  border: 1.5px solid var(--tlm-red);
  border-radius: var(--radius-input);
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tlm-red);
  line-height: 1.55;
  margin-bottom: 16px;
}

/* ============================================================
   Screen 2 — Fragen
   ============================================================ */
.questions-main {
  flex: 1;
  padding-block: 30px 80px;
}

.intro-line {
  font-size: 13px;
  color: var(--tlm-muted);
  font-style: italic;
  text-align: center;
  margin-bottom: 28px;
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

/* Question Card */
.question-card {
  background: var(--tlm-surface);
  border: 1.5px solid var(--tlm-border);
  border-radius: var(--radius-card);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-med);
}

.question-card.invalid {
  border-color: var(--tlm-red);
  box-shadow: 0 0 0 3px rgba(227, 0, 45, 0.07), var(--shadow-card);
}

.question-index {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tlm-blue);
  margin-bottom: 7px;
}

.question-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--tlm-text);
  margin-bottom: 18px;
  text-wrap: pretty;
}

/* Likert Scale */
.likert-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

/* Visually hidden but accessible */
.likert-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.likert-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 8px 4px;
  background: var(--tlm-bg);
  border: 1.5px solid var(--tlm-border);
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast),
    color var(--transition-fast);
}

.likert-label:hover {
  border-color: var(--tlm-blue);
  background: rgba(0, 66, 125, 0.04);
}

.likert-input:focus-visible + .likert-label {
  outline: 3px solid var(--tlm-blue);
  outline-offset: 2px;
}

.likert-input:checked + .likert-label {
  background: var(--tlm-red);
  border-color: var(--tlm-red);
  box-shadow: 0 3px 10px rgba(227, 0, 45, 0.28);
  color: #ffffff;
}

.likert-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--tlm-blue);
  transition: color var(--transition-fast);
}

.likert-input:checked + .likert-label .likert-value {
  color: #ffffff;
}

.likert-label-text {
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--tlm-muted);
  transition: color var(--transition-fast);
}

.likert-input:checked + .likert-label .likert-label-text {
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   Screen 3 — Ergebnis
   ============================================================ */
.result-main {
  flex: 1;
  padding-block: 44px 72px;
}

.result-card {
  background: var(--tlm-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--tlm-border);
  box-shadow: var(--shadow-card);
  padding: 52px 44px 48px;
  text-align: center;
  margin-bottom: 28px;
  animation: resultReveal 280ms ease both;
}

@keyframes resultReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tlm-red);
  margin-bottom: 30px;
}

.result-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-icon svg {
  width: 100%;
  height: 100%;
}

.result-name {
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 700;
  color: var(--tlm-blue);
  line-height: 1.15;
  margin-bottom: 14px;
}

.result-characteristic {
  font-size: 15px;
  font-style: italic;
  color: var(--tlm-muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

.result-description {
  font-size: 15px;
  line-height: 1.75;
  color: var(--tlm-text);
  max-width: 540px;
  margin-inline: auto;
  text-wrap: pretty;
}

.result-footer {
  font-size: 12px;
  color: var(--tlm-muted);
  text-align: center;
  line-height: 1.6;
}

/* ============================================================
   Loading Spinner
   ============================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 0;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--tlm-border);
  border-top-color: var(--tlm-red);
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-label {
  font-size: 13px;
  font-style: italic;
  color: var(--tlm-muted);
}

/* ============================================================
   Responsive — Mobile-first adjustments
   ============================================================ */
@media (max-width: 480px) {
  .form-card {
    padding: 24px 18px 22px;
  }

  .result-card {
    padding: 36px 20px 32px;
  }

  .landing-main {
    padding-block: 36px 56px;
  }

  .hero {
    margin-bottom: 32px;
  }

  .likert-group {
    gap: 5px;
  }

  .likert-label {
    min-height: 52px;
    padding: 6px 2px;
    border-radius: 7px;
  }

  .likert-value {
    font-size: 16px;
  }

  .likert-label-text {
    font-size: 8.5px;
  }

  .question-card {
    padding: 18px 16px 16px;
  }
}

@media (min-width: 640px) {
  .question-card {
    padding: 26px 28px 24px;
  }

  .likert-label {
    min-height: 64px;
  }

  .likert-value {
    font-size: 20px;
  }

  .likert-label-text {
    font-size: 10px;
  }
}
