/* =========================================================================
   Probatix UACR-Heimtest — Plattform Mockups
   Shared design tokens + components
   ========================================================================= */

/* ----------- Reset ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--brand-text, #1A1A1A);
  background: #F5F6F8;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: var(--brand-primary, #142A4C); }

/* ----------- Default tokens (probatix fallback) ------------------------ */
:root {
  --brand-primary: #142A4C;
  --brand-primary-dark: #0B1A33;
  --brand-accent: #1FB5A3;
  --brand-surface: #FFFFFF;
  --brand-text: #1A1A1A;
  --brand-text-muted: #5A6677;
  --brand-success: #198754;
  --brand-warning: #B36B00;
  --brand-error: #B3261E;
  --brand-logo-url: url("logos/probatix-logo.svg");

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(20,42,76,.08);
  --shadow-lg: 0 12px 32px rgba(20,42,76,.12);
  --border-subtle: #E2E6EC;
}

/* ----------- Focus visible (WCAG) -------------------------------------- */
:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----------- Skip link ------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-primary);
  color: #fff;
  padding: 12px 18px;
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ----------- Typography ------------------------------------------------ */
h1, h2, h3, h4 { color: var(--brand-text); margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--brand-text-muted); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }

/* ----------- Page layout ----------------------------------------------- */
.page { min-height: 100vh; display: flex; flex-direction: column; background: #F5F6F8; }
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 720px; }
.container--wide { max-width: 1120px; }
main { flex: 1; padding: 32px 0 48px; }
.section { margin-bottom: 40px; }

/* ----------- Topbar ---------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  max-width: 1120px;
  margin: 0 auto;
  min-height: 64px;
}
.topbar__logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
}
.topbar__title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-text);
  text-align: center;
  margin: 0;
}
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.lang-switch button {
  min-width: 44px;
  min-height: 36px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  color: var(--brand-text-muted);
  font-size: .875rem;
  font-weight: 600;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--brand-primary);
  color: #fff;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: #F1F3F6;
  font-size: .875rem;
  color: var(--brand-text);
  text-decoration: none;
  min-height: 44px;
}
.user-chip__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
}
.user-chip__name { display: inline-block; }

/* ----------- Footer ---------------------------------------------------- */
.footer {
  background: #0E1A2E;
  color: #C9D2DD;
  padding: 32px 0 20px;
  margin-top: 40px;
  font-size: .875rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: 8px; }
.footer a { color: #C9D2DD; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__legal {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8rem;
  color: #8A95A4;
}

/* ----------- Buttons --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.btn--primary {
  background: var(--brand-primary);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-primary-dark); }
.btn--primary:disabled, .btn--primary[aria-disabled="true"] {
  background: #C1C8D2;
  color: #fff;
  cursor: not-allowed;
}
.btn--secondary {
  background: #fff;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn--secondary:hover { background: #F1F3F6; }
.btn--danger {
  background: var(--brand-error);
  color: #fff;
}
.btn--danger:hover { background: #8A1D17; }
.btn--ghost {
  background: transparent;
  color: var(--brand-primary);
}
.btn--ghost:hover { background: #F1F3F6; }
.btn--block { width: 100%; }
.btn--lg { font-size: 1.05rem; padding: 14px 28px; min-height: 52px; }

/* ----------- Stepper --------------------------------------------------- */
.stepper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.stepper__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  color: var(--brand-text-muted);
  text-align: center;
  font-size: .8rem;
  line-height: 1.3;
}
.stepper__item + .stepper__item::before {
  content: "";
  position: absolute;
  top: 16px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #DCE0E6;
  z-index: 0;
}
.stepper__item--done + .stepper__item::before,
.stepper__item--current + .stepper__item::before { background: var(--brand-primary); }
.stepper__circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #DCE0E6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-text-muted);
  font-weight: 700;
  font-size: .85rem;
  position: relative;
  z-index: 1;
}
.stepper__item--current .stepper__circle {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(20,42,76,.12);
}
.stepper__item--done .stepper__circle {
  background: var(--brand-success);
  border-color: var(--brand-success);
  color: #fff;
}
.stepper__item--current .stepper__label { color: var(--brand-text); font-weight: 600; }

