/* BAFA-Berichtspruefer — ContentForge Style
 * Frontend-CSS (Dark-only, DSGVO-konform, alles lokal gehostet).
 *
 * Inter Font Family — SIL Open Font License 1.1 (rsms.me/inter)
 * Bundled locally to comply with DSGVO; no external requests.
 */

/* ----------------------------------------------------------------------
 * Webfonts (lokal, kein Google-Fonts-CDN!)
 * ---------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/static/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/static/fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/static/fonts/Inter-Bold.woff2') format('woff2');
}

/* ----------------------------------------------------------------------
 * Design-Tokens (ContentForge / BMW-M-Style: Pure-Black + Lime-Green)
 * ---------------------------------------------------------------------- */
:root {
  /* Backgrounds — Pure Black */
  --bg-base:     #000000;
  --bg-surface:  #0A0A0A;
  --bg-elevated: #141414;
  --bg-hover:    #1F1F1F;

  /* Accent — Lime-Green (BMW-M-Akzent, workspace-themable) */
  --workspace-accent: #BFFF00;
  --accent-primary:   #BFFF00;
  --accent-secondary: #FFFFFF;             /* M-Stripe White */
  --accent-tertiary:  #2A2A2A;             /* M-Stripe Dark */
  --accent-glow:      rgba(191, 255, 0, 0.4);

  /* Text */
  --text-primary:   #FFFFFF;
  --text-secondary: #9CA3AF;
  --text-muted:     #4B5563;

  /* Status (Ampel + Score-Badges) */
  --status-success: #BFFF00;   /* Grün = Lime */
  --status-warning: #F59E0B;
  --status-error:   #EF4444;
  --status-info:    #FFFFFF;

  /* Borders */
  --border-subtle:  #1F1F1F;
  --border-default: #2A2A2A;
  --border-strong:  #3A3A3A;

  /* Radius — BMW-M nutzt scharfe Ecken; wir bleiben minimal-rund */
  --radius-card: 4px;
  --radius-btn:  0px;

  /* Shadows */
  --shadow-glow:   0 0 20px var(--accent-glow);
  --shadow-card:   0 4px 12px rgba(0, 0, 0, 0.6);

  /* Typography */
  --font-display: 'Inter', 'Inter Display', system-ui, sans-serif;
}

/* ----------------------------------------------------------------------
 * Reset + Base
 * ---------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 200ms ease;
}
a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent-primary);
  margin-bottom: 16px;
}
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

p {
  margin-bottom: 12px;
  color: var(--text-primary);
}

strong, b {
  color: var(--accent-primary);
  font-weight: 700;
}

small {
  color: var(--text-secondary);
  font-size: 14px;
}

code {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--accent-primary);
}

pre {
  background: var(--bg-elevated);
  padding: 16px;
  border-radius: var(--radius-btn);
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border-subtle);
}
pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
}

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 24px 0;
}

::selection {
  background: var(--accent-primary);
  color: #000000;
}

/* ----------------------------------------------------------------------
 * Layout: container, header, footer
 * ---------------------------------------------------------------------- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}
.header-brand:hover {
  text-decoration: none;
  color: var(--text-primary);
}

.logo-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.header-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}
.header-nav a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.footer {
  color: var(--text-secondary);
  padding: 24px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 14px;
  text-align: center;
  margin-top: 48px;
}
.footer a {
  color: var(--text-secondary);
}
.footer a:hover {
  color: var(--accent-primary);
}

/* ----------------------------------------------------------------------
 * Cards
 * ---------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 24px;
  margin: 16px 0;
  transition: background 200ms ease, border-color 200ms ease;
}
.card.is-hoverable:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}
.card.is-elevated {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
}

/* ----------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 16px;
  font-family: inherit;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
  line-height: 1.2;
  user-select: none;
}
.btn:disabled,
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #000000;
  border-color: transparent;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  filter: brightness(0.92);
  transform: translateY(-2px);
  text-decoration: none;
  color: #000000;
}

.btn-secondary {
  background: transparent;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.btn-secondary:hover {
  background: var(--accent-glow);
  text-decoration: none;
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--status-error);
  color: #F8F8FF;
  border-color: transparent;
}
.btn-danger:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  text-decoration: none;
  color: #F8F8FF;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-lg { padding: 16px 32px; font-size: 18px; }

/* ----------------------------------------------------------------------
 * Form Controls
 * ---------------------------------------------------------------------- */
