/* ============================================================
   Readiness-Check — UI
   Halo-Hintergrund, weisse Karten, Depth-Text. Headings 400,
   Body 300, 600 nur inline. Nur transform/opacity animieren.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
[hidden] { display: none !important; }

body.rc {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Sanfter Ease-Schimmer auf Start- und Ergebnisseite */
body.rc::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 45% at 85% -5%, color-mix(in srgb, var(--color-ease) 55%, transparent) 0%, transparent 70%),
    radial-gradient(45% 35% at -10% 100%, color-mix(in srgb, var(--color-ease) 30%, transparent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .8s ease;
}
body.rc[data-screen="start"]::before,
body.rc[data-screen="result"]::before { opacity: 1; }

.rc-header, .rc-stage, .rc-footer { position: relative; z-index: 1; }

a { color: var(--fg); }
strong, b { font-weight: 600; }
button { font-family: inherit; }
::selection { background: var(--color-mist); color: var(--color-depth); }

.rc-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.rc-skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--color-depth); color: var(--color-bloom); text-decoration: none;
}
.rc-skip:focus { top: 12px; }

/* ── Header + Fortschritt ─────────────────────────────────── */
.rc-header {
  position: sticky; top: 0; z-index: 10;
  background: transparent;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color .25s ease;
}
/* Erst beim Scrollen bekommt der Header einen Hintergrund – so läuft der
   Verlauf oben durch und es entsteht keine Kante unter dem Logo. */
.rc-header.is-scrolled { background: color-mix(in srgb, var(--color-halo) 86%, transparent); }
.rc-header__row {
  max-width: calc(var(--w-wide) + 2 * var(--gutter)); margin: 0 auto;
  padding: 14px var(--gutter) 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px;
}
.rc-logo { display: inline-flex; align-items: center; }
.rc-logo img { display: block; height: 20px; width: auto; }

.rc-progress {
  display: flex; align-items: baseline; gap: 10px;
  font-size: .8125rem; color: var(--fg-secondary); white-space: nowrap;
}
.rc-progress__caption { font-weight: 400; color: var(--fg); }
.rc-progress__counter { font-variant-numeric: tabular-nums; }
.rc-progress__track {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  max-width: calc(var(--w-wide) + 2 * var(--gutter)); margin: 0 auto;
  padding: 0 var(--gutter) 12px;
}
.rc-progress__seg {
  position: relative; height: 4px; border-radius: 2px; overflow: hidden;
  background: var(--color-veil);
  transition: background-color .3s;
}
.rc-progress__seg.is-active { background: var(--color-sage); }
.rc-progress__seg i {
  position: absolute; inset: 0; display: block;
  background: var(--color-depth);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform .5s var(--ease-out);
}

/* ── Bühne ───────────────────────────────────────────────── */
.rc-stage { flex: 1; display: flex; flex-direction: column; outline: none; }
.rc-screen {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px var(--gutter) 56px;
}
.rc-screen__inner { width: 100%; max-width: var(--w-narrow); }
.rc-screen__inner--wide { max-width: var(--w-wide); }
.rc-screen--start .rc-screen__inner { max-width: var(--w-wide); }
@media (max-width: 640px) {
  .rc-screen { align-items: flex-start; padding-top: 20px; padding-bottom: 40px; }
}

/* ── Typografie ──────────────────────────────────────────── */
.rc-eyebrow {
  margin: 0 0 14px; font-size: .8125rem; font-weight: 400;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fg-secondary);
}
.rc-title {
  margin: 0 0 16px; font-weight: 400; letter-spacing: -.02em; line-height: 1.1;
  font-size: clamp(2rem, 4.6vw, 2.75rem); text-wrap: balance;
}
.rc-title:focus { outline: none; }
.rc-title--hero { font-size: clamp(2.25rem, 6.2vw, 3.625rem); }
.rc-lead {
  margin: 0 0 24px; max-width: 36rem;
  font-size: clamp(1.0625rem, 1.9vw, 1.25rem); color: var(--fg-secondary); text-wrap: pretty;
}
.rc-question {
  margin: 0 0 22px; font-weight: 400; letter-spacing: -.012em; line-height: 1.25;
  font-size: clamp(1.375rem, 3.2vw, 1.875rem); text-wrap: balance;
}
.rc-question:focus { outline: none; }
.rc-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 28px; }
.rc-facts li {
  padding: 6px 14px; border-radius: 999px;
  background: var(--bg-surface); border: 1px solid var(--border); font-size: .875rem;
}
.rc-hint { margin: 22px 0 0; font-size: .9375rem; color: var(--fg-secondary); }
.rc-note { font-size: .875rem; color: var(--fg-tertiary); }
.rc-cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }

/* ── Buttons ─────────────────────────────────────────────── */
.rc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font: inherit; font-weight: 400; font-size: .875rem; letter-spacing: .08em; text-transform: uppercase;
  line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s;
}
.rc-btn:focus-visible { outline: 2px solid var(--color-depth); outline-offset: 3px; }
.rc-btn--primary { background: var(--color-depth); color: var(--color-bloom); }
.rc-btn--primary:hover { background: var(--color-shade); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.rc-btn--primary:active { background: var(--color-depth-active); transform: translateY(0); box-shadow: none; }
.rc-btn--secondary { background: var(--bg-surface); color: var(--color-depth); border-color: var(--color-depth); }
.rc-btn--secondary:hover { background: var(--color-mist); }
.rc-btn--ghost {
  min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm);
  text-transform: none; letter-spacing: 0; font-size: .9375rem; color: var(--fg-secondary); background: transparent;
}
.rc-btn--ghost:hover { color: var(--color-depth); background: color-mix(in srgb, var(--color-mist) 60%, transparent); }
.rc-btn[disabled] { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.rc-btn.is-busy { position: relative; color: transparent; }
.rc-btn.is-busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--color-bloom) 35%, transparent); border-top-color: var(--color-bloom);
  animation: rc-spin .8s linear infinite;
}
.rc-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ── Antwortkarten ───────────────────────────────────────── */
.rc-options { display: grid; gap: 10px; margin: 0 0 22px; }
.rc-option {
  display: grid; grid-template-columns: 30px 1fr 24px; align-items: center; gap: 14px;
  width: 100%; min-height: 60px; padding: 14px 16px; text-align: left;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
  font: inherit; font-size: 1.0625rem; line-height: 1.4; color: var(--fg); cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, background-color .15s, transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .rc-option:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
}
.rc-option:active { transform: scale(.995); }
.rc-option:focus-visible { outline: 2px solid var(--color-depth); outline-offset: 2px; }
.rc-option[aria-checked="true"] {
  border-color: var(--color-depth); background: var(--color-mist);
  box-shadow: inset 0 0 0 1px var(--color-depth);
}
.rc-option.is-selected { animation: rc-pop .38s var(--ease-spring); }
.rc-option__key {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--color-halo); border: 1px solid var(--border);
  font-size: .8125rem; font-weight: 400; color: var(--fg-secondary);
  transition: background-color .15s, color .15s, border-color .15s;
}
.rc-option[aria-checked="true"] .rc-option__key { background: var(--color-depth); color: var(--color-bloom); border-color: var(--color-depth); }
.rc-option__check {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-depth); color: var(--color-bloom);
  transform: scale(0); opacity: 0;
  transition: transform .28s var(--ease-spring), opacity .12s;
}
.rc-option[aria-checked="true"] .rc-option__check { transform: scale(1); opacity: 1; }

/* ── Navigation unter den Fragen ─────────────────────────── */
.rc-nav { display: flex; align-items: center; gap: 6px; }
.rc-keyhint { margin-left: auto; font-size: .8125rem; color: var(--fg-tertiary); }
@media (hover: none), (max-width: 640px) { .rc-keyhint { display: none; } }

/* ── Bereichskopf über der Frage ─────────────────────────── */
.rc-area-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 18px; font-size: .9375rem; color: var(--fg-secondary);
}
.rc-area-head__mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--area-light, var(--color-mist)); color: var(--area-text, var(--color-depth));
  font-size: .875rem; font-weight: 400;
}
.rc-area-head__mark--dot { width: 10px; height: 10px; border-radius: 50%; margin: 0 10px; background: var(--color-sage); }
.rc-area-head__title { font-weight: 400; color: var(--fg); }
.rc-area-head__count { margin-left: auto; font-variant-numeric: tabular-nums; font-size: .875rem; }
@media (max-width: 480px) { .rc-area-head__count { margin-left: 0; flex-basis: 100%; padding-left: 40px; margin-top: -4px; } }

/* ── Auswerten ───────────────────────────────────────────── */
.rc-calc { text-align: center; }
.rc-calc__bars { display: flex; justify-content: center; align-items: flex-end; gap: 8px; height: 44px; margin-bottom: 18px; }
.rc-calc__bars i { width: 10px; height: 100%; border-radius: 5px; background: var(--color-depth); transform-origin: bottom; animation: rc-bars 1.1s ease-in-out infinite; }
.rc-calc__bars i:nth-child(2) { animation-delay: .15s; background: var(--color-pulse); }
.rc-calc__bars i:nth-child(3) { animation-delay: .3s; }
.rc-calc__title { margin: 0; color: var(--fg-secondary); }

