
/* Admin: Inline-Spinner Keyframes (verwendet von components/admin/feedback.tsx) */
@keyframes adm-spin { to { transform: rotate(360deg); } }
/* member.css — Overlay for the AdvoComply member area (React routes). */
/* Depends on /advocomply/styles.css (tokens + fonts). Scoped under .ac-scope. */

.ac-scope {
  font-family: var(--font-body);
  color: var(--text-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-normal);
  background: var(--color-surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  --content-max: 1280px;
}

.ac-scope h1, .ac-scope h2 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-medium);
  color: var(--text-heading);
  line-height: var(--line-height-tight);
  letter-spacing: -0.005em;
}
.ac-scope h1 { font-size: clamp(34px, 4.2vw, var(--font-size-h1)); margin: 0 0 12px; }
.ac-scope h2 { font-size: clamp(28px, 3.2vw, var(--font-size-h2)); margin: 0 0 12px; }
.ac-scope h3 {
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text-subhead);
  font-size: var(--font-size-h3);
  line-height: 1.3;
  margin: 0 0 10px;
}
.ac-scope p { margin: 0 0 12px; }
.ac-scope a { color: var(--text-link); }

/* Source Sans Pro: Hervorhebungen immer nur Semibold (600), nie Bold (700). */
.ac-scope b,
.ac-scope strong { font-weight: 600; }

/* ── Top strip + header ────────────────────────────── */
.ac-topbar {
  background: var(--color-surface);
  font-size: 14px;
}
.ac-topbar-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 9px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.ac-topbar-tag { color: var(--color-primary); font-weight: 400; transition: color .15s ease; }
.ac-topbar-stars { color: #f6a821; letter-spacing: 1px; font-size: 13px; margin-left: 10px; }

/* Pre-Header: identisch zum Website-Pre-Header (Farbe + Hover) */
.ac-topbar a { color: var(--color-primary); transition: color .15s ease; }
.ac-topbar a:hover { color: var(--color-secondary) !important; }
.ac-topbar a.ac-topbar-link { font-weight: 500; }
.ac-topbar a.ac-topbar-link:hover { color: var(--color-secondary) !important; }
/* Administratoren-Link im Admin-Pre-Header: Basis hellblau, Hover dunkelblau */
.ac-topbar a.ac-topbar-admins-link { color: var(--color-secondary); }
.ac-topbar a.ac-topbar-admins-link:hover { color: var(--color-primary) !important; }
.ac-topbar button { transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.ac-topbar button:hover { background: var(--color-primary) !important; border-color: var(--color-primary) !important; color: #fff !important; box-shadow: var(--shadow-md); }

.ac-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
}
.ac-header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
}
.ac-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  background: transparent; border: 0; padding: 0;
}
.ac-brand img {
  height: 46px; width: auto; display: block;
  background: transparent; border: 0; box-shadow: none;
}
.ac-brand-divider {
  display: block; width: 1px; height: 32px;
  background: var(--color-border);
  margin: 0 6px;
}
.ac-brand-label {
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  font-size: 17px;
  letter-spacing: 0.02em;
}
.ac-nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.ac-nav-wrap { display: contents; }
.ac-nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.ac-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.ac-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ac-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ac-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.ac-nav a {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  color: var(--color-primary);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.ac-nav a:hover, .ac-nav a.is-active {
  color: var(--color-secondary);
  border-bottom-color: var(--color-secondary);
}
.ac-header-meta { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--text-muted); }
.ac-topbar .ac-header-meta,
.ac-topbar .ac-header-meta a,
.ac-topbar .ac-header-meta span { font-size: 14px; }
.ac-back { color: var(--text-muted); text-decoration: none; font-size: 15px; }
.ac-back:hover { color: var(--color-secondary); }

/* ── Main container ────────────────────────────────── */
.ac-main {
  flex: 1;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: 56px 40px 80px;
}

