/* CertFlow Kundenbereich — geteilte Styles für alle vier Seiten.
   Baut auf den Tokens aus style.css auf (Farben, --ease-out, --radius …).
   Bewusst getrennt, damit style.css (auf allen Seiten gecacht) unangetastet bleibt. */

/* Zwei Top-Navigationen (öffentlich / Kundenbereich) je nach Login umgeschaltet.
   Das hidden-Attribut allein reicht nicht: die .nav-links-Regeln (display:flex /
   #nav.open … display:grid) würden es überschreiben. Deshalb !important. */
#nav .nav-links[hidden] { display: none !important; }
/* Dezenter Trenner zwischen Website-Seiten und Kundenbereich-Sektionen. */
.nav-sep { flex: none; width: 1px; height: 1.1rem; align-self: center; margin: 0 0.4rem; background: var(--faint); }
#nav.open .nav-sep { display: none; }

/* --- Sekundär-Navigation (Segmented Control) ------------------------------ */
.cust-nav {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface); border-radius: 999px;
  max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cust-nav::-webkit-scrollbar { display: none; }
.cust-nav a {
  flex: none; padding: 0.55rem 1.15rem; border-radius: 999px;
  font-size: 0.92rem; font-weight: 540; color: var(--muted);
  text-decoration: none; white-space: nowrap; min-height: 40px;
  display: inline-flex; align-items: center; gap: 0.45rem;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.cust-nav a svg { width: 16px; height: 16px; }
.cust-nav a:hover { color: var(--ink); text-decoration: none; }
.cust-nav a[aria-current="page"] {
  background: #fff; color: var(--brand-strong);
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.06), 0 2px 8px rgba(20, 40, 60, 0.06);
}
.cust-nav a:active { transform: scale(0.97); }

/* --- Seitenkopf (klärt die fixierte Haupt-Navi) --------------------------- */
.cust-head { padding-top: clamp(6.5rem, 12vh, 8.5rem); padding-bottom: 1.6rem; }
.cust-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.025em; line-height: 1.05; }
.cust-head .lede { margin: 0.9rem 0 1.6rem; color: var(--muted); font-size: 1.08rem; max-width: 48rem; }

/* --- Lizenzkarte ---------------------------------------------------------- */
.lic-card {
  background: #fff; border: 1px solid var(--faint); border-radius: var(--radius);
  padding: 1.5rem 1.6rem; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.2rem 1.6rem;
}
.lic-kv .k { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.lic-kv .val { font-size: 1.05rem; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.lic-kv .val.mono { font-family: var(--mono); font-size: 0.9rem; }
.lic-badge { display: inline-block; padding: 0.18rem 0.7rem; border-radius: 99px; font-size: 0.8rem; font-weight: 560; }
.lic-badge.ok   { background: color-mix(in oklch, var(--ok) 14%, white); color: var(--ok); }
.lic-badge.warn { background: color-mix(in oklch, var(--warn) 18%, white); color: color-mix(in oklch, var(--warn) 80%, black); }
.lic-badge.crit { background: color-mix(in oklch, var(--danger) 12%, white); color: var(--danger); }
.lic-verified { font-size: 0.82rem; color: var(--ok); margin-top: 0.9rem; }
.lic-error { color: var(--danger); font-size: 0.9rem; margin-top: 0.9rem; }

.portal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.logout-wrap { flex: none; text-align: right; }
.logout-note { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; }

/* --- Navigations-Kacheln (Übersicht) -------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.tile {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: #fff; border: 1px solid var(--faint); border-radius: var(--radius);
  padding: 1.5rem; text-decoration: none; color: inherit;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.tile .tile-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-strong); margin-bottom: 0.3rem;
}
.tile .tile-icon svg { width: 20px; height: 20px; }
.tile h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 0.4rem; }
.tile p { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.tile .tile-go { margin-top: auto; color: var(--brand); font-size: 0.88rem; font-weight: 560; padding-top: 0.6rem; }
.tile:hover { text-decoration: none; }
.tile:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 10px 26px -14px rgba(20, 40, 60, 0.25); }
}

/* --- Doku: klebrige Seitenleiste + Inhalt --------------------------------- */
.docs { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; align-items: start; }
.docs-nav { position: sticky; top: 5.5rem; align-self: start; }
.docs-nav .docs-nav-title { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.7rem; padding-left: 0.9rem; }
.docs-nav a {
  display: block; padding: 0.42rem 0 0.42rem 0.9rem; font-size: 0.9rem; color: var(--muted);
  text-decoration: none; border-left: 2px solid var(--faint); line-height: 1.35;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.docs-nav a:hover { color: var(--ink); text-decoration: none; }
.docs-nav a.active { color: var(--brand-strong); border-left-color: var(--brand); font-weight: 560; }

.docs-section { scroll-margin-top: 5.5rem; }
.docs-section + .docs-section { margin-top: 3.2rem; }
.docs-section h2 { font-size: 1.6rem; letter-spacing: -0.02em; }
.docs-section h3 { font-size: 1.08rem; margin-top: 1.6rem; }
.docs-section p { color: var(--muted); line-height: 1.65; margin-top: 0.8rem; max-width: 44rem; }
.docs-section ul, .docs-section ol { color: var(--muted); line-height: 1.65; margin-top: 0.8rem; padding-left: 1.2rem; max-width: 44rem; }
.docs-section li { margin-top: 0.35rem; }
.docs-section li::marker { color: var(--brand); }
.docs-section code { font-family: var(--mono); font-size: 0.85em; background: var(--surface); padding: 0.1rem 0.4rem; border-radius: 5px; }
.docs-section strong { color: var(--ink); font-weight: 570; }

@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: 1.5rem; }
  .docs-nav { position: static; }
  .docs-nav ul { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.4rem; scrollbar-width: none; }
  .docs-nav a { border-left: none; border: 1px solid var(--faint); border-radius: 999px; padding: 0.4rem 0.9rem; white-space: nowrap; }
  .docs-nav a.active { border-color: var(--brand); }
  .docs-nav .docs-nav-title { display: none; }
}

/* --- Code-Block mit Kopier-Knopf ------------------------------------------ */
.code-wrap { position: relative; margin-top: 1rem; max-width: 44rem; }
.code {
  background: var(--deep); color: var(--deep-ink); font-family: var(--mono);
  font-size: 0.82rem; line-height: 1.6; border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; overflow-x: auto; white-space: pre;
}
.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08);
  color: var(--deep-ink); font: inherit; font-size: 0.74rem; padding: 0.25rem 0.6rem;
  border-radius: 6px; cursor: pointer; transition: background 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.16); }
