/* beta_portal/static/beta_portal/css/portal.css */
/* =====================================================================
   Termite Customer Portal — Dark Theme (optimized)

   Prinzipien
   - Dunkel, flach, ein Akzent (Grün). Keine Verläufe, kein Violett/Gelb.
   - Ein System für Abstände, Schriftgrößen, Radien und Buttons (Tokens).
   - WCAG 2.2 AA: Text-Kontrast >= 4.5:1, UI-Kontrast >= 3:1, sichtbarer
     Fokus, Touch-Ziele >= 44px, reduzierte Bewegung, Forced-Colors.
   - Conversion: pro Ansicht EIN dominanter Button, empfohlenes Paket
     (Pro / "Most popular") klar hervorgehoben, Preis gross + Preis/Termite.
   - Alle bisherigen Klassennamen (HTML + portal.js) bleiben erhalten.
   ===================================================================== */


/* ---------- 1. Tokens ---------- */
:root{
  color-scheme: dark;

  /* Flächen */
  --bg:         #0E1117;   /* Seitenhintergrund */
  --panel:      #141922;   /* Sidebar */
  --surface:    #171C24;   /* Karten */
  --surface-2:  #11151C;   /* Unterflächen, Codebox, Tabellenkopf */
  --surface-3:  #1E252F;   /* Hover */

  /* Text (alle >= 4.5:1 auf --surface) */
  --text:   #F0F3F6;
  --muted:  rgba(240,243,246,.76);
  --faint:  rgba(240,243,246,.62);

  /* Ränder */
  --border:        rgba(255,255,255,.12);
  --border-strong: rgba(255,255,255,.22);
  --border-2:      rgba(255,255,255,.08);   /* Alias (alt) */

  /* Marke / Akzent */
  --primary:        #10A37F;
  --primary-hover:  #14B991;
  --primary-press:  #0E8E6D;
  --on-primary:     #04140F;                /* Text auf Primary: 5.9:1 */
  --accent-text:    #46D9B0;                /* grüner Text/Links auf dunkel: >= 8:1 */
  --accent-bg:      rgba(16,163,127,.14);
  --accent-border:  rgba(16,163,127,.45);

  /* Status */
  --warn:        #F1C76B;
  --warn-bg:     rgba(241,199,107,.14);
  --danger:      #FF9494;
  --danger-bg:   rgba(255,107,107,.10);
  --danger-border: rgba(255,107,107,.45);

  /* Fokus */
  --focus: #7CE8CA;
  --ring: 0 0 0 4px rgba(16,163,127,.18);   /* Alias (alt) */

  /* Radien: 3 Stufen + Pille */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Abstände (4px-Raster) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Typografie */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --fs-xs: .8125rem;   /* 13px  Hilfetexte, Tags */
  --fs-sm: .875rem;    /* 14px  Tabellen, Nebentexte */
  --fs-md: 1rem;       /* 16px  Fliesstext */
  --fs-lg: 1.125rem;   /* 18px  Kartentitel */
  --fs-xl: 1.5rem;     /* 24px  Seitentitel */
  --fs-2xl: 2.25rem;   /* 36px  grosse Zahlen */

  /* Schatten */
  --shadow-soft: 0 6px 20px rgba(0,0,0,.28);
  --shadow:      0 14px 36px rgba(0,0,0,.38);

  /* Steuerhöhen */
  --control-h: 44px;       /* Standard-Button / Toggle */
  --control-h-sm: 40px;    /* kompakte Buttons */
}


/* ---------- 2. Base ---------- */
*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4{ line-height: 1.25; }
b, strong{ font-weight: 650; color: var(--text); }

a{ color: inherit; text-decoration: none; }

