/* Franklin Friends Portal. Vorbild ist die Website (Repo fias-website-live),
   Farben und Schriften nach dem Style Guide von Dominic. */

/* --- Schriften (selbst gehostet, Google Fonts, OFL) ------------------------ */

@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-serif-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-serif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/public-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/public-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens (Style Guide §22, Website-Repo) ------------------------------ */

:root {
  --blue-brand: #00D5EA;
  --cyan-rgb: 0, 213, 234;
  --gray-brand: #252629;
  --deep: #071117;

  --paper-bg: linear-gradient(165deg, #f8f6f1 0%, #f5f3ee 40%, #f2f0ec 100%);

  --text-1: #0F1A20;
  --text-2: #3A4C56;
  --text-3: #5A6A72;
  --placeholder: #6B7A82;

  --border-soft: rgba(15, 26, 32, .08);
  --border-field: rgba(15, 26, 32, .16);

  --danger: #B42318;

  --r-field: 12px;
  --r-slot: 12px;
  --r-icon: 9px;
  --field-h: 56px;
  --r-card: 26px;

  --sh-bar: 0 2px 20px rgba(0, 0, 0, .08);
  /* Felder liegen flach in der Karte. Tiefe haben nur Karte und Hauptknopf. */
  --sh-field: inset 0 1px 2px rgba(15, 26, 32, .05);
  --ring: 0 0 0 4px rgba(var(--cyan-rgb), .2);
  --sh-btn: 0 12px 28px -10px rgba(15, 26, 32, .55);
  --sh-btn-hover: 0 16px 34px -10px rgba(15, 26, 32, .6);
  --sh-card: 0 30px 60px -32px rgba(16, 24, 40, .42), 0 2px 6px rgba(16, 24, 40, .05);

  --ease-reveal: cubic-bezier(.16, 1, .3, 1);

  --gutter: clamp(16px, 3vw, 28px);

  --font-ui: 'Public Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Noto Serif', Georgia, serif;

  /* Franklin-Quadrate im Seitenhintergrund (Style Guide §3.2) */
  --fi-sq-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%2300D5EA' stop-opacity='.09'/%3E%3Cstop offset='1' stop-color='%2300D5EA' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='15.5' y='15.5' width='69' height='69' rx='12.4' transform='rotate(45 50 50)' fill='url(%23g)' stroke='%2300D5EA' stroke-opacity='.22' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  --fi-sq-l: clamp(300px, 44vw, 640px);
  --fi-sq-r: clamp(230px, 32vw, 460px);
  --fi-sq-gap: 1700px;
  --fi-squares:
    var(--fi-sq-svg) left calc(var(--fi-sq-l) / -2) top 120px / var(--fi-sq-l) var(--fi-sq-gap) repeat-y,
    var(--fi-sq-svg) right calc(var(--fi-sq-r) / -2) top 390px / var(--fi-sq-r) var(--fi-sq-gap) repeat-y;

  /* Höhe der Startseite der Website. Die Cyan-Lichter sind dort in Prozent der
     Seitenhöhe angegeben. Auf den kurzen Seiten des Portals würden dieselben
     Prozente platte Flecken ergeben. Deshalb rechnet das Portal sie auf diese
     Höhe und zeigt so genau den oberen Teil des Hintergrunds der Startseite. */
  --halo-canvas: 0 0 / 100% 13867px no-repeat;
}

/* --- Grundlagen --------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: #f5f3ee;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font-ui);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.6;
  color: var(--text-2);
  background:
    var(--fi-squares, none),
    radial-gradient(ellipse 32% 24% at 8% 2%, rgba(2, 213, 234, .22) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 34% 22% at 88% 12%, rgba(2, 213, 234, .24) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 32% 10% at 0% 18%, rgba(2, 213, 234, .30) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 30% 10% at 100% 26%, rgba(2, 213, 234, .28) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 34% 10% at 5% 35%, rgba(2, 213, 234, .32) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 28% 8% at 95% 42%, rgba(2, 213, 234, .26) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 32% 10% at 0% 52%, rgba(2, 213, 234, .30) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 30% 10% at 100% 60%, rgba(2, 213, 234, .28) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 34% 10% at 5% 70%, rgba(2, 213, 234, .30) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 28% 8% at 95% 78%, rgba(2, 213, 234, .26) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 30% 10% at 0% 88%, rgba(2, 213, 234, .28) 0%, transparent 65%) var(--halo-canvas),
    radial-gradient(ellipse 26% 10% at 100% 95%, rgba(2, 213, 234, .26) 0%, transparent 65%) var(--halo-canvas),
    var(--paper-bg);
}

::selection {
  background: rgba(var(--cyan-rgb), .28);
  color: var(--text-1);
}

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

strong {
  color: var(--text-1);
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 2.8vw + 16px, 56px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--text-1);
  text-wrap: balance;
}

.accent {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--blue-brand);
}

.lead {
  margin: 18px 0 0;
  max-width: 46ch;
  font-size: clamp(16px, .3vw + 15px, 19px);
  line-height: 1.55;
  color: var(--text-2);
}

/* --- Schwebendes Menü (wie main-menu.js der Website) --------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 20px 0;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1340px;
  height: 66px;
  margin: 0 auto;
  padding: 0 8px 0 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 16px;
  box-shadow: var(--sh-bar);
}

/* Logo, Franklin-Quadrat als Trenner, dann der Name des Programms. */
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--text-1);
  text-decoration: none;
  border-radius: 8px;
}

