/* ==========================================================================
   PROTEIN-O-MAT – Design System
   Light Mode · Wahl-O-Mat-Inspired · Clean & Functional
   ========================================================================== */

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Colors – Light, clean, Wahl-O-Mat-inspired */
  --bg-base: #f5f5f5;
  --bg-white: #ffffff;
  --bg-hover: #eaeaea;
  --bg-active: #e0e0e0;

  --accent: #c0712c;
  --accent-hover: #a8611f;
  --accent-light: #fdf3e8;
  --accent-text: #ffffff;

  --green: #2e7d32;
  --green-bg: #e8f5e9;
  --green-border: #a5d6a7;

  --stone: #616161;
  --stone-bg: #f0f0f0;
  --stone-border: #bdbdbd;

  --red: #b53929;
  --red-bg: #fbe9e7;
  --red-border: #ef9a9a;

  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #999999;

  --border: #e0e0e0;
  --border-strong: #cccccc;

  /* Typography – DSGVO-konforme System-Schriftarten (keine Google Fonts CDNs) */
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Misc */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 680px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── App Container ─────────────────────────────────────────────────────── */
.app {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* ── Screen System ─────────────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow),
    visibility 0s var(--transition-slow);
}

.screen--active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow),
    visibility 0s 0s;
}

/* ── WELCOME SCREEN ────────────────────────────────────────────────────── */
.welcome {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.welcome__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

.welcome__divider {
  width: 48px;
  height: 3px;
  background-color: var(--accent);
  margin: 0 auto var(--space-xl);
  border-radius: var(--radius-full);
}

.welcome__text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 500px;
  margin: 0 auto var(--space-md);
}

.welcome__text--small {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.welcome__credit {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-xl);
  letter-spacing: 0.03em;
}

/* ── BUTTONS (General) ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn--primary {
  background-color: var(--accent);
  color: var(--accent-text);
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background-color: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn__icon {
  flex-shrink: 0;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  gap: var(--space-xs);
}

.btn--ghost:hover {
  color: var(--text-secondary);
  background-color: var(--bg-hover);
  border-radius: var(--radius-sm);
}

.btn--ghost svg {
  flex-shrink: 0;
}

/* ── PROGRESS BAR ──────────────────────────────────────────────────────── */
.progress {
  margin-bottom: var(--space-2xl);
}

.progress__track {
  width: 100%;
  height: 6px;
  background-color: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.progress__bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress__text {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
  letter-spacing: 0.04em;
}

/* ── STATEMENT ─────────────────────────────────────────────────────────── */
.statement-view {
  padding: var(--space-xl) 0;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl) var(--space-xl);
}

.statement {
  border: none;
  margin: 0 0 var(--space-xl);
  padding: 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.statement__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
  line-height: 1.45;
  color: var(--text-primary);
  text-align: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.statement__text--fade {
  opacity: 0;
  transform: translateX(6px);
}

/* ── ANSWER BUTTONS (Wahl-O-Mat style) ─────────────────────────────────── */
.answer-group {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.btn-answer {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-answer__icon {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

/* Agree */
.btn-answer--agree:hover {
  border-color: var(--green-border);
  background-color: var(--green-bg);
  color: var(--green);
}
.btn-answer--agree.is-selected {
  border-color: var(--green);
  background-color: var(--green-bg);
  color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

/* Neutral */
.btn-answer--neutral:hover {
  border-color: var(--stone-border);
  background-color: var(--stone-bg);
  color: var(--stone);
}
.btn-answer--neutral.is-selected {
  border-color: var(--stone);
  background-color: var(--stone-bg);
  color: var(--stone);
  box-shadow: 0 0 0 1px var(--stone);
}

/* Disagree */
.btn-answer--disagree:hover {
  border-color: var(--red-border);
  background-color: var(--red-bg);
  color: var(--red);
}
.btn-answer--disagree.is-selected {
  border-color: var(--red);
  background-color: var(--red-bg);
  color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

.btn-answer:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── WEIGHT TOGGLE ─────────────────────────────────────────────────────── */
.weight-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  cursor: pointer;
  margin-bottom: var(--space-xl);
  padding: var(--space-md) 0;
  user-select: none;
}

.weight-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.weight-toggle__switch {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--border);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  flex-shrink: 0;
}

.weight-toggle__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.weight-toggle__input:checked + .weight-toggle__switch {
  background-color: var(--accent);
  border-color: var(--accent);
}

.weight-toggle__input:checked + .weight-toggle__switch::after {
  transform: translateX(20px);
  background-color: var(--bg-white);
}

.weight-toggle__input:focus-visible + .weight-toggle__switch {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.weight-toggle__text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.weight-toggle__input:checked ~ .weight-toggle__text {
  color: var(--accent);
  font-weight: 600;
}

/* ── STATEMENT NAV ─────────────────────────────────────────────────────── */
.statement-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
}

/* ── RESULTS SCREEN ────────────────────────────────────────────────────── */
.results {
  padding: var(--space-xl) 0 var(--space-3xl);
  text-align: center;
}

.results__badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.results__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.results__subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.65;
}

/* ── RESULT CARDS ──────────────────────────────────────────────────────── */
.results__list {
  text-align: left;
  margin-bottom: var(--space-2xl);
}

.result-card {
  display: block;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  box-shadow: var(--shadow-sm);
}

.result-card--visible {
  opacity: 1;
  transform: translateY(0);
}

.result-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.result-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.result-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.result-card__rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-muted);
  min-width: 28px;
}

.result-card__rank--top {
  color: var(--accent);
}

.result-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-primary);
  flex: 1;
}

.result-card__percent {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.result-card__bar-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-base);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.result-card__bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.result-card__desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-md);
}

.result-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.result-card__link svg {
  transition: transform var(--transition);
}

.result-card:hover .result-card__link svg {
  transform: translateX(3px);
}

/* ── RESULTS FOOTER ────────────────────────────────────────────────────── */
.results__disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xl);
  line-height: 1.65;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container {
    padding: var(--space-lg) var(--space-md);
  }

  .welcome {
    padding: var(--space-xl) 0;
  }

  .statement-view {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
  }

  .answer-group {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .btn-answer {
    flex-direction: row;
    padding: var(--space-md) var(--space-lg);
  }
}

/* ── REDUCED MOTION ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── FOOTER ────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  margin-top: var(--space-3xl);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
}

.footer__link {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  transition: color var(--transition);
  text-decoration: underline;
}

.footer__link:hover {
  color: var(--text-secondary);
}

.footer__sep {
  user-select: none;
}

/* ── MODALS (Impressum & Datenschutz) ──────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility 0s var(--transition);
}

.modal.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--transition), visibility 0s 0s;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background-color: var(--bg-white);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow-y: auto;
  z-index: 1001;
  padding: var(--space-xl) var(--space-lg);
  transform: scale(0.95);
  transition: transform var(--transition);
}

.modal.is-active .modal__content {
  transform: scale(1);
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
  padding: 4px 10px;
}

.modal__close:hover {
  color: var(--text-primary);
}

.modal__body h2,
.modal__body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.modal__body h2 {
  font-size: 1.4rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: var(--space-xs);
}

.modal__body h3 {
  font-size: 1.1rem;
}

.modal__body p,
.modal__body ul {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.modal__body ul {
  padding-left: var(--space-lg);
}

/* ── SCROLLBAR ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