/* ── Ergebnis ────────────────────────────────────────────── */
.rc-areas { display: grid; gap: 12px; margin: 6px 0 20px; }
.rc-area {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
}
.rc-area__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rc-area__name { margin: 0; font-size: 1.125rem; font-weight: 400; }
.rc-tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  font-size: .8125rem; font-weight: 400;
  background: var(--level-light); color: var(--level-text);
}
.rc-bar { position: relative; height: 26px; border-radius: 13px; background: var(--color-mist); overflow: hidden; }
.rc-bar__fill {
  display: block; height: 100%; border-radius: 13px;
  background: var(--level-bar);
  transform-origin: left center; transform: scaleX(var(--p, 0));
  transition: transform .9s var(--ease-out) var(--delay, 0ms);
}
.rc-bar__label {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
  left: calc(var(--p, 0) * 100%); padding-left: 10px;
  font-size: .8125rem; font-weight: 400; font-variant-numeric: tabular-nums; color: var(--fg); white-space: nowrap;
  transition: left .9s var(--ease-out) var(--delay, 0ms);
}
.rc-bar--full .rc-bar__label { left: auto; right: 12px; padding-left: 0; }
.rc-area__text { margin: 10px 0 0; font-size: .9375rem; color: var(--fg-secondary); }

.rc-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 16px;
}
.rc-card__title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 400; letter-spacing: -.01em; }
.rc-card__title:focus { outline: none; }
.rc-card__text { margin: 0 0 16px; color: var(--fg-secondary); }
.rc-mail__row { display: flex; gap: 10px; flex-wrap: wrap; }
.rc-input--name { flex: 1 1 160px; }
.rc-ticks { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.rc-ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
.rc-ticks svg { width: 18px; height: 18px; margin-top: 3px; color: var(--color-depth); background: var(--color-ease); border-radius: 50%; padding: 2px; }
.rc-book { background: var(--color-mist); border-color: var(--color-veil); }
.rc-book .rc-card__text { color: var(--fg-tertiary); }
.rc-qhint { margin: -10px 0 20px; font-size: .9375rem; color: var(--fg-secondary); }
.rc-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; cursor: pointer; font-size: .9375rem; color: var(--fg-secondary); }
.rc-check__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rc-check__box {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--color-bloom);
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.rc-check__box svg { width: 16px; height: 16px; transform: scale(0); transition: transform .2s var(--ease-spring); }
.rc-check__input:checked + .rc-check__box { background: var(--color-depth); border-color: var(--color-depth); }
.rc-check__input:checked + .rc-check__box svg { transform: scale(1); }
.rc-check__input:focus-visible + .rc-check__box { outline: 2px solid var(--color-depth); outline-offset: 2px; }
.rc-check:hover .rc-check__box { border-color: var(--color-depth); }
.rc-check:hover .rc-check__label { color: var(--fg); }
.rc-input {
  flex: 1 1 240px; min-height: 52px; padding: 0 16px;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--color-halo);
  font: inherit; font-size: 1.0625rem; color: var(--fg);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.rc-input::placeholder { color: var(--fg-secondary); opacity: .8; }
.rc-input:focus { outline: none; border-color: var(--color-depth); background: var(--bg-surface); box-shadow: var(--shadow-focus); }
.rc-input.is-invalid { border-color: var(--color-coral-text); }
.rc-mail__error { margin: 10px 0 0; font-size: .9375rem; color: var(--color-coral-text); }
.rc-micro { margin: 12px 0 0; font-size: .8125rem; color: var(--fg-tertiary); }
.rc-micro a { color: inherit; }
.rc-mail--sent { text-align: center; }
.rc-mail__sent-icon {
  width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: var(--color-depth); color: var(--color-bloom);
  animation: rc-pop .5s var(--ease-spring);
}
.rc-mail--sent .rc-card__text { margin-bottom: 0; }
.rc-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.rc-notice {
  margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--color-solea-light); color: var(--color-solea-text); font-size: .9375rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.rc-footer {
  display: flex; justify-content: space-between; gap: 12px;
  width: 100%; max-width: calc(var(--w-wide) + 2 * var(--gutter)); margin: 0 auto;
  padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom));
  font-size: .8125rem; color: var(--fg-tertiary);
}
.rc-footer a { color: inherit; }

/* ── Bewegung ────────────────────────────────────────────── */
.rc-rise {
  animation: rc-rise .55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms + 40ms);
}
@keyframes rc-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rc-pop { 0% { transform: scale(1); } 40% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes rc-bars { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes rc-spin { to { transform: rotate(360deg); } }
@keyframes rc-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.rc-shake { animation: rc-shake .3s ease; }

.rc-no-motion .rc-rise, .rc-no-motion .rc-option.is-selected, .rc-no-motion .rc-mail__sent-icon { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .rc-rise, .rc-option.is-selected, .rc-mail__sent-icon, .rc-calc__bars i, .rc-shake { animation: none; }
  .rc-bar__fill, .rc-bar__label, .rc-progress__seg i, .rc-option, .rc-option__check, .rc-btn, body.rc::before { transition: none; }
  .rc-calc__bars i { transform: scaleY(.7); }
}