.nav-brand img {
  display: block;
  flex: none;
  width: auto;
  height: 36px;
}

.nav-brand::after {
  content: '';
  order: 1;
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--blue-brand);
  border-radius: 1.5px;
  transform: rotate(45deg);
}

.nav-product {
  order: 2;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.nav-product em {
  font-style: italic;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}

@media (max-width: 1149px) {
  .site-header {
    padding: 8px 12px 0;
  }

  .nav-bar {
    height: 54px;
    padding: 0 4px 0 14px;
  }

  .nav-brand {
    gap: 10px;
  }

  .nav-brand img {
    height: 28px;
  }

  .nav-product {
    font-size: 17px;
  }

  .nav-link {
    padding: 0 12px;
  }
}

/* Schmales Handy: Der Name des Programms steht schon links. Der Link zum
   Programm weicht, "Abmelden" bleibt. */
@media (max-width: 479px) {
  a.nav-link {
    display: none;
  }
}

/* --- Seite -------------------------------------------------------------- */

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(36px, 8vh, 96px) var(--gutter) 56px;
}

.column {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
}

.page-intro {
  margin-bottom: clamp(24px, 3vw, 36px);
}

.page-intro .lead {
  max-width: 52ch;
}

/* Eine Einblendung: Einleitung, Punkte und Karte kommen nacheinander. */
.auth-intro > *,
.page-intro > *,
.points,
.card {
  animation: rise .8s var(--ease-reveal) both;
}

.auth-intro > :nth-child(2),
.page-intro > :nth-child(2) { animation-delay: .06s; }
.page-intro > :nth-child(3),
.points { animation-delay: .12s; }
.card { animation-delay: .16s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* --- Login: links Einordnung, rechts Karte ------------------------------- */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
  grid-template-areas:
    'intro card'
    'points card';
  column-gap: clamp(40px, 6vw, 96px);
  width: 100%;
  max-width: 1080px;
  margin: auto;
}

.auth-intro {
  grid-area: intro;
  align-self: end;
}

.auth .card {
  grid-area: card;
  align-self: center;
}

.points {
  grid-area: points;
  align-self: start;
  display: grid;
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  max-width: 44ch;
}

.points li {
  position: relative;
  padding-left: 26px;
  line-height: 1.5;
}

/* Franklin-Quadrat als Marker (Style Guide §4.1) */
.points li::before,
.terms li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: .55em;
  width: 8px;
  height: 8px;
  background: var(--blue-brand);
  border-radius: 2px;
  transform: rotate(45deg);
}

@media (max-width: 899px) {
  .page {
    padding-top: clamp(24px, 5vh, 48px);
  }

  .auth {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'intro'
      'card'
      'points';
    row-gap: 24px;
    max-width: 30rem;
    margin: 0 auto;
  }

  .auth-intro h1 {
    font-size: clamp(32px, 6vw + 12px, 44px);
  }

  .auth-intro .lead {
    margin-top: 10px;
  }

  .points {
    gap: 8px;
    margin: 8px 0 0;
    padding: 0 4px;
    font-size: 15px;
  }
}

/* --- Karte -------------------------------------------------------------- */

.card {
  min-width: 0;
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--r-card);
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
          backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: var(--sh-card);
}

.card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(25px, .6vw + 20px, 30px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-wrap: balance;
}

