/* Hufrehe-Risiko-Check — Stepper UI
   Uses global CSS variables from styles.css */

.hrc {
  --hrc-green:  #3FCC85;
  --hrc-yellow: #F0C447;
  --hrc-orange: #E07B3C;
  --hrc-red:    #E36548;
  --hrc-card-bg: rgba(255,255,255,0.08);
  --hrc-card-border: rgba(255,255,255,0.12);

  max-width: 720px;
  margin: 40px auto 80px;
  padding: 0 var(--pad-x, clamp(20px, 5vw, 80px));
  font-family: var(--font-body);
  color: var(--ink);
}

/* ═══════ Progress bar ═══════ */
.hrc-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 36px;
}
.hrc-progress__step {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  transition: background .3s;
}
.hrc-progress__step--done { background: var(--accent); }
.hrc-progress__step--active { background: rgba(13,184,122,0.4); }
.hrc-progress__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  margin-left: 8px;
}

/* ═══════ Question card ═══════ */
.hrc-card {
  background: var(--hrc-card-bg);
  border: 1px solid var(--hrc-card-border);
  border-radius: var(--r-xl);
  padding: clamp(24px, 4vw, 40px);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px -20px rgba(0,0,0,0.3);
}

.hrc-step-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.hrc-question {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 8px;
}

.hrc-hint {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 24px;
}

/* ═══════ Answer buttons (segmented) ═══════ */
.hrc-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.hrc-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  width: 100%;
}
.hrc-opt:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
}
.hrc-opt--selected {
  border-color: var(--accent);
  background: rgba(13,184,122,0.1);
}
.hrc-opt__radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  position: relative;
  transition: border-color .15s;
}
.hrc-opt--selected .hrc-opt__radio {
  border-color: var(--accent);
}
.hrc-opt--selected .hrc-opt__radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

/* Checkbox variant for multi-select */
.hrc-opt__check {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  position: relative;
  transition: border-color .15s, background .15s;
}
.hrc-opt--selected .hrc-opt__check {
  border-color: var(--accent);
  background: var(--accent);
}
.hrc-opt--selected .hrc-opt__check::after {
  content: "";
  position: absolute;
  left: 5px; top: 2px;
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ═══════ Navigation buttons ═══════ */
.hrc-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.hrc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all .15s;
}
.hrc-btn svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

.hrc-btn--back {
  background: rgba(255,255,255,0.08);
  color: var(--ink-soft);
}
.hrc-btn--back:hover { background: rgba(255,255,255,0.14); }

.hrc-btn--next {
  background: var(--accent);
  color: #fff;
}
.hrc-btn--next:hover { background: var(--accent-deep); }
.hrc-btn--next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ═══════ Tooltip (?) ═══════ */
.hrc-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 6px;
}
.hrc-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 280px;
  padding: 12px 16px;
  background: #0A1420;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  z-index: 20;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5);
}
.hrc-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0A1420;
}
.hrc-tooltip-trigger:hover .hrc-tooltip,
.hrc-tooltip-trigger:focus .hrc-tooltip {
  display: block;
}

/* ═══════ Results ═══════ */
.hrc-result {
  text-align: center;
  margin-bottom: 40px;
}
.hrc-result__ampel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px; height: 120px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
}
.hrc-result__label {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  margin: 0 0 8px;
}
.hrc-result__score-text {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}

/* Category mini ampels */
.hrc-cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}
@media (min-width: 560px) {
  .hrc-cats { grid-template-columns: repeat(4, 1fr); }
}
.hrc-cat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-md);
  padding: 16px 14px;
  text-align: center;
}
.hrc-cat__dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-bottom: 8px;
}
.hrc-cat__name {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.hrc-cat__level {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-transform: capitalize;
}

/* Top risk factors */
.hrc-risks {
  margin-bottom: 36px;
}
.hrc-risks__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
}
.hrc-risk {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.hrc-risk:last-child { border-bottom: none; }
.hrc-risk__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}
.hrc-risk__text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* Recommendations */
.hrc-reco {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 32px);
  margin-bottom: 24px;
}
.hrc-reco__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 14px;
}
.hrc-reco__text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.hrc-reco__text ul {
  margin: 10px 0;
  padding-left: 20px;
}
.hrc-reco__text li {
  margin-bottom: 6px;
}

