/* ==========================================================================
   ROBO-RECHNER – Konfigurator Widget
   ========================================================================== */

.rr-widget {
  --rr-bg: #00062c;
  --rr-panel: #040b3a;
  --rr-panel-2: #071046;
  --rr-line: #1c2a66;
  --rr-text: #ffffff;
  --rr-heading: #58cced;
  --rr-muted: #b9c3ec;
  --rr-accent: #58cced;
  --rr-accent-2: #58cced;
  --rr-danger: #ff6b6b;
  --rr-radius: 10px;
  --rr-font-display: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --rr-font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --rr-font-mono: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  box-sizing: border-box;
  background: var(--rr-bg);
  color: var(--rr-text);
  font-family: var(--rr-font-body);
  border-radius: 16px;
  padding: 0;
  max-width: 980px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--rr-line);
  position: relative;
}

.rr-widget *, .rr-widget *::before, .rr-widget *::after { box-sizing: border-box; }

/* ---------- Header ---------- */
.rr-head {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--rr-line);
  background: linear-gradient(180deg, #020a3d 0%, #00062c 100%);
}

.rr-eyebrow {
  font-family: var(--rr-font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rr-accent);
  margin: 0 0 6px;
}

.rr-title {
  font-family: var(--rr-font-display);
  font-weight: 700;
  font-size: 26px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--rr-heading);
}

.rr-sub {
  color: var(--rr-muted);
  font-size: 14px;
  margin: 0;
}

/* ---------- Progress ---------- */
.rr-progress-track {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--rr-line);
  background: var(--rr-panel);
}

.rr-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--rr-line);
  border-radius: 4px;
  overflow: hidden;
}

.rr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rr-accent), var(--rr-accent-2));
  border-radius: 4px;
  transition: width .35s ease;
}

.rr-progress-label {
  font-family: var(--rr-font-mono);
  font-size: 12px;
  color: var(--rr-muted);
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
}

/* ---------- Body layout ---------- */
.rr-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
}

@media (max-width: 780px) {
  .rr-body { grid-template-columns: 1fr; }
  .rr-spec { display: none; }
  .rr-spec.rr-spec-final { display: block; order: 2; }
}

/* ---------- Step area ---------- */
.rr-step-area {
  padding: 32px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.rr-step-kicker {
  font-family: var(--rr-font-mono);
  font-size: 12px;
  color: var(--rr-accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.rr-step-question {
  font-family: var(--rr-font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--rr-heading);
}

.rr-step-hint {
  color: var(--rr-muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 24px;
  max-width: 46ch;
}

.rr-step-hint strong { color: var(--rr-text); }

.rr-field { flex: 1; }

/* card choices (checkbox / radio look) */
.rr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.rr-card {
  border: 1px solid var(--rr-line);
  background: var(--rr-panel-2);
  border-radius: var(--rr-radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
  position: relative;
  user-select: none;
}

.rr-card:hover { border-color: #3a4450; }

.rr-card.rr-selected {
  border-color: var(--rr-accent);
  background: linear-gradient(180deg, rgba(88,204,237,.16), rgba(88,204,237,.05));
}

.rr-card-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--rr-line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rr-card.rr-selected .rr-card-check {
  border-color: var(--rr-accent);
  background: var(--rr-accent);
}

.rr-card.rr-selected .rr-card-check::after {
  content: "";
  width: 5px;
  height: 9px;
  border-right: 2px solid #00062c;
  border-bottom: 2px solid #00062c;
  transform: rotate(45deg) translate(-1px,-1px);
}

.rr-card-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 4px;
  padding-right: 24px;
}

.rr-card-desc {
  font-size: 12.5px;
  color: var(--rr-muted);
  margin: 0;
}

/* number input */
.rr-number-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 2px solid var(--rr-line);
  padding-bottom: 10px;
  max-width: 280px;
}

.rr-number-row.rr-active { border-color: var(--rr-accent); }

.rr-number-input {
  font-family: var(--rr-font-mono);
  font-size: 40px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--rr-text);
  width: 100%;
  outline: none;
}

.rr-number-input::placeholder { color: #7c88bf; }

.rr-unit {
  font-family: var(--rr-font-mono);
  color: var(--rr-muted);
  font-size: 15px;
  white-space: nowrap;
}

.rr-error {
  color: var(--rr-danger);
  font-size: 12.5px;
  margin-top: 10px;
  min-height: 16px;
}

/* slider */
.rr-slider-wrap { max-width: 460px; }

.rr-slider-readout {
  font-family: var(--rr-font-mono);
  font-size: 40px;
  font-weight: 600;
  margin-bottom: 18px;
}

.rr-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: var(--rr-line);
  outline: none;
}

.rr-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--rr-accent);
  border: 3px solid #00062c;
  cursor: pointer;
  margin-top: -8px;
}

.rr-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--rr-accent);
  border: 3px solid #00062c;
  cursor: pointer;
}