@media (max-width: 640px) {
  .card--wide {
    padding: 14px 14px 20px;
    border-radius: 22px;
  }

  .card--wide .form {
    padding: 0 6px;
  }
}

.card-text {
  margin: 10px 0 24px;
  font-size: 15.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 24px;
  padding-top: 20px;
  font-size: 15px;
  border-top: 1px solid var(--border-soft);
}

/* --- Formular ----------------------------------------------------------- */

.form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

/* Feld wie die Suche der Website (blog-overview-rebrand.js) */
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: var(--field-h);
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--border-field);
  border-radius: var(--r-field);
  box-shadow: var(--sh-field);
  transition: border-color .25s ease, box-shadow .25s ease;
}

.input-wrap:focus-within {
  border-color: var(--blue-brand);
  box-shadow: var(--ring), var(--sh-field);
}

.input-wrap svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--text-3);
}

.input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: 16.5px;
  color: var(--text-1);
  caret-color: var(--text-1);
  background: transparent;
  border: 0;
  outline: 0;
  -webkit-appearance: none;
          appearance: none;
}

.input-wrap input::placeholder {
  color: var(--placeholder);
}

/* Nach Autocomplete färbt der Browser das innere Feld blau oder gelb, der Rand
   der Hülle bliebe weiß. Chrome und Safari lassen die Farbe nicht direkt
   überschreiben; ein endlos langer Übergang hält sie durchsichtig. */
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-1);
  caret-color: var(--text-1);
  transition: background-color 600000s 0s, color 600000s 0s;
}

.input-wrap input:autofill {
  filter: none;
}

/* --- Code in sechs Kästchen ---------------------------------------------- */

.otp {
  position: relative;
}

/* Ohne JavaScript: ein normales Feld */
.otp-input {
  width: 100%;
  height: var(--field-h);
  padding: 0 16px;
  font: inherit;
  font-size: 22px;
  letter-spacing: .3em;
  color: var(--text-1);
  background: #fff;
  border: 1px solid var(--border-field);
  border-radius: var(--r-field);
  box-shadow: var(--sh-field);
}

.otp-slots {
  display: none;
}

.otp.is-ready .otp-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  height: 100%;
  font-size: 16px;
  opacity: 0;
  cursor: text;
}

.otp.is-ready .otp-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.otp-slot {
  display: grid;
  place-items: center;
  height: 64px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text-1);
  background: #fff;
  border: 1px solid var(--border-field);
  border-radius: var(--r-slot);
  box-shadow: var(--sh-field);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.otp-slot.is-active {
  border-color: var(--blue-brand);
  box-shadow: var(--ring), var(--sh-field);
}

.otp-slot.is-active:empty::after {
  content: '';
  width: 2px;
  height: 26px;
  background: var(--text-1);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 420px) {
  .otp.is-ready .otp-slots {
    gap: 6px;
  }

  .otp-slot {
    height: 56px;
    font-size: 26px;
  }
}

/* --- Haken -------------------------------------------------------------- */

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text-1);
  cursor: pointer;
}

.check input {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  background: #fff;
  border: 1.5px solid rgba(15, 26, 32, .34);
  border-radius: 6px;
  cursor: pointer;
  -webkit-appearance: none;
          appearance: none;
  transition: background-color .15s ease, border-color .15s ease;
}

.check input::after {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--deep);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%);
  transform: scale(0);
  transition: transform .15s var(--ease-reveal);
}

.check input:checked {
  background: var(--blue-brand);
  border-color: var(--blue-brand);
}

.check input:checked::after {
  transform: scale(1);
}

/* --- Hinweise ----------------------------------------------------------- */

.notice {
  margin: 0;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  border: 1px solid;
  border-radius: 12px;
}

.notice--error {
  color: var(--danger);
  background: rgba(180, 35, 24, .06);
  border-color: rgba(180, 35, 24, .24);
}

.notice--info {
  color: var(--text-1);
  background: rgba(var(--cyan-rgb), .08);
  border-color: rgba(var(--cyan-rgb), .35);
}

/* --- Knöpfe und Links (Style Guide §7.3, §7.5) --------------------------- */