/* ----------- Status badge --------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.4;
}
.badge--success { background: #E4F4EB; color: #126A3C; }
.badge--warning { background: #FFF1DA; color: #8A4F00; }
.badge--error   { background: #FBE4E2; color: #8A1D17; }
.badge--info    { background: #E5ECF6; color: #1B3461; }
.badge--neutral { background: #EEF0F3; color: #4A5566; }

.badge--lg {
  font-size: 1rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
}

/* ----------- Hinweisbox ----------------------------------------------- */
.hinweis {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: 16px;
  font-size: .92rem;
  line-height: 1.5;
}
.hinweis__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}
.hinweis--info { background: #EAF1FA; border-color: #C9DCF1; color: #163864; }
.hinweis--warning { background: #FFF5E1; border-color: #F2DDA6; color: #6B3B00; }
.hinweis--danger { background: #FCEAE8; border-color: #F1B7B0; color: #6E1A14; }
.hinweis--success { background: #E4F4EB; border-color: #B2DCC2; color: #0F5A33; }
.hinweis p:last-child { margin-bottom: 0; }
.hinweis strong { color: inherit; }

/* ----------- Cards ----------------------------------------------------- */
.card {
  background: var(--brand-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card--accent {
  border-left: 4px solid var(--brand-primary);
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card__title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.data-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.data-card__caption { font-size: .8rem; color: var(--brand-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.data-card__value { font-size: 1.75rem; font-weight: 700; color: var(--brand-text); line-height: 1.15; }
.data-card__subvalue { font-size: .85rem; color: var(--brand-text-muted); margin-top: 4px; }

/* ----------- Forms ----------------------------------------------------- */
.form-row { margin-bottom: 18px; }
.form-row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--brand-text); }
.req { color: var(--brand-error); margin-left: 2px; }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #C2C9D2;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--brand-text);
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-primary); }
input[aria-invalid="true"] {
  border-color: var(--brand-error);
  background: #FFF8F7;
}
.field-hint { font-size: .8rem; color: var(--brand-text-muted); margin-top: 4px; }
.field-error { font-size: .8rem; color: var(--brand-error); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.field-success { font-size: .8rem; color: var(--brand-success); margin-top: 4px; }

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #FCFCFD;
  margin-bottom: 12px;
}
.checkbox-row input[type="checkbox"] {
  width: 20px; height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}
.checkbox-row label { margin: 0; font-weight: 500; }

/* ----------- Accordion (details) -------------------------------------- */
.accordion details {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 12px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "";
  width: 12px; height: 12px;
  border-right: 2px solid var(--brand-text-muted);
  border-bottom: 2px solid var(--brand-text-muted);
  transform: rotate(45deg);
  margin-right: 4px;
  transition: transform .2s;
}
.accordion details[open] summary::after { transform: rotate(-135deg); }
.accordion details > div { padding: 0 18px 16px; color: var(--brand-text); }

/* ----------- Modal ----------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 46, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal__dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.modal__title { margin: 0 0 8px; font-size: 1.25rem; }
.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ----------- Timeline (vertical) -------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item {
  position: relative;
  padding: 0 0 20px 32px;
  color: var(--brand-text-muted);
  font-size: .92rem;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 4px;
  bottom: -4px;
  width: 2px;
  background: #DCE0E6;
}
.timeline__item:last-child::before { display: none; }
.timeline__item::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #DCE0E6;
}
.timeline__item--done { color: var(--brand-text); }
.timeline__item--done::after { background: var(--brand-success); border-color: var(--brand-success); }
.timeline__item--done::before { background: var(--brand-success); }
.timeline__item--current { color: var(--brand-text); font-weight: 600; }
.timeline__item--current::after { background: var(--brand-primary); border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(20,42,76,.15); }
.timeline__item small { display: block; font-weight: 400; color: var(--brand-text-muted); font-size: .8rem; }

/* ----------- Tab control ---------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tabs button, .tabs a {
  background: transparent;
  border: 0;
  padding: 12px 16px;
  min-height: 44px;
  font-weight: 600;
  color: var(--brand-text-muted);
  border-bottom: 3px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.tabs button[aria-selected="true"], .tabs a[aria-current="page"] {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* ----------- Landing page bits ---------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  color: #fff;
  padding: 56px 0;
}
.hero__brand-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: .85rem;
  opacity: .85;
}
.hero__brand-bar img { height: 28px; }
.hero h1 {
  color: #fff;
  font-size: 2.25rem;
  margin-bottom: 12px;
  max-width: 720px;
}
.hero p.lead {
  font-size: 1.1rem;
  max-width: 640px;
  opacity: .92;
  margin-bottom: 24px;
}
.hero .btn--primary {
  background: #fff;
  color: var(--brand-primary);
}
.hero .btn--primary:hover { background: #F1F3F6; }

.three-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step-card {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}
.step-card__num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.step-card__icon {
  width: 44px; height: 44px;
  color: var(--brand-primary);
  margin-bottom: 8px;
}
.step-card h3 { margin-bottom: 6px; }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.trust-tile {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: left;
}
.trust-tile__label {
  font-weight: 700;
  color: var(--brand-primary);
  font-size: .92rem;
  margin-bottom: 4px;
}
.trust-tile__desc { font-size: .85rem; color: var(--brand-text-muted); margin: 0; }

.sticky-cta {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border-subtle);
  padding: 14px 20px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
  z-index: 40;
}
.sticky-cta__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sticky-cta p { margin: 0; font-weight: 600; }

/* ----------- 3-Spalten Befund ----------------------------------------- */
.result-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ----------- Misc helpers --------------------------------------------- */
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.divider { height: 1px; background: var(--border-subtle); margin: 24px 0; border: 0; }
.brand-tint { background: color-mix(in srgb, var(--brand-primary) 8%, #fff); }

/* ----------- Scrollable info container (Anlage 4) --------------------- */
.scroll-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  background: #FCFCFD;
  height: 360px;
  overflow-y: auto;
  font-size: .92rem;
  line-height: 1.6;
}
.scroll-box h3 { font-size: 1rem; margin-top: 14px; }
.scroll-box h3:first-child { margin-top: 0; }

/* ----------- Big check success ---------------------------------------- */
.success-hero {
  text-align: center;
  padding: 24px 0 8px;
}
.success-hero__ring {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: #E4F4EB;
  color: var(--brand-success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.success-hero__ring svg { width: 44px; height: 44px; }

/* ----------- Step instruction list (Anleitung) ------------------------ */
.howto-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.howto-step__art {
  width: 80px; height: 80px;
  background: brand-tint;
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
}
.howto-step h3 { margin-bottom: 4px; }
.howto-step h3 .num { color: var(--brand-primary); margin-right: 8px; }

/* ----------- Responsive ----------------------------------------------- */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  .hero h1 { font-size: 1.7rem; }
  .hero { padding: 40px 0; }
  .three-steps,
  .trust-grid,
  .grid-3,
  .grid-2,
  .result-grid,
  .form-row--two,
  .footer__grid { grid-template-columns: 1fr; }
  .stepper { padding: 14px 10px; }
  .stepper__item { font-size: .7rem; }
  .topbar__title { display: none; }
  .topbar__inner { padding: 10px 14px; min-height: 60px; }
  .user-chip__name { display: none; }
  .container { padding: 0 14px; }
  main { padding: 20px 0 32px; }
  .sticky-cta__inner { flex-direction: column; align-items: stretch; }
  .sticky-cta .btn { width: 100%; }
  .modal__actions { flex-direction: column-reverse; }
  .modal__actions .btn { width: 100%; }
  .howto-step { grid-template-columns: 1fr; }
  .howto-step__art { width: 100%; height: 100px; }
  .card { padding: 18px; }
}

/* ----------- Print (PDF screenshots) ---------------------------------- */
@media print {
  .sticky-cta, .topbar { position: static; box-shadow: none; }
  body { background: #fff; }
}