.label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  background: var(--bg-base);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%239CA3AF' d='M6 9L1 4h10z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.form-row > * {
  flex: 1 1 200px;
}

.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
}
.checkbox input[type="checkbox"],
.radio input[type="radio"] {
  accent-color: var(--accent-primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ----------------------------------------------------------------------
 * Badges & Pills
 * ---------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.badge-success { background: var(--accent-primary); color: #000000; }
.badge-warning { background: var(--status-warning); color: #1A1A24; }
.badge-error   { background: var(--status-error);   color: #F8F8FF; }
.badge-info    {
  background: var(--accent-primary);
  color: #000000;
  border: 1px solid var(--accent-primary);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 4px 12px;
}
.badge-neutral {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  font-weight: 700;
  padding: 3px 11px;
}
.badge-muted   { background: var(--bg-elevated);    color: var(--text-secondary); }

/* Score-Pills (1..10) */
.score-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 14px;
  min-width: 44px;
  text-align: center;
  color: #FFFFFF;
  line-height: 1.4;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.score-pill.score-1,
.score-pill.score-2,
.score-pill.score-3 {
  background: var(--status-error);
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}
.score-pill.score-4,
.score-pill.score-5,
.score-pill.score-6 {
  background: var(--status-warning);
  color: #000000;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.score-pill.score-7,
.score-pill.score-8,
.score-pill.score-9,
.score-pill.score-10 {
  background: var(--status-success);
  color: #000000;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ----------------------------------------------------------------------
 * Ampel-Banner
 * ---------------------------------------------------------------------- */
.ampel-banner {
  border-radius: var(--radius-card);
  padding: 32px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  border: 1px solid var(--border-subtle);
}
.ampel-banner .ampel-icon {
  font-size: 56px;
  line-height: 1;
}
.ampel-banner .ampel-body {
  flex: 1 1 300px;
}
.ampel-banner .ampel-status {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ampel-banner .ampel-empfehlung {
  font-size: 16px;
  color: var(--text-primary);
  opacity: 0.9;
}

.ampel-gruen {
  background: rgba(191, 255, 0, 0.12);
  border-color: var(--status-success);
  box-shadow: 0 0 24px rgba(191, 255, 0, 0.25);
}
.ampel-gruen .ampel-status { color: var(--status-success); }

.ampel-gelb {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--status-warning);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
}
.ampel-gelb .ampel-status { color: var(--status-warning); }

.ampel-rot {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--status-error);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.2);
}
.ampel-rot .ampel-status { color: var(--status-error); }

/* ----------------------------------------------------------------------
 * Tables
 * ---------------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  overflow: hidden;
}
.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.table th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table-striped tbody tr:nth-child(even) {
  background: var(--bg-elevated);
}
.table tbody tr:hover {
  background: var(--bg-hover);
}

/* ----------------------------------------------------------------------
 * Flash / Alert
 * ---------------------------------------------------------------------- */
.flash {
  padding: 16px;
  border-radius: var(--radius-btn);
  margin: 16px 0;
  border-left: 4px solid var(--status-info);
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
}
.flash-info {
  border-left-color: var(--status-info);
  background: rgba(59, 130, 246, 0.1);
}
.flash-success {
  border-left-color: var(--status-success);
  background: rgba(16, 185, 129, 0.1);
}
.flash-error {
  border-left-color: var(--status-error);
  background: rgba(239, 68, 68, 0.1);
}
.flash-warning {
  border-left-color: var(--status-warning);
  background: rgba(245, 158, 11, 0.1);
}

/* ----------------------------------------------------------------------
 * Meta-Grid (2 col desktop, 1 col mobile)
 * ---------------------------------------------------------------------- */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.meta-grid .meta-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}
.meta-grid .meta-value {
  color: var(--text-primary);
  font-size: 16px;
}

/* ----------------------------------------------------------------------
 * Drag-and-Drop Upload Zone
 * ---------------------------------------------------------------------- */
.upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-card);
  padding: 48px 24px;
  text-align: center;
  transition: border-color 200ms ease, background 200ms ease;
  cursor: pointer;
  background: var(--bg-surface);
}
.upload-zone:hover,
.upload-zone:focus-within {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}
.upload-zone.dragover {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 24px var(--accent-glow);
}
.upload-zone .upload-icon {
  font-size: 40px;
  color: var(--accent-primary);
  margin-bottom: 12px;
}
.upload-zone .upload-text {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 8px;
}
.upload-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ----------------------------------------------------------------------
 * Loading / Spinner (Skill-Aufruf läuft)
 * ---------------------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------------
 * Utility classes
 * ---------------------------------------------------------------------- */
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-success   { color: var(--status-success); }
.text-warning   { color: var(--status-warning); }
.text-error     { color: var(--status-error); }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ----------------------------------------------------------------------
 * Responsive (Mobile)
 * ---------------------------------------------------------------------- */
@media (max-width: 640px) {
  .container       { padding: 16px; }
  .header-inner    { padding: 0 16px; }
  .header-nav      { gap: 12px; }
  .header-nav a    { font-size: 13px; }
  h1               { font-size: 26px; }
  h2               { font-size: 20px; }
  .card            { padding: 16px; }
  .ampel-banner    { padding: 20px; }
  .ampel-banner .ampel-icon { font-size: 40px; }
  .ampel-banner .ampel-status { font-size: 20px; }
  .meta-grid       { grid-template-columns: 1fr; }
  .upload-zone     { padding: 32px 16px; }
  .form-row        { flex-direction: column; gap: 0; }
}

/* ----------------------------------------------------------------------
 * Print-Styles (Browser-Print, NICHT WeasyPrint!)
 * ---------------------------------------------------------------------- */
@media print {
  .header,
  .footer,
  .btn,
  .upload-zone {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  .card {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* ----------------------------------------------------------------------
 * Loading-Overlay (global, per JS aktiviert)
 * ---------------------------------------------------------------------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.loading-overlay[data-active="1"] {
  display: flex;
}
.loading-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent-primary);
  padding: 32px 40px;
  max-width: 460px;
  width: calc(100% - 48px);
  text-align: center;
  box-shadow: var(--shadow-glow);
}
.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: loading-spin 0.9s linear infinite;
}
@keyframes loading-spin {
  to { transform: rotate(360deg); }
}
.loading-title {
  color: var(--accent-primary);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.loading-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 20px;
}
.loading-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.loading-steps li {
  padding: 6px 0 6px 24px;
  position: relative;
}
.loading-steps li::before {
  content: "○";
  position: absolute;
  left: 4px;
  color: var(--text-muted);
}
.loading-steps li.is-active {
  color: var(--text-primary);
}
.loading-steps li.is-active::before {
  content: "●";
  color: var(--accent-primary);
  animation: loading-pulse 1.2s ease-in-out infinite;
}
.loading-steps li.is-done {
  color: var(--text-secondary);
}
.loading-steps li.is-done::before {
  content: "✓";
  color: var(--accent-primary);
}
@keyframes loading-pulse {
  50% { opacity: 0.4; }
}
.loading-hint {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
@media print {
  .loading-overlay { display: none !important; }
}

/* ----------------------------------------------------------------------
 * Hero / Content-Container-Feinschliff
 * ---------------------------------------------------------------------- */
.hero {
  padding: 48px 0 32px;
  border-left: 3px solid var(--accent-primary);
  padding-left: 24px;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--accent-primary);
  text-shadow: 0 0 24px var(--accent-glow);
}
.hero .card-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin: 0;
}

.card-body { padding: 28px 32px; }
.card-header {
  padding: 20px 32px 0;
}
.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-primary);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-title-sm {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
  margin: 0 0 8px;
}
.card-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 12px;
}
.card-compact .card-body { padding: 20px 24px; }