/* Tool links */
.hrc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.hrc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(13,184,122,0.1);
  border-radius: 999px;
  padding: 8px 18px;
  text-decoration: none;
  transition: background .15s;
}
.hrc-link:hover { background: rgba(13,184,122,0.2); }
.hrc-link svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 2.5;
}

/* Notfall-Modus */
.hrc-notfall {
  border: 2px solid var(--hrc-red);
  border-radius: var(--r-xl);
  padding: clamp(24px, 4vw, 40px);
  background: rgba(227,101,72,0.08);
}
.hrc-notfall__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 600;
  color: var(--hrc-red);
  margin: 0 0 8px;
}
.hrc-notfall__subtitle {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 24px;
  line-height: 1.5;
}
.hrc-notfall__list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.hrc-notfall__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(227,101,72,0.15);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.hrc-notfall__list li:last-child { border-bottom: none; }
.hrc-notfall__check {
  width: 20px; height: 20px;
  border-radius: 5px;
  border: 2px solid rgba(227,101,72,0.4);
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  transition: all .15s;
}
.hrc-notfall__check--checked {
  background: var(--hrc-red);
  border-color: var(--hrc-red);
}

.hrc-notfall__section {
  margin-top: 28px;
}
.hrc-notfall__section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 14px;
}
.hrc-notfall__section p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.hrc-notfall__section ul {
  margin: 10px 0;
  padding-left: 20px;
}
.hrc-notfall__section li {
  display: list-item;
  border-bottom: none;
  padding: 4px 0;
  gap: 0;
}

/* Actions */
.hrc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  justify-content: center;
}

/* Print */
.hrc-btn--print {
  background: rgba(255,255,255,0.08);
  color: var(--ink-soft);
}
.hrc-btn--print:hover { background: rgba(255,255,255,0.14); }

.hrc-btn--restart {
  background: rgba(255,255,255,0.08);
  color: var(--ink-soft);
}
.hrc-btn--restart:hover { background: rgba(255,255,255,0.14); }

.hrc-btn--hub {
  background: var(--accent);
  color: #fff;
}
.hrc-btn--hub:hover { background: var(--accent-deep); }

@media print {
  .tools-nav, .hrc-progress, .hrc-actions, .hrc-nav { display: none; }
  .hrc { max-width: 100%; padding: 0; }
  .hrc-card { box-shadow: none; border: 1px solid #ccc; backdrop-filter: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Cream-Theme-Overrides (gescopt). Funktionsfarben (--hrc-green/yellow/
   orange/red, Notfall-Block, .hrc-opt--selected/accent) bleiben.
   ═══════════════════════════════════════════════════════════════════════ */
.cream-theme .hrc {
  --hrc-card-bg: var(--bg-soft);
  --hrc-card-border: var(--line);
}
.cream-theme .hrc-progress__step { background: var(--line); }
.cream-theme .hrc-opt {
  border-color: var(--line);
  background: var(--bg-soft);
}
.cream-theme .hrc-opt:hover {
  border-color: var(--muted-2);
  background: var(--bg-warm);
}
.cream-theme .hrc-opt__radio,
.cream-theme .hrc-opt__check,
.cream-theme .hrc-tooltip-trigger { border-color: var(--muted-2); }
.cream-theme .hrc-btn--back,
.cream-theme .hrc-btn--print,
.cream-theme .hrc-btn--restart {
  background: var(--bg-warm);
  color: var(--ink-soft);
}
.cream-theme .hrc-btn--back:hover,
.cream-theme .hrc-btn--print:hover,
.cream-theme .hrc-btn--restart:hover { background: #ece2cf; }
/* Tooltip: war dunkel (#0A1420) mit --ink-soft-Text → nach Token-Flip wäre
   dunkler Text auf dunkel = unlesbar. Komplett auf Cream umstellen. */
.cream-theme .hrc-tooltip {
  background: var(--bg-soft);
  border-color: var(--line);
  box-shadow: 0 12px 32px -8px rgba(31,58,50,0.25);
}
.cream-theme .hrc-tooltip::after { border-top-color: var(--bg-soft); }
.cream-theme .hrc-cat,
.cream-theme .hrc-reco {
  background: var(--bg-warm);
  border-color: var(--line);
}