::selection{ background: rgba(16,163,127,.45); color: #fff; }

/* Fokus: Outline statt nur Schatten, immer sichtbar */
:focus-visible{
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Fliesstext-Links müssen auch ohne Farbe erkennbar sein */
.link{
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.link:hover{ text-decoration-thickness: 2px; }


/* ---------- 3. Layout ---------- */
.container{
  display: flex;
  min-height: 100vh;
}

.main{
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding: var(--space-6) var(--space-6) var(--space-7);
}

.grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
}

/* Overview: Token + Termites nebeneinander (robust per :has, sonst volle Breite) */
@media (min-width: 1100px){
  .card:has(#token),
  .card:has(.big-balance){ grid-column: span 6; }
}


/* ---------- 4. Sidebar ---------- */
.sidebar{
  width: 272px;
  flex-shrink: 0;
  padding: var(--space-5) var(--space-4);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  overflow-y: auto;

  background: var(--panel);
  border-right: 1px solid var(--border);
}

.brand{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-2);
}

.brand-logo{
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-badge{
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
}

.brand h2{
  margin: 0;
  font-size: var(--fs-lg);
  letter-spacing: .1px;
}

.brand small{
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.nav{
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav a{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-3);

  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--muted);
  font-size: var(--fs-md);

  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.nav a:hover{
  color: var(--text);
  background: var(--surface-3);
}

/* Aktiver Punkt: Farbe + Balken + Gewicht (nicht nur Farbe) */
.nav a.active{
  color: var(--text);
  font-weight: 650;
  background: var(--accent-bg);
  border-color: var(--accent-border);
}
.nav a.active::before{
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.nav a span,
.nav a .tag{ flex-shrink: 0; }

.nav .tag{
  font-size: var(--fs-xs);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.08);
  color: var(--muted);
  border: 1px solid var(--border);
}

.sidebar-footer{
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}


/* ---------- 5. Topbar & Pills ---------- */
.topbar{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.topbar-right{
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.h1{
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -.01em;
}

.sub{
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.pill{
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: var(--space-1) var(--space-3);

  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,163,127,.18);
}
.dot.warn{
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(241,199,107,.18);
}


/* ---------- 6. Buttons ----------
   Hierarchie:  .btn-primary  = Hauptaktion (1 pro Bereich)
                .btn          = sekundär (Outline)
                .btn-danger   = leise/tertiär (Logout), neutral grau           */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-4);

  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);

  font: inherit;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;

  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.btn:hover{
  background: var(--surface-3);
  border-color: rgba(255,255,255,.4);
}
.btn:active{ background: var(--surface-2); }

.btn-primary{
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover{
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(16,163,127,.28);
}
.btn-primary:active{
  background: var(--primary-press);
  border-color: var(--primary-press);
  box-shadow: none;
}

/* Leise Variante (Logout u.ä.): neutral, nicht rot und nicht grün.
   Klassenname bleibt btn-danger aus Kompatibilität; .btn-quiet ist der neue Alias. */
.btn-danger,
.btn-quiet{
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
  font-weight: 500;
}
.btn-danger:hover,
.btn-quiet:hover{
  color: var(--text);
  background: var(--surface-3);
  border-color: var(--border-strong);
}

/* Gold-Button (aktuell auf keiner Seite genutzt) — als flache Warn-Variante
   im gleichen System, ohne Verlauf */
.btn-redeem{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn);
  color: #1b1405;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-redeem:hover{ background: #f6d684; border-color: #f6d684; }

/* Disabled (portal.js setzt disabled während des Checkouts) */
.btn:disabled,
.btn[aria-disabled="true"],
.btn-redeem:disabled{
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary:disabled{ background: var(--primary-press); border-color: var(--primary-press); }

.full-width{ width: 100%; }

/* Kompakt (Plugin-Download) */
.plugin-download-btn{
  min-height: var(--control-h-sm);
  padding: var(--space-1) var(--space-4);
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
}


/* ---------- 7. Cards & Typografie in Karten ---------- */
.card{
  grid-column: span 12;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-soft);
}

.card h3{
  margin: 0 0 var(--space-3);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -.005em;
}

.card p{
  margin: 0 0 var(--space-3);
  color: var(--muted);
}
.card p:last-child{ margin-bottom: 0; }

.card-row{
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.kpi{
  flex: 1 1 210px;
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.kpi .label{ color: var(--muted); font-size: var(--fs-xs); }
.kpi .value{ font-size: var(--fs-lg); font-weight: 650; margin-top: var(--space-1); }

.section-header,
.section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.section-subtext{
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: var(--space-2);
}

.balance-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.big-balance{
  font-size: var(--fs-2xl);
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.button-row{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.button-row .btn{ height: 100%; min-height: 52px; }

.actions-row{
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.helper-text{
  color: var(--faint);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.card p.helper-text{ color: var(--faint); margin-top: var(--space-3); }

.spacing-top{ margin-top: var(--space-4); }

.info-block{
  margin-top: var(--space-5);
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: 1.65;
}
.info-block h4{
  margin: 0 0 var(--space-2);
  font-size: var(--fs-md);
  color: var(--text);
}
.content-list{
  margin: var(--space-2) 0 var(--space-4);
  padding-left: 20px;
}
.content-list li{ margin-bottom: var(--space-1); }

/* Info-Box: war schwarz auf dunkelgrün (unleserbar) -> heller Text */
.info-box{
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.info-box p,
.card .info-box p{ margin: 0; color: var(--text); }
.info-icon{ font-size: var(--fs-md); margin-top: 2px; }


/* ---------- 8. Token / Codebox ---------- */
.codebox{
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text);
  word-break: break-all;
  user-select: all;
}


/* ---------- 9. Tabellen ---------- */
.table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: var(--space-4);
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.table th,
.table td{
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-2);
  color: var(--muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.table th{
  color: var(--text);
  font-weight: 650;
  background: var(--surface-2);
  border-bottom-color: var(--border);
}

.table tbody tr:last-child td{ border-bottom: 0; }
.table tbody tr:nth-child(even) td{ background: rgba(255,255,255,.02); }
.table tbody tr:hover td{ background: var(--surface-3); color: var(--text); }

.note-cell{
  max-width: 420px;
  white-space: normal;
}

/* Nur auf kleinen Screens scrollbar machen (sonst bleibt die Tabellen-Semantik erhalten) */
@media (max-width: 820px){
  .table{ display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Invoices table: text wraps instead of scrolling sideways (no horizontal scroll) */
@media (min-width: 651px) and (max-width: 820px){
  .table--wrap{ display: table; overflow-x: visible; }
  .table--wrap th,
  .table--wrap td{ white-space: normal; }
}


/* ---------- 10. Preis-Pläne (Overview: Free / Pro / Corporate) ---------- */
.packages-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);        /* Platz für das "Recommended"-Label */
  align-items: stretch;
}

.package-card{
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.package-card:hover{
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

/* Empfohlener Plan = Pro (package-card--1; --pro für künftige Markup-Variante) */
.package-card--1,
.package-card--pro{
  border: 2px solid var(--primary);
  background: linear-gradient(0deg, var(--accent-bg), var(--accent-bg)), var(--surface);
  box-shadow: 0 0 0 4px rgba(16,163,127,.10), var(--shadow);
}
.package-card--1:hover,
.package-card--pro:hover{
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 4px rgba(16,163,127,.16), var(--shadow);
}
.package-card--1::before,
.package-card--pro::before{
  content: "Recommended";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.package-card__header{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.package-card__eyebrow{
  margin-bottom: var(--space-3);
  color: var(--muted);
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.package-card__name{
  font-size: 2rem;
  font-weight: 750;
  line-height: 1.1;
}

.package-card__subtitle{
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.package-card__features{
  list-style: none;
  margin: 0;
  padding: var(--space-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.package-feature{
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.package-feature__label{
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.feature-status{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-status svg{
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Status über Form (Haken / Plus / X) UND Farbe, Violett entfernt */
.feature-status--full{
  background: var(--primary);
  color: var(--on-primary);
}
.feature-status--partial{
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid rgba(241,199,107,.5);
}
.feature-status--none{
  background: rgba(255,255,255,.06);
  color: var(--faint);
  border: 1px solid var(--border);
}

.package-feature--full .package-feature__label{ color: var(--text); }
.package-feature--partial .package-feature__label{ color: var(--warn); }
.package-feature--none .package-feature__label{
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-color: rgba(240,243,246,.28);
}

.package-card__footer{
  margin-top: auto;
  padding-top: var(--space-4);
}
.package-card__footer .btn{ min-height: 52px; font-size: var(--fs-md); }

/* Ein dominanter Button: nur der empfohlene Plan bleibt "primary" gefüllt,
   Free/Corporate werden zu sekundären Outline-Buttons (gleiches Markup). */
.package-card:not(.package-card--1):not(.package-card--pro) .btn-primary{
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.package-card:not(.package-card--1):not(.package-card--pro) .btn-primary:hover{
  background: var(--surface-3);
  border-color: rgba(255,255,255,.4);
  box-shadow: none;
}
.package-card--1 .btn-primary,
.package-card--pro .btn-primary{
  box-shadow: 0 6px 18px rgba(16,163,127,.28);
}


/* ---------- 11. Termite-Pakete kaufen (Billing) ---------- */
.termite-packages-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-2) 0 var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.termite-packages-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.termite-packages-card{
  position: relative;
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.termite-packages-card:hover{
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

/* Beliebtestes Paket (enthält .package-pill) wird dominant dargestellt */
.termite-packages-card:has(.package-pill){
  border: 2px solid var(--primary);
  background: linear-gradient(0deg, var(--accent-bg), var(--accent-bg)), var(--surface);
  box-shadow: 0 0 0 4px rgba(16,163,127,.10), var(--shadow-soft);
}

/* EDU-Pakete: gleiche Akzentfarbe statt Neon-Grün/Gelb-Schatten */
.termite-packages-card.edu{
  border: 1px solid var(--accent-border);
  background: var(--accent-bg);
}
.termite-packages-card.edu:hover{ border-color: var(--primary); }

.card-top{
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.title-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pkg-title{
  font-size: var(--fs-lg);
  font-weight: 700;
}

/* "Most popular": flach, Primary-Grün statt Violett-Verlauf */
.package-pill{
  display: inline-flex;
  align-items: center;
  height: fit-content;
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .03em;
}

.edu-badge{
  margin-left: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--accent-bg);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
  font-size: var(--fs-xs);
  font-weight: 700;
  vertical-align: middle;
}

/* Rabatt als gefüllte Pille (Platz bleibt auch bei .placeholder erhalten) */
.badge-discount{
  width: fit-content;
  min-height: 24px;
  padding: 1px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 22px;
}
.badge-discount.placeholder{ visibility: hidden; }

.price-per-termite{
  font-size: var(--fs-sm);
  color: var(--muted);
}

.card-middle{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-4);
}

.main-price,
.price-row{
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.price-row{ justify-content: space-between; }
.main-price{ justify-content: flex-start; flex-wrap: wrap; }

.price-old{
  text-decoration: line-through;
  color: var(--faint);
  font-size: var(--fs-md);
}

.price-new{
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}

.buy-btn{
  width: 100%;
  max-width: none;
  min-height: 52px;
  font-size: var(--fs-md);
}



/* ---------- 12. Toggle (Educational offers) ---------- */
.edu-toggle-row{
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.edu-toggle-copy{
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.edu-toggle-title{
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
}
.edu-toggle-note{
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
}

.edu-toggle{
  position: relative;
  display: inline-flex;
  width: 56px;
  height: 32px;
  flex-shrink: 0;
}
.edu-toggle input{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.edu-toggle-slider{
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: #2A313C;
  border: 1px solid #8B95A3;            /* >= 3:1 gegen die Karte */
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.edu-toggle-slider::before{
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.edu-toggle input:checked + .edu-toggle-slider{
  background: var(--primary);
  border-color: var(--primary);
}
.edu-toggle input:checked + .edu-toggle-slider::before{ transform: translateX(24px); }

/* Fokus liegt am (unsichtbaren) Input, also am Slider sichtbar machen */
.edu-toggle input:focus-visible + .edu-toggle-slider{
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.edu-toggle input:disabled{ cursor: not-allowed; }
.edu-toggle input:disabled + .edu-toggle-slider{
  cursor: not-allowed;
  opacity: .55;
}


/* ---------- 13. Plugins ---------- */
.plugin-list{
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.plugin-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background .15s ease, border-color .15s ease;
}
.plugin-item:hover{
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.plugin-left{
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.plugin-name{
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
}
.plugin-meta{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.dot-sep{ opacity: .6; }
.plugin-right{ flex-shrink: 0; }

.plugin-empty{
  padding: var(--space-6) var(--space-5);
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}


/* ---------- 14. Responsive ---------- */
@media (max-width: 1100px){
  .termite-packages-card{ grid-column: span 6; }
}

@media (max-width: 980px){
  .sidebar{ width: 232px; }
  .main{ padding: var(--space-5); }
  .button-row{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px){
  .container{ flex-direction: column; }

  .sidebar{
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-3) var(--space-4);
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand{ padding: 0; }

  /* Navigation als horizontal scrollbare Leiste */
  .nav{
    order: 3;
    flex: 1 1 100%;
    flex-direction: row;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-1);
    -webkit-overflow-scrolling: touch;
  }
  .nav a{ flex-shrink: 0; white-space: nowrap; }
  .nav a.active::before{ display: none; }

  .sidebar-footer{
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
  }
  .sidebar-footer .btn{ width: auto; min-height: var(--control-h-sm); }

  .main{ max-width: none; padding: var(--space-5) var(--space-4); }
  .topbar-right{ justify-content: flex-start; }
}

@media (max-width: 650px){
  .button-row{ grid-template-columns: 1fr; }
  .termite-packages-card{ grid-column: span 12; }
  .plugin-item{ flex-direction: column; align-items: stretch; }
  .plugin-right .btn{ width: 100%; }
  .termite-packages-toolbar{ align-items: flex-start; }
  .edu-toggle-row{ align-items: flex-start; }
  .card{ padding: var(--space-4); }
  .price-new{ font-size: 2rem; }
}

@media (max-width: 420px){
  .main{ padding: var(--space-4) var(--space-3); }
  .pill{ padding: var(--space-1) var(--space-3); }
}


/* ---------- 15. Bewegung & Hochkontrast ---------- */
/* Hover-Lift nur für Nutzer ohne Bewegungs-Reduktion */
@media (prefers-reduced-motion: no-preference){
  .package-card:hover,
  .termite-packages-card:hover,
  .plugin-item:hover{ transform: translateY(-2px); }
  .package-card,
  .termite-packages-card,
  .plugin-item{ transition-property: transform, border-color, box-shadow, background; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active){
  .btn, .btn-primary, .btn-danger, .pill, .package-card, .termite-packages-card, .edu-toggle-slider{
    border: 1px solid CanvasText;
  }
  .nav a.active{ outline: 2px solid Highlight; }
  .edu-toggle input:checked + .edu-toggle-slider{ background: Highlight; }
}


/* =====================================================================
   v2 — Struktur & neue Komponenten
   (Header mit Titel + Guthaben-Chip, Account-Block, Guthaben-Karte,
    Token maskiert, Plan-Vergleich mit Preis / "Your plan" / Einklappen,
    Toast, Schritte, Verlauf-Zusammenfassung, Tabelle→Karten auf Mobil)
   ===================================================================== */

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

.skip-link{
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}
.skip-link:focus{ top: var(--space-4); }

.btn-sm{
  min-height: var(--control-h-sm);
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
}
.btn-ghost{
  border-color: transparent;
  background: transparent;
  color: var(--accent-text);
}
.btn-ghost:hover{
  background: var(--accent-bg);
  border-color: transparent;
}

.card h2{
  margin: 0 0 var(--space-3);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -.005em;
}


/* ---------- Seitenkopf: Titel links, Guthaben-Chip rechts ---------- */
.page-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.page-header .sub{ margin: var(--space-1) 0 0; }

.balance-chip{
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-h);
  padding: var(--space-1) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-sm);
  transition: border-color .15s ease, color .15s ease;
}
.balance-chip:hover{ border-color: var(--primary); color: var(--text); }
.balance-chip strong{
  color: var(--text);
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
}
.balance-chip__plan{
  padding-left: var(--space-3);
  border-left: 1px solid var(--border);
}
.balance-chip.is-low{ border-color: var(--warn); }


/* ---------- Kopfzeile rechts: Guthaben, Buy-Button, Account-Menü ---------- */
.page-header__actions{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
}

.account-menu{ position: relative; }

.account-menu__btn{
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.account-menu__btn:hover{ background: var(--surface-3); border-color: rgba(255,255,255,.4); }

.avatar{
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-weight: 700;
  text-transform: uppercase;
}

.account-menu__chevron{
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
  transition: transform .15s ease;
}
.account-menu__btn[aria-expanded="true"] .account-menu__chevron{ transform: rotate(180deg); }

.account-menu__panel{
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 50;
  min-width: 250px;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.account-menu__panel[hidden]{ display: none; }

.account__label{ display: block; color: var(--faint); font-size: var(--fs-xs); }
.account__email{ display: block; color: var(--text); font-size: var(--fs-sm); overflow-wrap: anywhere; }


/* ---------- Guthaben-Karte ---------- */
.balance-card{
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.balance-card h2{ margin: 0; }
.balance-card__main{
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.balance-card__sub{ color: var(--muted); font-size: var(--fs-md); }
.balance-card .actions-row{ margin-top: var(--space-2); }
.balance-card.is-low{ border-color: var(--warn); }

.card .low-msg{
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--warn-bg);
  border: 1px solid rgba(241,199,107,.5);
  color: var(--warn);
  font-size: var(--fs-sm);
}

.cost-chips{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.cost-chips li{
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.cost-chips b{ color: var(--text); }
.cost-chips .cost{ color: var(--accent-text); font-weight: 700; }


/* ---------- Token-Karte ---------- */
.token-card{ display: flex; flex-direction: column; }
.token-card .codebox{ margin-top: var(--space-2); }
.codebox.is-masked{ letter-spacing: .12em; color: var(--muted); user-select: none; }
.token-card .actions-row{ margin-top: var(--space-3); }
.quick-links{
  margin-top: auto;
  padding-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}


/* ---------- Plan-Vergleich (Overview) ---------- */
.plans__intro{ max-width: 64ch; }
.card .plans__intro{ margin-bottom: 0; }

/* Ribbon kommt jetzt aus dem Markup ("Recommended" / "Your plan") */
.package-card--1::before,
.package-card--pro::before{ content: none; }

.package-card__ribbon{
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.package-card__ribbon--current{
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.package-card__price{
  margin-top: var(--space-3);
  font-size: var(--fs-xl);
  font-weight: 750;
  letter-spacing: -.01em;
}
.package-card__price-note{
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* Nur die wichtigsten Unterschiede, Rest per Button */
.packages-grid:not(.is-expanded) .package-feature--extra{ display: none; }

.plans-more{
  display: flex;
  justify-content: center;
  margin-top: var(--space-4);
}

.card .trust-line{
  margin: var(--space-4) 0 0;
  text-align: center;
  color: var(--faint);
  font-size: var(--fs-xs);
}

/* Aktueller Plan: Button ist reine Statusanzeige */
.package-card .btn:disabled{
  opacity: 1;
  color: var(--muted);
  border-style: dashed;
  background: transparent;
}

@media (max-width: 820px){
  /* Mobil: empfohlener Plan zuerst */
  .package-card--1,
  .package-card--pro{ order: -1; }
}


/* ---------- Billing: Paketkarten ---------- */
.price-layouts{
  color: var(--accent-text);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.termite-packages-toolbar{ margin: var(--space-5) 0 0; }


/* ---------- Toast ---------- */
.toast{
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  transform: translate(-50%, 16px);
  max-width: min(92vw, 420px);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  background: #0B2A22;
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 200;
}
.toast.is-visible{ opacity: 1; transform: translate(-50%, 0); }
.toast--error{ background: #2A1114; border-color: var(--danger-border); }


/* ---------- Schritte (Plugins) ---------- */
.steps{
  list-style: none;
  counter-reset: step;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.steps li{
  counter-increment: step;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--muted);
}
.steps li::before{
  content: counter(step);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.plugin-empty strong{
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text);
  font-size: var(--fs-md);
}
.card .plugin-empty p{ margin: 0 auto var(--space-4); max-width: 48ch; }
.plugin-empty .actions-row{ justify-content: center; margin-top: 0; }


/* ---------- Usage History ---------- */
.stat-row{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.stat{
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.stat__label{ color: var(--muted); font-size: var(--fs-xs); }
.stat__value{
  margin-top: var(--space-1);
  font-size: var(--fs-xl);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.table .amount,
.table th.amount{ text-align: right; }
.amount{ font-weight: 700; }
.table td.amount--plus{ color: var(--accent-text); }
.table td.amount--minus{ color: var(--text); }
.cell-sub{ display: block; color: var(--faint); font-size: var(--fs-xs); }

@media (max-width: 650px){
  .stat-row{ grid-template-columns: 1fr; }

  /* Tabelle als Karten: Spaltenname kommt aus data-label */
  .table--cards{
    display: block;
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .table--cards thead{
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .table--cards tbody,
  .table--cards tr{ display: block; }
  .table--cards tr{
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
  }
  .table--cards td{
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 6px 0;
    border: 0;
    white-space: normal;
    text-align: right;
  }
  .table--cards td::before{
    content: attr(data-label);
    color: var(--faint);
    text-align: left;
  }
  .table--cards tbody tr:nth-child(even) td,
  .table--cards tbody tr:hover td{ background: transparent; }
}


/* ---------- Mobil: Kopfzeilen-Aktionen ---------- */
@media (max-width: 650px){
  .page-header__actions{ width: 100%; justify-content: flex-start; }
  .page-header__actions .account-menu{ margin-left: auto; }
  .account-menu__name{ display: none; }
  .account-menu__btn{ padding-right: var(--space-2); }
}

@media (max-width: 650px){
  .balance-chip__plan{ display: none; }
}

/* Plan-Name ist jetzt eine h3 — Karten-Heading-Stil nicht erben */
.card h3.package-card__name{
  margin: 0;
  font-size: 2rem;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: normal;
}

/* Karte soll trotz :has(#token)-Regel die volle Breite nehmen */
.card.card--full{ grid-column: span 12 !important; }

/* ---------- Hinweise (Konto inaktiv, E-Mail nicht bestätigt) ---------- */
.notice{
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.notice--warn{
  background: var(--warn-bg);
  border-color: rgba(241,199,107,.5);
}
.notice strong{ color: var(--warn); }


/* ---------- Termite-Icon (für Kauf-Buttons und Guthaben) ----------
   Reine CSS-Maske: übernimmt die Textfarbe (currentColor) des Elements.
   .btn-termite  -> Icon links im Button
   .icon-termite -> Icon links vor Text (z.B. Guthaben-Chip)            */
:root{
  --icon-termite: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23000'%3E%3Ccircle cx='4.7' cy='11.6' r='3.9'/%3E%3Cellipse cx='10.5' cy='12' rx='3' ry='4.6'/%3E%3Cellipse cx='16' cy='12' rx='2.9' ry='4.7'/%3E%3Cellipse cx='20.9' cy='12' rx='2.3' ry='3.9'/%3E%3C/g%3E%3Cg fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M3.2 8.2L1.2 4.2'/%3E%3Cpath d='M6.4 7.9L7.4 3.6'/%3E%3Cpath d='M9 16L7.6 20.6'/%3E%3Cpath d='M12.3 16.4L12.4 21.2'/%3E%3Cpath d='M15.4 16.4L17.4 20.6'/%3E%3C/g%3E%3C/svg%3E");
}
.btn-termite::before,
.icon-termite::before{
  content: "";
  flex-shrink: 0;
  width: 1.45em;
  height: 1.45em;
  background-color: currentColor;
  -webkit-mask: var(--icon-termite) center / contain no-repeat;
          mask: var(--icon-termite) center / contain no-repeat;
}
.icon-termite{ display: inline-flex; align-items: center; gap: var(--space-2); }


/* ---------- Mobil-Feinschliff ---------- */
@media (max-width: 650px){
  /* Account-Menü oben rechts neben dem Titel, Chip + Buy-Button darunter in einer Zeile */
  .page-header{ position: relative; }
  .page-header > div:first-child{ padding-right: 64px; }
  .page-header__actions{ position: static; }
  .page-header__actions .account-menu{ position: absolute; top: 0; right: 0; margin-left: 0; }

  /* Kennzahlen kompakt: Label links, Wert rechts */
  .stat{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }
  .stat__value{ margin-top: 0; font-size: var(--fs-lg); }
}


/* =====================================================================
   Auth-Seiten (Sign in / Sign up / Passwort-Reset / Token / Verifizierung)
   ===================================================================== */
.auth-page{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
}

.auth-card{
  width: 100%;
  max-width: 440px;
  padding: var(--space-6) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-brand{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.auth-brand img{ width: 40px; height: 40px; object-fit: contain; }
.auth-brand span{ font-size: var(--fs-lg); font-weight: 700; }

.auth-card h1{
  margin: 0 0 var(--space-2);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -.01em;
  text-align: center;
}
.auth-card .lead{
  margin: 0 0 var(--space-5);
  color: var(--muted);
  text-align: center;
}
.auth-card .auth-email{
  margin: 0 0 var(--space-3);
  text-align: center;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Formularfelder */
.field{ margin: 0 0 var(--space-4); }
.field label{
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]){
  display: block;
  width: 100%;
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-3);
  border: 1px solid #8B95A3;            /* >= 3:1 gegen die Karte */
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.field input::placeholder{ color: var(--faint); }
.field input:focus{
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--focus);
}
.field__hint{
  margin: var(--space-2) 0 0;
  color: var(--faint);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.field__hint ul{ margin: 0; padding-left: 18px; }
.field__error{
  margin: var(--space-2) 0 0;
  color: var(--danger);
  font-size: var(--fs-sm);
}

.btn-lg{ min-height: 52px; font-size: var(--fs-md); }
a.btn{ text-decoration: none; }

.auth-links{
  margin: var(--space-4) 0 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.auth-links--cta{
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* Hinweis-Varianten */
.notice--error{
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.notice--error strong{ color: var(--danger); }
.notice--success{
  background: var(--accent-bg);
  border-color: var(--accent-border);
}
.notice--success strong{ color: var(--accent-text); }
.notice--action{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.notice ul{ margin: var(--space-1) 0 0; padding-left: 18px; }

/* Subscription notice at the top of a portal tab: full row of the card grid */
.grid > .notice{ grid-column: span 12; margin: 0; }

/* Token-Anzeige (beta_token) */
.auth-token{
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.auth-token h2{ margin: 0 0 var(--space-2); font-size: var(--fs-md); }
.auth-token .btn{ margin-top: var(--space-3); }
.auth-token .helper-text{ margin: var(--space-2) 0 0; }

@media (max-width: 480px){
  .auth-card{ padding: var(--space-5) var(--space-4); }
}


/* ---------- Billing: subscription tiers ---------- */
.subscription-card.is-popular{
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border);
}
.subscription-card.is-current{
  border-color: var(--primary);
}
.price-period{
  margin-left: 4px;
  color: var(--muted);
  font-size: .9rem;
}

/* ---------- Billing: custom top-up (subscribers) ---------- */
.top-up-form{
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.top-up-label{
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}
.top-up-row{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.top-up-input{
  width: 140px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
}
.top-up-input:focus{ outline: 2px solid var(--focus); outline-offset: 1px; }
.top-up-price{ color: var(--muted); min-width: 180px; }

/* ---------- Billing: buy mode switch (Pay as you go | Subscription) ---------- */
.buy-mode-switch{
  display: inline-flex;
  gap: 4px;
  margin: 12px 0 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.buy-mode-button{
  padding: 8px 18px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.buy-mode-button:hover{ color: var(--text); }
.buy-mode-button.is-active{ background: var(--primary); color: var(--on-primary); }
.buy-mode-button:focus-visible{ outline: 2px solid var(--focus); outline-offset: 2px; }
