/* Kunden-Fragebogen — gestylt im MakeMyKI Designsystem.
   Tokens übernommen aus: MakeMyKI Design System (tokens/colors|typography|spacing|effects). */

:root {
  /* ---- Farben: Espresso → Cream, Terracotta-Akzent ---- */
  --espresso-900: #221C17;
  --espresso-800: #2D2620;
  --espresso-700: #3A2D23;
  --espresso-600: #5C5246;
  --espresso-500: #6F6258;
  --taupe-400:    #8B7E70;
  --taupe-300:    #B9AC9B;
  --sand-200:     #E2DACE;
  --cream-100:    #F6F1E8;
  --cream-50:     #FBF8F2;
  --paper-0:      #FFFFFF;

  --terracotta-700: #9B6E43;
  --terracotta-600: #A87A4E;
  --terracotta-500: #B8895B;
  --terracotta-300: #D9C0A6;
  --terracotta-100: #F1E6D9;

  --green-700: #0B7E48;
  --green-600: #0FA05B;
  --green-100: #EAF6EF;

  --red-700: #9E0000;
  --red-600: #C00000;
  --red-100: #FBEAEA;

  /* ---- Semantik ---- */
  --bg-canvas:      var(--cream-100);
  --bg-surface:     var(--paper-0);
  --bg-surface-sunk: var(--cream-50);
  --bg-accent-soft: var(--terracotta-100);
  --text-primary:   var(--espresso-800);
  --text-secondary: var(--espresso-600);
  --text-muted:     var(--espresso-500);
  --text-faint:     var(--taupe-400);
  --text-accent:    var(--terracotta-700);
  --accent:         var(--terracotta-500);
  --accent-hover:   var(--terracotta-600);
  --accent-active:  var(--terracotta-700);
  --border-subtle:  var(--sand-200);
  --border-strong:  var(--taupe-300);
  --border-accent:  var(--terracotta-300);
  --focus-ring:     var(--terracotta-500);

  /* ---- Typografie ---- */
  --font-sans: 'Hanken Grotesk', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;
  --fs-body-lg: 1.125rem;
  --fs-body: 1rem;
  --fs-body-sm: 0.875rem;
  --fs-caption: 0.8125rem;
  --fs-label: 0.75rem;
  --ls-tight: -0.02em;
  --ls-wide: 0.04em;
  --ls-wider: 0.14em;

  /* ---- Radien, Schatten, Motion ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 3px rgba(45, 38, 32, 0.08), 0 1px 2px rgba(45, 38, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(45, 38, 32, 0.08), 0 2px 4px rgba(45, 38, 32, 0.04);
  --shadow-focus: 0 0 0 3px rgba(184, 137, 91, 0.35);
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 120ms;
  --dur-normal: 200ms;

  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--terracotta-300);
  color: var(--espresso-900);
}

html {
  min-height: 100%;
  background: var(--bg-canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Der App-Container wird nach jedem Screenwechsel programmatisch fokussiert —
   dort keinen Fokusring zeichnen. */
.app-shell:focus-visible {
  outline: none;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  color: var(--cream-50);
  background: var(--espresso-700);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 110px;
  padding: 1.75rem 1rem 1.25rem;
}

.logo {
  display: block;
  width: min(190px, 48vw);
  height: auto;
  object-fit: contain;
}

.header-logout {
  position: absolute;
  top: 1.35rem;
  right: max(1rem, calc((100vw - 740px) / 2));
  min-height: 48px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.65rem 1rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  transition: border-color var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast);
}

.header-logout:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--cream-50);
}

.app-shell {
  width: min(100% - 1.5rem, 740px);
  margin: 0 auto;
  flex: 1;
}

.card {
  padding: clamp(1.4rem, 4vw, 3rem);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}

.screen {
  animation: screen-in var(--dur-normal) var(--ease-standard) both;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--text-accent);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2 {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.18;
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-tight);
}

h1 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
}

h2 {
  font-size: clamp(1.4rem, 5vw, 1.875rem);
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--fw-bold);
}