/* ── Cards ─────────────────────────────────────────── */
.ac-card {
  background: var(--surface-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.ac-card + .ac-card, .ac-section + .ac-section { margin-top: 24px; }

/* Tile cards (Ressourcen, Blog, Dashboard) — 1:1 zur Website-Card `elevated`.
   Die Website-Card hat keinen Hover-/Active-Effekt; nur Fokus-Ring für a11y. */
.ac-tile {
  box-shadow: var(--shadow-md);
  transition: none;
  outline: none;
}
.ac-tile:hover,
.ac-tile:active { box-shadow: var(--shadow-md); transform: none; }
.ac-tile:focus { outline: none; }
.ac-tile:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
}
.ac-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
section > h2 + .ac-grid { margin-top: 24px; }

/* ── Checkboxes ────────────────────────────────────── */
.ac-scope .ac-check {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid #c9ced8;
  border-radius: 4px;
  background: #fff;
  display: inline-block;
  position: relative;
  cursor: pointer;
  flex: 0 0 18px;
  vertical-align: middle;
  margin-right: 8px;
  transition: border-color .15s ease, background-color .15s ease;
}
.ac-scope .ac-check:hover { border-color: #009fe3; }
.ac-scope .ac-check:focus-visible {
  outline: 2px solid #009fe3;
  outline-offset: 2px;
}
.ac-scope .ac-check:checked {
  background: #009fe3;
  border-color: #009fe3;
}
.ac-scope .ac-check:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
@media (max-width: 600px) {
  .ac-grid { grid-template-columns: 1fr; }
}
.ac-muted { color: var(--text-muted); }

/* ── Buttons ───────────────────────────────────────── */
.ac-btn, .ac-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body);
  font-weight: var(--font-weight-regular);
  font-size: 15px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  line-height: 1;
}
.ac-btn, a.ac-btn, .ac-scope a.ac-btn {
  background: var(--color-secondary);
  color: #fff;
}
.ac-btn:hover, a.ac-btn:hover, .ac-scope a.ac-btn:hover { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-md); }
.ac-btn-ghost, a.ac-btn-ghost, .ac-scope a.ac-btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.ac-btn-ghost:hover, a.ac-btn-ghost:hover, .ac-scope a.ac-btn-ghost:hover {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-inverse);
}
.ac-btn[disabled], .ac-btn-ghost[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.ac-btn-sm { font-size: 13px; padding: 7px 14px; }

/* ── Inputs ────────────────────────────────────────── */
.ac-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  background: #fff;
  color: var(--color-primary);
  transition: border-color .15s, box-shadow .15s;
}
.ac-input:focus { outline: none; border-color: var(--color-secondary); box-shadow: var(--focus-ring); }
.ac-label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--color-primary); }

