/* Gemeinsame Grundlagen für alle Seiten des Prototyps. */

:root {
  --brand: #2f6f4e;
  --brand-ink: #ffffff;

  --ink: #16181d;
  --muted: #656b76;
  --line: #e2e5ea;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --danger: #b4232b;
  --warn-bg: #fdf5e3;
  --warn-line: #e8d9a8;
  --warn-ink: #6b5310;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 20, 28, 0.06), 0 6px 20px rgba(16, 20, 28, 0.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Muss vor allen Layout-Regeln stehen: Klassen wie `.stage-status { display: flex }`
   sind spezifischer als die Browser-Regel für [hidden] und würden das Attribut
   sonst wirkungslos machen. Die gesamte Oberfläche schaltet über `hidden`. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  margin: 0 0 0.4em;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 650;
}

h1 { font-size: clamp(1.4rem, 3.2vw, 1.9rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 0.8em; }

a { color: var(--brand); }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(16, 20, 28, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ Elemente */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  font: inherit;
  font-weight: 550;
  padding: 0.6em 1.05em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  min-height: 42px;
}

.btn:hover:not(:disabled) { background: #eef0f3; }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--brand); }

.btn-danger { color: var(--danger); border-color: #e7c9cb; background: #fdf6f6; }
.btn-danger:hover:not(:disabled) { background: #fbeced; }

.btn-sm { padding: 0.35em 0.65em; min-height: 34px; font-size: 0.88rem; }

.btn-icon {
  min-height: 34px;
  width: 34px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  width: 100%;
  padding: 0.55em 0.7em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-height: 42px;
}

input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

textarea { min-height: 82px; resize: vertical; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--muted);
  margin-bottom: 0.3em;
}

.field { margin-bottom: 0.9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

.notice {
  padding: 0.75em 0.9em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.9rem;
}

.notice-error {
  border-color: #e7c9cb;
  background: #fdf6f6;
  color: var(--danger);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Spinner für Ladezustände. */
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner-dark {
  border-color: rgba(22, 24, 29, 0.18);
  border-top-color: var(--ink);
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  * { scroll-behavior: auto !important; }
}
