/* ============================================================
   Tankstellen-Linktree — Design System Preview
   Auto light/dark via prefers-color-scheme (dark tokens = base)
   ============================================================ */

@font-face {
  font-family: 'Figtree';
  src: url('fonts/figtree-latin-var.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #0B0B0C;
  --bg-glow: rgba(20, 184, 166, .08);
  --surface: #17171A;
  --surface-2: #1E1E22;
  --text: #F7F7F5;
  --text-muted: #A3A3AB;
  --border: #29292E;
  --border-strong: #3F3F46;
  --accent: #2DD4BF;
  --accent-strong: #14B8A6;
  --on-accent: #04302B;
  --accent-soft: rgba(45, 212, 191, .13);
  --danger: #F87171;
  --ring: rgba(45, 212, 191, .38);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, .45);
  --radius: 1rem;
  --radius-sm: .625rem;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #FAFAF8;
    --bg-glow: rgba(13, 148, 136, .07);
    --surface: #FFFFFF;
    --surface-2: #F4F4F2;
    --text: #1B1B1F;
    --text-muted: #57575F;
    --border: #E5E5E1;
    --border-strong: #C9C9C4;
    --accent: #0F766E;
    --accent-strong: #14B8A6;
    --on-accent: #04302B;
    --accent-soft: rgba(15, 118, 110, .10);
    --danger: #DC2626;
    --ring: rgba(15, 118, 110, .32);
    --shadow: 0 1px 2px rgba(24, 24, 27, .06);
    --shadow-lift: 0 8px 24px rgba(24, 24, 27, .10);
    color-scheme: light;
  }
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(42rem 26rem at 50% -6rem, var(--bg-glow), transparent 70%),
    var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
p  { margin: 0 0 1em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: var(--radius-sm);
}

::selection { background: var(--accent-strong); color: var(--on-accent); }

/* ---------- Layout ---------- */
.wrap {
  max-width: 30rem;
  margin-inline: auto;
  padding: clamp(2.75rem, 9vw, 4.75rem) clamp(1.25rem, 4vw, 1.5rem) 2rem;
}
.wrap--form { max-width: 34rem; }

/* ---------- Profile header (home) ---------- */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}
.avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2DD4BF, #0D9488);
  color: #04302B;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-strong), var(--shadow-lift);
  margin-bottom: 1.25rem;
}
.avatar svg { width: 44px; height: 44px; }
.eyebrow {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .375rem;
}
.profile h1 { margin-bottom: .375rem; }
.tagline { color: var(--text-muted); font-size: 1.0625rem; max-width: 26rem; margin-inline: auto; }

/* ---------- Link cards ---------- */
.links {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: grid;
  gap: .75rem;
}
.link-card {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1rem;
  min-height: 4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.link-card:active { transform: scale(.985); }
@media (hover: hover) {
  .link-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lift);
  }
  .link-card:hover .link-card__chevron { transform: translateX(3px); color: var(--accent); }
}
.link-card__icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: .75rem;
  background: var(--accent-soft);
  color: var(--accent);
}
.link-card__icon svg { width: 21px; height: 21px; }
.link-card__body { min-width: 0; display: grid; gap: .125rem; }
.link-card__title { display: block; font-weight: 700; font-size: 1rem; line-height: 1.3; }
.link-card__sub { display: block; color: var(--text-muted); font-size: .875rem; line-height: 1.35; }
.link-card__chevron {
  margin-left: auto;
  flex: none;
  color: var(--text-muted);
  transition: transform .18s ease, color .18s ease;
}
.link-card__chevron svg { width: 20px; height: 20px; display: block; }

/* ---------- Social row ---------- */
.socials {
  display: flex;
  justify-content: center;
  gap: .875rem;
  margin-bottom: 2.5rem;
}
.socials a {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color .18s ease, border-color .18s ease, transform .18s ease;
}
@media (hover: hover) {
  .socials a:hover { color: var(--accent); border-color: var(--border-strong); transform: translateY(-2px); }
}
.socials svg { width: 21px; height: 21px; }

/* ---------- About / SEO block ---------- */
.about {
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
  margin-bottom: 2.5rem;
}
.about h2 { font-size: 1.0625rem; margin-bottom: .625rem; }
.about p { color: var(--text-muted); font-size: .9375rem; }
.facts {
  margin: 1rem 0 0;
  display: grid;
  gap: .5rem;
  font-size: .9375rem;
}
.facts div { display: flex; gap: .625rem; align-items: baseline; }
.facts dt { flex: none; width: 8.5rem; color: var(--text-muted); font-weight: 600; }
.facts dd { margin: 0; }