/* ----------------------------------------------------------------------
 * Formularfelder — BMW-M-Style
 * ---------------------------------------------------------------------- */
.field {
  margin-bottom: 22px;
}
.field-checkbox { margin-bottom: 14px; }
.field-hint {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85em;
  margin-left: 4px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 10px;
}
.label-required::after {
  content: "*";
  color: var(--accent-primary);
  margin-left: 4px;
}
.label-required-mark { color: var(--accent-primary); }
.label-inline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
}
.label-inline > span { padding-top: 1px; }
.label-inline .field-hint { display: block; margin: 2px 0 0; }

/* ----------------------------------------------------------------------
 * Custom Checkbox / Radio (Lime-Accent)
 * ---------------------------------------------------------------------- */
.checkbox,
.radio,
.label-inline input[type="checkbox"],
.label-inline input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--border-strong);
  background: var(--bg-base);
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  margin: 0;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.checkbox,
.label-inline input[type="checkbox"] {
  border-radius: 2px;
}
.radio,
.label-inline input[type="radio"] {
  border-radius: 50%;
}
.checkbox:hover,
.radio:hover,
.label-inline input[type="checkbox"]:hover,
.label-inline input[type="radio"]:hover {
  border-color: var(--accent-primary);
}
.checkbox:checked,
.label-inline input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
.checkbox:checked::after,
.label-inline input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 11px;
  border: solid #000;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.radio:checked,
