/* =========================================================
   migrahigrumat — Wahl-O-Mat parody styling
   Faithful to the original's minimalist civic aesthetic,
   with subtle bureaucratic distortions.
   ========================================================= */

:root {
  --orange: #ff5400;        /* slightly hotter than the official bpb orange */
  --orange-dark: #cc4300;
  --orange-light: #fff3ee;
  --grey-100: #f4f1eb;      /* faint parchment — not quite white */
  --grey-200: #e8e4dc;
  --grey-400: #b0a898;
  --grey-700: #3d3a35;
  --grey-900: #1a1815;
  --red-alert: #c0392b;
  --stamp-color: rgba(192, 57, 43, 0.15);
  --font: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --radius: 2px;            /* deliberately square — government forms don't round corners */
  --max-width: 680px;
  --transition: 120ms ease-out;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background-color: var(--grey-100);
  color: var(--grey-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
header {
  background: var(--orange);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--orange-dark);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.logo span {
  font-weight: 300;
  opacity: 0.85;
}

.header-sub {
  font-size: 0.7rem;
  opacity: 0.9;
  text-align: right;
  font-family: var(--font-mono);
  max-width: 220px;
  line-height: 1.3;
}

/* ---- Progress ---- */
.progress-wrapper {
  background: var(--grey-200);
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--grey-400);
}

.progress-track {
  height: 4px;
  background: var(--grey-400);
  border-radius: 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--orange);
  width: 0%;
  transition: width 300ms ease-out;
}

.progress-label {
  font-size: 0.7rem;
  color: var(--grey-700);
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Main layout ---- */
main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

#app {
  width: 100%;
  max-width: var(--max-width);
}

/* ---- Card ---- */
.card {
  background: #fff;
  border: 1px solid var(--grey-200);
  border-top: 4px solid var(--orange);
  padding: 2rem;
  position: relative;
}

.card--result {
  border-top-color: var(--orange-dark);
}

/* ---- Category badge ---- */
.category-badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  margin-bottom: 0.75rem;
}

/* ---- Category title ---- */
.category-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--grey-900);
  margin-bottom: 1.5rem;
  line-height: 1.35;
  border-bottom: 1px solid var(--grey-200);
  padding-bottom: 0.75rem;
}

/* ---- Options ---- */
.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.option {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--grey-400);
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--grey-900);
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
  line-height: 1.4;
}

.option:hover {
  border-color: var(--orange);
  background: var(--orange-light);
}

.option.selected {
  border-color: var(--orange);
  background: var(--orange-light);
  border-left: 4px solid var(--orange);
  font-weight: 600;
}

/* Bureaucratic alarm options */
.option--special {
  border-style: dashed;
}

.option--herabstufung:hover,
.option--herabstufung.selected {
  border-color: var(--red-alert);
  background: #fdf0ee;
  border-left-color: var(--red-alert);
}

.option--betroffenheitsrat:hover,
.option--betroffenheitsrat.selected {
  border-color: #7b5ea7;
  background: #f8f4fd;
  border-left-color: #7b5ea7;
}

/* ---- Navigation ---- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--grey-200);
  padding-top: 1rem;
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--orange);
  color: #fff;
}
.btn--primary:hover:not(:disabled) { background: var(--orange-dark); }

.btn--secondary {
  background: var(--grey-900);
  color: #fff;
}
.btn--secondary:hover:not(:disabled) { background: #000; }

.btn--ghost {
  background: transparent;
  color: var(--grey-700);
  border: 1px solid var(--grey-400);
}
.btn--ghost:hover:not(:disabled) { border-color: var(--grey-700); }

/* ---- Result card ---- */
.result-stamp {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red-alert);
  border: 3px solid var(--red-alert);
  padding: 0.2rem 0.5rem;
  letter-spacing: 0.15em;
  transform: rotate(8deg);
  opacity: 0.6;
  pointer-events: none;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 1rem 0;
}

.score-number {
  font-size: 3.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--orange);
  line-height: 1;
}

.score-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-700);
  margin-top: 0.2rem;
}

.result-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--grey-900);
  margin: 0.5rem 0 0.75rem;
  line-height: 1.35;
}

.result-description {
  font-size: 0.875rem;
  color: var(--grey-700);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid var(--grey-200);
  padding-top: 1rem;
}

/* ---- Alerts ---- */
.alert {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid;
  line-height: 1.4;
}

.alert--review {
  border-color: #7b5ea7;
  background: #f8f4fd;
  color: #4a3566;
}

.alert--herabstufung {
  border-color: var(--red-alert);
  background: #fdf0ee;
  color: var(--red-alert);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: #fff;
  border-top: 4px solid var(--red-alert);
  max-width: 440px;
  width: 100%;
  padding: 1.5rem;
}

.modal-header {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  color: var(--red-alert);
}

.modal-body {
  font-size: 0.875rem;
  color: var(--grey-700);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.modal-close {
  width: 100%;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--grey-900);
  color: #fff;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--grey-200);
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--grey-400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .card { padding: 1.25rem; }
  .score-number { font-size: 2.5rem; }
  .result-actions { flex-direction: column; }
  .btn { width: 100%; text-align: center; }
  .logo { font-size: 1rem; }
  .header-sub { display: none; }
}