/* ---------- Subpage header ---------- */
.page-top { margin-bottom: 1.75rem; }
.back {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  padding: .25rem .5rem .25rem 0;
}
.back:hover { color: var(--accent); }
.back svg { width: 18px; height: 18px; }
.page-top h1 { margin-bottom: .5rem; }
.lede { color: var(--text-muted); font-size: 1.0625rem; }

/* ---------- Forms ---------- */
form { display: grid; gap: 1.125rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: .9375rem;
  margin-bottom: .375rem;
}
.field .optional { color: var(--text-muted); font-weight: 400; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: .75rem .875rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--ring);
}
.field .hint { color: var(--text-muted); font-size: .8125rem; margin-top: .375rem; }
.field.has-error input,
.field.has-error textarea { border-color: var(--danger); }
.error-msg { color: var(--danger); font-size: .875rem; font-weight: 600; margin-top: .375rem; }

/* Radio-Gruppen */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.radio-legend { font-weight: 600; font-size: .9375rem; margin-bottom: .5rem; padding: 0; }
.radio-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.field .radio-option {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 400;
  font-size: .9375rem;
  margin-bottom: 0;
  cursor: pointer;
}
.field .radio-option input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

/* File dropzone (label.dropzone outranks the generic .field label rule) */
label.dropzone,
.dropzone {
  display: grid;
  font-weight: 400;
  justify-items: center;
  gap: .375rem;
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .9375rem;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent-strong); background: var(--surface-2); }
.dropzone:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--ring); }
.dropzone svg { width: 26px; height: 26px; color: var(--accent); }
.dropzone strong { color: var(--text); font-weight: 600; }

/* ALTCHA widget (preview mock) */
.altcha-mock {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: 17rem;
}
.altcha-mock input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent-strong); }
.altcha-mock .altcha-label { font-size: .9375rem; font-weight: 600; }
.altcha-mock .altcha-brand {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.altcha-mock .altcha-brand svg { width: 14px; height: 14px; }

/* Consent checkbox */
.consent {
  display: flex;
  gap: .625rem;
  align-items: flex-start;
  font-size: .875rem;
  color: var(--text-muted);
}
.consent input[type="checkbox"] {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: .125rem;
  accent-color: var(--accent-strong);
}

/* Buttons */
.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 3.125rem;
  padding: .75rem 1.5rem;
  font: inherit;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent-strong);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  width: auto;
}

/* ---------- Danke page ---------- */
.thanks {
  min-height: 70dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: .25rem;
}
.thanks__badge {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.thanks__badge svg { width: 34px; height: 34px; }
.thanks p { color: var(--text-muted); max-width: 24rem; }
.thanks .btn { width: auto; margin-top: 1.25rem; }

/* ---------- Legal pages ---------- */
.legal h2 { margin-top: 2rem; font-size: 1.125rem; }
.legal p, .legal li { color: var(--text-muted); font-size: .9375rem; }
.legal address { font-style: normal; color: var(--text-muted); font-size: .9375rem; line-height: 1.7; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
  font-size: .8125rem;
  color: var(--text-muted);
}
.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: .5rem;
}
.site-footer a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--accent); }
.site-footer .credit { opacity: .8; }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Entrance animation ---------- */
/* Fail-open entrance: initial hidden state lives only in the keyframes
   (fill-mode both), so content stays visible wherever animations don't run */
.reveal {
  animation: rise .55s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: calc(var(--d, 0) * 60ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; }
}

/* ---------- Captcha-Feld (ALTCHA-Widget im eigenen Rahmen) ---------- */
.captcha {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3.375rem;
  padding: .5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-width: 22rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.captcha:focus-within {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--ring);
}
.captcha altcha-widget {
  flex: 1;
  min-width: 0;
  --altcha-border-width: 0;
  --altcha-border-radius: 0;
  --altcha-color-base: transparent;
  --altcha-color-text: var(--text);
  --altcha-color-error-text: var(--danger);
  --altcha-max-width: none;
}
.captcha .altcha {
  padding: 0;
  border: 0;
  background: transparent;
}
.captcha .altcha-main { gap: .625rem; }
.captcha .altcha input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent-strong);
  cursor: pointer;
}
.captcha .altcha input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: .25rem;
}
.captcha .altcha-label {
  font-weight: 600;
  font-size: .9375rem;
  cursor: pointer;
  user-select: none;
}
.captcha .altcha-error { color: var(--danger); font-size: .8125rem; }
.captcha [data-state="verified"] .altcha-label { color: var(--accent); }
.captcha__brand {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .3125rem;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.captcha__brand svg { width: 15px; height: 15px; color: var(--accent); }