.rr-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 4px; }

.rr-slider-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--rr-font-mono);
  font-size: 11px;
  color: var(--rr-muted);
  margin-top: 8px;
}

/* toggle (Ja/Nein) */
.rr-toggle-row { display: flex; gap: 12px; }

.rr-toggle {
  flex: 1;
  text-align: center;
  padding: 18px 12px;
  border-radius: var(--rr-radius);
  border: 1px solid var(--rr-line);
  background: var(--rr-panel-2);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.rr-toggle.rr-selected {
  border-color: var(--rr-accent-2);
  background: linear-gradient(180deg, rgba(88,204,237,.16), rgba(88,204,237,.05));
  color: var(--rr-accent-2);
}

/* ---------- Nav ---------- */
.rr-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  margin-top: auto;
}

.rr-btn {
  font-family: var(--rr-font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 12px 22px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .15s ease, opacity .15s ease;
}

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

.rr-btn-primary {
  background: var(--rr-accent);
  color: #00062c;
}
.rr-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.rr-btn-ghost {
  background: transparent;
  border-color: var(--rr-line);
  color: var(--rr-muted);
}
.rr-btn-ghost:hover { color: var(--rr-text); border-color: #7c88bf; }

/* ---------- Spec / live readout panel ---------- */
.rr-spec {
  background: var(--rr-panel);
  border-left: 1px solid var(--rr-line);
  padding: 28px 26px;
}

.rr-spec-title {
  font-family: var(--rr-font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rr-muted);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rr-spec-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rr-accent-2);
  box-shadow: 0 0 0 3px rgba(88,204,237,.18);
}

.rr-spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rr-spec-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--rr-line);
  font-size: 13px;
}

.rr-spec-list li:last-child { border-bottom: none; }

.rr-spec-key { color: var(--rr-muted); }
.rr-spec-val {
  font-family: var(--rr-font-mono);
  text-align: right;
  color: var(--rr-text);
}
.rr-spec-val.rr-pending { color: #7c88bf; }

/* ---------- Final step ---------- */
.rr-final-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--rr-accent), var(--rr-accent-2));
  margin-bottom: 18px;
}

.rr-final-cta {
  margin-top: 22px;
}

/* ---------- Modal ---------- */
.rr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,3,20,.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.rr-modal-overlay.rr-open { display: flex; }

.rr-modal {
  background: var(--rr-bg);
  border: 1px solid var(--rr-line);
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  padding: 28px;
  color: var(--rr-text);
  font-family: var(--rr-font-body);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.rr-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  color: var(--rr-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.rr-modal h3 {
  font-family: var(--rr-font-display);
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--rr-heading);
}

.rr-modal p.rr-modal-sub {
  color: var(--rr-muted);
  font-size: 13.5px;
  margin: 0 0 20px;
}

.rr-form-group { margin-bottom: 14px; }

.rr-form-group label {
  display: block;
  font-size: 12.5px;
  color: var(--rr-muted);
  margin-bottom: 6px;
}

.rr-form-group input,
.rr-form-group textarea {
  width: 100%;
  background: var(--rr-panel-2);
  border: 1px solid var(--rr-line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--rr-text);
  font-family: var(--rr-font-body);
  font-size: 14px;
  outline: none;
}

.rr-form-group input:focus,
.rr-form-group textarea:focus { border-color: var(--rr-accent); }

.rr-form-group textarea { resize: vertical; min-height: 70px; }

/* honeypot - hidden from humans, visible to bots */
.rr-hp { position: absolute; left: -9999px; opacity: 0; height: 0; }

.rr-modal-submit {
  width: 100%;
  margin-top: 6px;
}

.rr-modal-status {
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  min-height: 18px;
}
.rr-modal-status.rr-ok { color: var(--rr-accent-2); }
.rr-modal-status.rr-fail { color: var(--rr-danger); }

.rr-privacy-note {
  font-size: 11.5px;
  color: var(--rr-muted);
  margin-top: 14px;
  line-height: 1.5;
}

/* focus visibility for a11y */
.rr-widget a:focus-visible,
.rr-widget button:focus-visible,
.rr-widget input:focus-visible,
.rr-widget textarea:focus-visible,
.rr-widget [tabindex]:focus-visible {
  outline: 2px solid var(--rr-accent-2);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .rr-widget * { transition: none !important; }
}

@media (max-width: 560px) {
  .rr-head, .rr-step-area, .rr-spec { padding: 20px; }
  .rr-title { font-size: 21px; }
  .rr-step-question { font-size: 19px; }
  .rr-number-input, .rr-slider-readout { font-size: 32px; }
}