.copy-btn:active { transform: scale(0.96); }

/* --- Callouts ------------------------------------------------------------- */
.callout { border-radius: var(--radius-sm); padding: 0.95rem 1.15rem; font-size: 0.92rem; line-height: 1.6; margin-top: 1.1rem; max-width: 44rem; border: 1px solid transparent; }
.callout strong { font-weight: 600; }
.callout.info { background: var(--brand-tint); color: var(--brand-strong); }
.callout.warn { background: color-mix(in oklch, var(--warn) 14%, white); color: color-mix(in oklch, var(--warn) 82%, black); }
.callout.danger { background: color-mix(in oklch, var(--danger) 9%, white); color: var(--danger); }
.callout code { background: rgba(255,255,255,0.5); }

/* --- Rollen-/Ports-Tabelle ------------------------------------------------ */
.docs-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.9rem; max-width: 44rem; }
.docs-table th, .docs-table td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--faint); vertical-align: top; }
.docs-table th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.docs-table td { color: var(--muted); line-height: 1.5; }
.docs-table code { font-family: var(--mono); font-size: 0.85em; background: var(--surface); padding: 0.1rem 0.35rem; border-radius: 5px; }

/* --- Nummerierte Schritte ------------------------------------------------- */
.steps { counter-reset: step; max-width: 44rem; margin-top: 1.2rem; display: grid; gap: 1rem; }
.steps li {
  list-style: none; display: grid; grid-template-columns: 1.9rem 1fr; gap: 0.9rem;
  align-items: start; color: var(--muted); font-size: 0.97rem; line-height: 1.55;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--brand-tint);
  color: var(--brand-strong); font-size: 0.9rem; font-weight: 600; font-family: var(--mono);
  display: grid; place-items: center;
}
.steps strong { color: var(--ink); font-weight: 570; }
.steps code { font-family: var(--mono); font-size: 0.86em; background: var(--surface); padding: 0.1rem 0.4rem; border-radius: 5px; }

/* --- Support -------------------------------------------------------------- */
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin-top: 1.6rem; }
.support-card { background: #fff; border: 1px solid var(--faint); border-radius: var(--radius); padding: 1.4rem; }
.support-card h3 { font-size: 1.02rem; }
.support-card p, .support-card li { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.support-card ul { margin-top: 0.6rem; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.support-card a { color: var(--brand); font-weight: 540; }
.support-note { margin-top: 1.2rem; font-size: 0.88rem; color: var(--muted); }
.support-note strong { color: var(--danger); }

/* --- Login-Textarea ------------------------------------------------------- */
#lic-form textarea { font-family: var(--mono); font-size: 0.85rem; min-height: 5.5rem; }