.lead {
  margin: 1.25rem 0 0;
  color: var(--text-secondary);
  font-size: var(--fs-body-lg);
  line-height: 1.65;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.actions.split {
  justify-content: space-between;
}

.button {
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.78rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  line-height: 1.2;
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-primary:active:not(:disabled) {
  background: var(--accent-active);
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
}

.button-secondary:hover {
  background: var(--bg-accent-soft);
  border-color: var(--border-accent);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.service-grid,
.choice-list,
.yes-no {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.choice-hint {
  margin: 1.25rem 0 0;
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

.choice-hint + .choice-list {
  margin-top: 0.75rem;
}

.service-card,
.choice-card {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-sunk);
  cursor: pointer;
  line-height: 1.4;
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.service-card:hover,
.choice-card:hover {
  border-color: var(--border-strong);
}

.service-card:has(input:checked),
.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: var(--fw-semibold);
}

.service-card input,
.choice-card input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--terracotta-700);
}

.field {
  margin-top: 1.6rem;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 0.55rem;
  font-weight: var(--fw-semibold);
  line-height: 1.4;
}

.hint {
  display: block;
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: var(--fs-caption);
}

textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--bg-surface);
  resize: vertical;
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}

textarea::placeholder,
input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-faint);
}

textarea:hover,
input[type="text"]:hover,
input[type="password"]:hover {
  border-color: var(--border-strong);
}

textarea:focus-visible,
input[type="text"]:focus-visible,
input[type="password"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

textarea {
  min-height: 125px;
  line-height: 1.5;
}

.other-input {
  margin-top: 0.75rem;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.progress-row .eyebrow {
  margin: 0;
}

.progress-label {
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  text-align: right;
}

.progress-track {
  height: 5px;
  margin-bottom: 1.65rem;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--sand-200);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--dur-normal) var(--ease-standard);
}

.back-link,
.edit-link {
  min-height: 48px;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  color: var(--text-accent);
  background: transparent;
  cursor: pointer;
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

.back-link:hover,
.edit-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.yes-no {
  grid-template-columns: 1fr 1fr;
}

.yes-no .choice-card {
  justify-content: center;
  min-height: 70px;
  font-size: 1.05rem;
  font-weight: var(--fw-bold);
}

.yes-no input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.error-message,
.error-panel {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(192, 0, 0, 0.25);
  border-radius: var(--radius-md);
  color: var(--red-700);
  background: var(--red-100);
  line-height: 1.5;
}

.summary-intro {
  margin: 0.75rem 0 1.5rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.summary-group + .summary-group {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
}

.summary-list {
  margin: 0.8rem 0 0;
}

.summary-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.summary-question {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
  line-height: 1.4;
}

.summary-answer {
  margin: 0.25rem 0 0;
  font-weight: var(--fw-semibold);
  line-height: 1.45;
}

.auth-card {
  max-width: 620px;
  margin-inline: auto;
}

.service-recap {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-sunk);
}

.service-recap-title {
  margin: 0;
  color: var(--text-primary);
  font-weight: var(--fw-bold);
}

.service-recap dl {
  margin: 0.7rem 0 0;
}

.service-recap-item {
  padding: 0.65rem 0;
  border-top: 1px solid var(--border-subtle);
}

.service-recap-item dt {
  color: var(--text-muted);
  font-size: var(--fs-caption);
  line-height: 1.4;
}

.service-recap-item dd {
  margin: 0.2rem 0 0;
  color: var(--text-primary);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.45;
}

.edit-link {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: auto;
  align-self: start;
  font-size: var(--fs-body-sm);
}

.success-mark {
  width: 62px;
  height: 62px;
  margin-bottom: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  color: #fff;
  background: var(--green-600);
  font-size: 1.8rem;
  font-weight: var(--fw-black);
}

.site-footer {
  min-height: 90px;
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: var(--fs-caption);
  text-align: center;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 620px) {
  .service-grid {
    grid-template-columns: 1fr 1fr;
  }

  .choice-list.compact {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .site-header:has(.header-logout:not([hidden])) {
    justify-content: flex-start;
  }

  .header-logout {
    top: 1.2rem;
    right: 0.75rem;
  }

  .actions,
  .actions.split {
    flex-direction: column-reverse;
  }

  .actions .button {
    width: 100%;
  }

  .actions .button-primary:only-child {
    order: -1;
  }

  .summary-item {
    grid-template-columns: 1fr;
  }

  .edit-link {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    padding-top: 0.35rem;
  }
}

@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;
  }
}