.btn {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  min-height: var(--field-h);
  padding: 0;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: var(--gray-brand);
  border: 0;
  border-radius: var(--r-field);
  box-shadow: var(--sh-btn);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn-label {
  display: flex;
  align-items: center;
  padding: 0 22px;
}

.btn-icon {
  display: grid;
  place-items: center;
  width: 46px;
  margin: 5px;
  color: var(--deep);
  background: var(--blue-brand);
  border-radius: var(--r-icon);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.card--wide .btn {
  justify-self: start;
}

@media (min-width: 640px) {
  .card--wide .btn {
    width: auto;
    min-width: 18rem;
  }
}

.text-link {
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: var(--blue-brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-btn-hover);
  }

  .nav-link:hover {
    color: var(--text-1);
    background: rgba(15, 26, 32, .04);
  }

  .text-link:hover {
    text-decoration-thickness: 3px;
  }

  .site-footer a:hover {
    color: var(--text-1);
  }

  .check:hover input:not(:checked) {
    border-color: rgba(var(--cyan-rgb), .9);
  }
}

/* --- Teilnahmebedingungen ----------------------------------------------- */

.terms {
  max-height: min(55vh, 32rem);
  margin-bottom: 24px;
  padding: 22px clamp(16px, 3vw, 26px);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 14.5px;
  line-height: 1.65;
  background: #fff;
  border: 1px solid var(--border-field);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 #fff;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 26, 32, .28) transparent;
}

.terms h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  color: var(--text-1);
}

.terms-stand {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-3);
}

.terms h3 {
  margin: 24px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.terms p {
  margin: 0 0 8px;
  max-width: 72ch;
}

.terms ul {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.terms li {
  position: relative;
  margin-bottom: 4px;
  padding-left: 22px;
  max-width: 70ch;
}

.terms li::before {
  width: 7px;
  height: 7px;
  top: .65em;
  border-radius: 1.5px;
}

/* --- Fuß ---------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding: 24px var(--gutter) 32px;
  font-size: 13.5px;
}

.site-footer a {
  color: var(--text-3);
  text-decoration: none;
  border-radius: 4px;
  transition: color .2s ease;
}

/* --- Weniger Bewegung --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .auth-intro > *,
  .page-intro > *,
  .points,
  .card,
  .loading::before,
  .otp-slot.is-active:empty::after {
    animation: none;
  }

  .btn,
  .check input::after {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* --- Seitenwechsel ohne Neuladen (public/js/portal.js) -------------------- */

[hidden] {
  display: none !important;
}

/* Nach einem Seitenwechsel bekommt <main> den Fokus, damit Screenreader und
   Tastatur oben anfangen. Ein Rahmen um die ganze Seite wäre nur Lärm. */
.page:focus {
  outline: none;
}

/* Lädt nur die Liste neu (nach einer Empfehlung), blendet nichts ein zweites Mal ein. */
.page.page--still * {
  animation: none;
}

.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: auto;
  padding: 48px 20px;
  color: var(--text-3);
}

.loading::before {
  content: '';
  width: 9px;
  height: 9px;
  background: var(--blue-brand);
  border-radius: 2px;
  transform: rotate(45deg);
  animation: pulse 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: .3;
  }
}

.btn:disabled {
  cursor: progress;
  opacity: .72;
  transform: none;
}

/* --- Dashboard ---------------------------------------------------------- */

.dashboard {
  display: grid;
  gap: clamp(18px, 2.4vw, 24px);
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
}

/* Breiter Bildschirm: oben der Empfehlungslink über die ganze Breite,
   darunter Liste und Formular nebeneinander, beide gleich hoch. */