/* ── Status pills ──────────────────────────────────── */
.ac-pill-success {
  display: inline-block; padding: 6px 12px; border-radius: var(--radius-pill);
  background: rgba(0,159,227,.10); color: var(--color-primary);
  font-size: 13px; font-weight: 600;
}
.ac-note-error { color: var(--color-error); font-size: 14px; }
.ac-note-ok { color: var(--color-primary); font-size: 14px; }
.ac-note-info { color: var(--color-primary); background: #eaf6fc; border: 1px solid #cbeaf8; border-radius: 4px; padding: 10px 14px; font-size: 14px; }

/* ── Footer ────────────────────────────────────────── */
.ac-footer {
  background: var(--color-primary);
  color: var(--text-on-primary);
  margin-top: auto;
}
.ac-footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 40px 28px;
  display: grid; gap: 24px;
  grid-template-columns: 2fr 1fr;
  align-items: start;
}
.ac-footer img { height: 46px; width: 221px; display: block; }
.ac-footer-brand-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.ac-footer-brand-divider {
  display: block; width: 1px; height: 32px;
  background: rgba(255,255,255,.35);
}
.ac-footer-brand-label {
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  color: #fff;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.ac-footer-links { display: flex; flex-wrap: nowrap; gap: 18px; justify-content: flex-end; align-items: center; min-height: 46px; font-size: 16px; white-space: nowrap; }
.ac-footer-links, .ac-footer-links span { color: #fff; }
.ac-footer-links a { color: #fff; text-decoration: none; }
.ac-clamp-3 { display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; max-height: calc(1.6em * 3); }
.ac-footer-links a,
.ac-footer-links a:link,
.ac-footer-links a:visited { color: #fff; text-decoration: none; }
.ac-footer-links a:hover,
.ac-footer-links a:focus { color: #009fe3 !important; }
.ac-footer-bar {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 18px 40px 24px;
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: 14px; color: var(--text-on-primary);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

@media (max-width: 720px) {
  .ac-header-inner, .ac-main, .ac-topbar-inner, .ac-footer-inner, .ac-footer-bar { padding-left: 20px; padding-right: 20px; }
  /* Header bleibt beim Scrollen dauerhaft am oberen Rand sichtbar. */
  .ac-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .ac-footer-inner { grid-template-columns: 1fr; }
  .ac-footer-links {
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    white-space: normal;
    gap: 10px;
    min-height: 0;
  }
  .ac-footer-bar { flex-direction: column; align-items: flex-start; }
  .ac-brand { justify-content: flex-start; }
  .ac-brand img { height: 38px; }
  .ac-brand-divider { height: 26px; }
  .ac-brand-label { font-size: 15px; }
  /* Topbar: keep left link on one row, right meta wraps below */
  .ac-topbar-inner { gap: 8px 16px; row-gap: 8px; }
  .ac-header-meta { font-size: 14px; flex-wrap: wrap; gap: 8px; max-width: 100%; }
  .ac-header-meta > span { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
  /* Main content vertical rhythm */
  .ac-main { padding-top: 32px; padding-bottom: 56px; }
  .ac-hero { grid-template-columns: 1fr !important; }
  /* Any two-column grid gracefully collapses on phones */
  .ac-grid-2 { grid-template-columns: 1fr !important; }
  /* Admin tables become horizontally scrollable inside their container */
  .ac-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ac-container table { min-width: 640px; }
}

/* ── Hamburger für Tablet & Smartphone (≤1024px) ─────── */
@media (max-width: 1024px) {
  .ac-topbar { display: none; }
  .ac-header-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    position: relative;
  }
  .ac-nav-toggle { display: inline-flex; margin-left: auto; }
  .ac-nav-wrap,
  .ac-header-inner > .ac-nav {
    display: none;
    flex-basis: 100%;
    width: 100%;
    order: 3;
  }
  .ac-nav-wrap.is-open { display: block; }
  .ac-header-inner > .ac-nav.is-open { display: flex; }
  .ac-nav-wrap .ac-nav,
  .ac-header-inner > .ac-nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 4px;
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
  }
  .ac-nav-wrap .ac-nav a,
  .ac-header-inner > .ac-nav.is-open a {
    display: block;
    padding: 12px 4px;
    border-bottom: 1px solid transparent;
    border-top: 0;
    font-size: 16px;
  }
  .ac-nav-wrap .ac-nav a + a,
  .ac-header-inner > .ac-nav.is-open a + a { border-top: 1px solid rgba(0,0,0,0.05); }
  .ac-nav-wrap .ac-nav a:hover,
  .ac-nav-wrap .ac-nav a.is-active,
  .ac-header-inner > .ac-nav.is-open a:hover,
  .ac-header-inner > .ac-nav.is-open a.is-active {
    border-bottom-color: transparent;
    color: var(--color-secondary);
  }
  .ac-nav-meta {
    display: block;
    padding: 12px 4px;
    font-size: 14px;
    color: #64748b;
    border-top: 1px solid rgba(0,0,0,0.05);
  }
}

/* Mobile-only nav extras: hidden on desktop, shown inside hamburger menu on <=1024 */
.ac-nav-mobile-only { display: none; }
@media (max-width: 1024px) {
  .ac-nav-wrap .ac-nav .ac-nav-mobile-only,
  .ac-header-inner > .ac-nav.is-open .ac-nav-mobile-only { display: block; }
}

/* Academy hero: compact layout on tablet/mobile (kicker + lede hidden, image beside H1) */
@media (max-width: 1024px) {
  .ac-hero .ac-hero-kicker,
  .ac-hero .ac-hero-lede { display: none !important; }
  .ac-hero { gap: 16px !important; min-height: 0 !important; align-items: center !important; grid-template-columns: minmax(0,1fr) auto !important; }
  .ac-hero h1 { font-size: 44px !important; line-height: 1.1 !important; word-spacing: 100vw; }
  .ac-hero img { width: 140px !important; height: 120px !important; }
}
@media (max-width: 480px) {
  .ac-hero { gap: 12px !important; }
  .ac-hero h1 { font-size: 34px !important; }
  .ac-hero img { width: 110px !important; height: 96px !important; }
}

@media (max-width: 480px) {
  .ac-header-inner, .ac-main, .ac-topbar-inner, .ac-footer-inner, .ac-footer-bar {
    padding-left: 16px; padding-right: 16px;
  }
  .ac-scope h1 { font-size: 30px; }
  .ac-scope h2 { font-size: 24px; }
  .ac-brand img { height: 34px; }
  .ac-brand-label { font-size: 14px; }
  .ac-nav { gap: 14px; }
  .ac-nav a { font-size: 14px; }
  .ac-btn, .ac-btn-ghost { padding: 10px 18px; font-size: 14px; }
}

/* ── Progress bar ──────────────────────────────────── */
.ac-progress { background: var(--color-border); height: 6px; border-radius: var(--radius-pill); overflow: hidden; }
.ac-progress > span { display: block; height: 100%; background: var(--color-secondary); transition: width .3s ease; }

/* ── Quiz option ───────────────────────────────────── */
.ac-option {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.ac-option:hover { border-color: var(--color-secondary); }
.ac-option.is-selected { border-color: var(--color-secondary); background: rgba(0,159,227,.06); }

/* ── Badges ────────────────────────────────────────── */
.ac-badge, .ac-badge-success {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--color-surface); color: var(--text-subhead);
  border: 1px solid var(--color-border);
}
.ac-badge-success { background: rgba(0,159,227,.1); color: var(--color-secondary); border-color: rgba(0,159,227,.25); }
/* Admin buttons — hover states matching design system */
.ac-scope .adm-btn { transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.ac-scope .adm-btn:hover { background: var(--color-primary) !important; color: var(--color-inverse) !important; }
.ac-scope .adm-btn.adm-dark:hover { background: var(--color-secondary) !important; color: var(--color-inverse) !important; }
.ac-scope .adm-btn.adm-danger:hover { background: var(--color-critical) !important; color: var(--color-inverse) !important; }
.ac-scope .adm-btn.adm-ghost:hover { background: var(--color-secondary) !important; color: var(--color-inverse) !important; }
.ac-scope .adm-btn[disabled]:hover { background: inherit !important; }
.ac-scope .adm-row-link { transition: color .18s ease; }
.ac-scope .adm-row-link:hover { color: #009fe3 !important; }

/* Admin Bildvorschau — spiegelt Live-Crop und Hover/Focus der Kacheln */
.adm-photo-preview {
  display: block;
  padding: 0;
  border: 1px solid #dde;
  background: #fff;
  overflow: hidden;
  cursor: default;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  outline: none;
}
.adm-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.adm-photo-preview.is-landscape {
  /* Live-Kachel: höhe fix 210, Breite = Zellbreite des ac-grid.
     Desktop/Tablet: 2-Spalten-Grid im ~1180er Content → ≈ 576×210.
     Mobile ≤600: 1-Spalten-Grid → Viewport-Breite × 210.
     Damit hat die Vorschau bei jedem Breakpoint exakt den gleichen
     object-fit-Crop wie das Live-Kachelbild. */
  /* Kompakte Vorschau, gleiches Seitenverhältnis wie die Live-Kachel
     (Zelle im 2-Spalten-Grid ≈ 576×210). object-fit:cover ergibt damit
     denselben Bildausschnitt wie live. */
  width: 100%;
  max-width: 320px;
  aspect-ratio: 576 / 210;
  height: auto;
  border-radius: 4px;
}
@media (max-width: 600px) {
  .adm-photo-preview.is-landscape {
    /* Mobile Live-Kachel ≈ Viewport-Breite × 210 (≈ 386/210). */
    max-width: 260px;
    aspect-ratio: 386 / 210;
  }
}
.adm-photo-preview.is-round {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}
.adm-photo-preview:hover,
.adm-photo-preview:focus-visible {
  border-color: #009fe3;
  box-shadow: 0 10px 24px rgba(32,48,89,.12);
  transform: translateY(-2px);
}
.adm-photo-preview:focus-visible {
  outline: 2px solid #009fe3;
  outline-offset: 2px;
}

/* Footer Rechtliches – Desktop: inline Links, Mobile: Akkordeon */
.ac-footer-legal { display: contents; }
.ac-footer-legal-toggle { display: none; }
.ac-footer-legal-panel {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.ac-footer-legal-panel a {
  color: #fff;
  text-decoration: none;
}
.ac-footer-legal-panel a:hover { color: #009fe3; }
@media (max-width: 1024px) {
  .ac-footer-legal {
    display: block;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 12px;
    padding-top: 12px;
  }
  .ac-footer-legal-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 12px 0;
    color: #fff;
    font: 600 15px/1.2 "Source Sans Pro", system-ui, sans-serif;
    cursor: pointer;
    min-height: 44px;
  }
  .ac-footer-legal-caret {
    transition: transform 0.2s ease;
    font-size: 14px;
  }
  .ac-footer-legal.is-open .ac-footer-legal-caret {
    transform: rotate(180deg);
  }
  .ac-footer-legal-panel {
    display: none;
    flex-direction: column;
    gap: 0;
    padding-bottom: 8px;
  }
  .ac-footer-legal.is-open .ac-footer-legal-panel {
    display: flex;
  }
  .ac-footer-legal-panel a {
    padding: 12px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    line-height: 1.4;
  }
}