.label-inline input[type="radio"]:checked {
  border-color: var(--accent-primary);
}
.radio:checked::after,
.label-inline input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-glow);
}
.checkbox:focus-visible,
.radio:focus-visible,
.label-inline input:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------------
 * Fieldset für Modellauswahl
 * ---------------------------------------------------------------------- */
.fieldset {
  border: 1px solid var(--border-default);
  padding: 20px 20px 8px;
  margin: 0 0 24px;
  background: var(--bg-base);
}
.fieldset-legend {
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
}

/* ----------------------------------------------------------------------
 * Radio-Cards (Prüfmodell-Auswahl)
 * ---------------------------------------------------------------------- */
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border-default);
  background: var(--bg-base);
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.radio-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}
.radio-card:has(input[type="radio"]:checked) {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  box-shadow: inset 3px 0 0 var(--accent-primary), 0 0 12px var(--accent-glow);
}
.radio-card input[type="radio"] {
  margin-top: 2px;
}
.radio-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.radio-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.radio-card-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------
 * Dropzone (Datei-Upload)
 * ---------------------------------------------------------------------- */
.dropzone {
  position: relative;
  border: 2px dashed var(--border-strong);
  background: var(--bg-base);
  padding: 32px 24px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.dropzone:hover,
.dropzone-active {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 16px var(--accent-glow);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dropzone-hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  pointer-events: none;
}
.dropzone-hint::before {
  content: "↑";
  font-size: 1.8rem;
  color: var(--accent-primary);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.dropzone-filename {
  color: var(--accent-primary);
  font-weight: 600;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

/* ----------------------------------------------------------------------
 * Action-Bar / Flash-Stack
 * ---------------------------------------------------------------------- */
.action-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.action-bar-top {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  padding-bottom: 12px;
  align-items: center;
}
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* ----------------------------------------------------------------------
 * Header / Brand — Feinschliff
 * ---------------------------------------------------------------------- */
.brand-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
  margin-right: 12px;
  vertical-align: middle;
}
.brand-text {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.brand:hover .brand-text { color: var(--accent-primary); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.nav-secondary {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.nav-secondary a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav-secondary a:hover { color: var(--accent-primary); }
.nav-secondary span { color: var(--border-default); }

.footer-inner {
  padding: 18px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ----------------------------------------------------------------------
 * Redact-Vorschau
 * ---------------------------------------------------------------------- */
.redact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.redact-item {
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
  padding: 10px 14px;
  transition: border-color 0.15s ease;
}
.redact-item:has(input:checked) {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}
.redact-item-label {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
}
.redact-item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.code-inline {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.85rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  color: var(--accent-primary);
}
.redact-item .code-inline {
  color: var(--text-primary);
}