@media (min-width: 1000px) {
  .dashboard {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas:
      'intro intro'
      'share share'
      'list form';
    max-width: 1120px;
  }

  .dashboard .page-intro { grid-area: intro; }
  .dashboard .panel-section { grid-area: list; }
  .dashboard #empfehlen { grid-area: form; }

  /* Links Überschrift und Satz, rechts der Link mit dem Knopf. */
  .dashboard .share {
    grid-area: share;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: center;
    column-gap: clamp(24px, 4vw, 56px);
  }

  .dashboard .share .card-text {
    margin-bottom: 0;
  }

  .dashboard .share-row {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  /* In der schmalen Spalte: Vorname und Nachname nebeneinander, der Rest breit. */
  .dashboard .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard .form-grid .field:nth-child(n + 3) {
    grid-column: 1 / -1;
  }
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.count {
  padding: 2px 10px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  background: rgba(15, 26, 32, .06);
  border-radius: 999px;
}

/* Empfehlungslink */

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-link {
  flex: 100 1 16rem;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: var(--field-h);
  margin: 0;
  padding: 12px 16px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-1);
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px solid var(--border-field);
  border-radius: var(--r-field);
  box-shadow: var(--sh-field);
  -webkit-user-select: all;
          user-select: all;
}

.btn--compact {
  flex: 1 0 auto;
  width: auto;
  font-size: 15.5px;
}

.btn--compact .btn-label {
  padding: 0 18px;
}

.btn--compact .btn-icon {
  width: 44px;
}

/* Provision */

/* Eine ruhige Zeile über der Liste, keine Kachel in der Karte. */
.provision {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 16px;
  padding: 2px 0 18px;
  border-bottom: 1px solid var(--border-soft);
}

.provision p {
  margin: 0;
}

.provision-label {
  font-weight: 600;
  color: var(--text-1);
}

.provision-amount {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-family: var(--font-display);
  font-size: clamp(28px, 1.4vw + 18px, 36px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text-1);
}

.provision-note {
  grid-column: 1;
  grid-row: 2;
  font-size: 14px;
  color: var(--text-3);
}

/* Liste der Empfehlungen */

.referrals {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.referral {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'name status'
    'date status';
  align-items: center;
  gap: 2px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
}

.referral:first-child {
  border-top: 0;
}

.referral:last-child {
  padding-bottom: 2px;
}

.referral-name {
  grid-area: name;
  font-weight: 600;
  color: var(--text-1);
  overflow-wrap: anywhere;
}

.referral-date {
  grid-area: date;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.referral-status {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.referral-amount {
  font-family: var(--font-display);
  font-size: 18px;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text-1);
}

@media (max-width: 520px) {
  .referral {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'name'
      'date'
      'status';
  }

  .referral-status {
    justify-self: start;
    margin-top: 6px;
  }
}

/* Phasen: Pille mit Franklin-Raute */

.phase {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 11px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
}

.phase::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 1.5px;
  transform: rotate(45deg);
}

.phase--neu {
  color: var(--text-2);
  background: rgba(15, 26, 32, .06);
}

.phase--angebot {
  color: #0B5560;
  background: rgba(var(--cyan-rgb), .14);
}

.phase--angebot::before {
  background: var(--blue-brand);
}

.phase--gutschein {
  color: #5C4300;
  background: #FDE68A;
}

.phase--gutschein::before {
  background: #B7791F;
}

.phase--nicht_zustande {
  color: var(--text-3);
  border-color: rgba(15, 26, 32, .12);
}

.phase--nicht_zustande::before {
  background: rgba(15, 26, 32, .3);
}

.empty {
  margin: 0;
  max-width: 44ch;
  color: var(--text-2);
}

/* Formular im Dashboard */

.form-grid {
  display: grid;
  gap: 16px;
}

/* Zwei Spalten nur, solange die Karte die volle Breite hat. */
@media (min-width: 640px) and (max-width: 999px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard .form .btn {
    justify-self: start;
    width: auto;
    min-width: 18rem;
  }
}

.dashboard .card {
  scroll-margin-top: 96px;
}

/* --- Empfehlungslink ---------------------------------------------------- */

/* Breitere Karte, Felder paarweise: Am Desktop bleibt das Formular flach und
   etwa so hoch wie der Text links daneben. */
.auth--link {
  grid-template-columns: minmax(0, 1fr) minmax(0, 36rem);
  max-width: 1144px;
}

.auth--link h1 {
  font-size: clamp(34px, 2vw + 18px, 48px);
}

/* Die Punkte laufen so breit wie der Satz darüber. */
.auth--link .points {
  max-width: 52ch;
}

/* Zwischen Handy und Desktop reicht der Platz nicht für zwei Spalten. */
@media (max-width: 1099px) {
  .auth--link {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'intro'
      'card'
      'points';
    row-gap: 24px;
    max-width: 36rem;
    margin: 0 auto;
  }

  .auth--link .points {
    margin-top: 8px;
  }
}

/* Vorname und Nachname teilen sich eine Zeile. In der zweiten bekommt die
   E-Mail mehr Platz als das Telefon. */
@media (min-width: 640px) {
  .form-grid--link {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .form-grid--link .field {
    grid-column: span 5;
  }

  .form-grid--link .field:nth-child(3) {
    grid-column: span 6;
  }

  .form-grid--link .field:nth-child(4) {
    grid-column: span 4;
  }
}

/* Unsichtbares Feld gegen einfache Bots: Menschen sehen es nicht. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
