/* ================================================================
   FensterLex – uw-rechner.css
   U-Wert Rechner · eigenständiges Stylesheet
   Einbinden: <link rel="stylesheet" href="/css/uw-rechner.css">
   ================================================================ */

.rechner-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

/* ── Formular ── */
.rechner-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.rf-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rf-label {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #8a8880);
}

.rf-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Slider */
.rf-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--border, #2a2e33);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}
.rf-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #c8963b);
  cursor: pointer;
  border: 2px solid var(--bg, #0d0f11);
  transition: transform 0.15s;
}
.rf-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #c8963b);
  cursor: pointer;
  border: 2px solid var(--bg, #0d0f11);
}
.rf-range:hover::-webkit-slider-thumb { transform: scale(1.2); }
.rf-range:focus::-webkit-slider-thumb { transform: scale(1.2); }

/* Zahleneingabe */
.rf-number {
  width: 74px;
  background: var(--bg-card, #1a1d20);
  border: 1px solid var(--border, #2a2e33);
  border-radius: 3px;
  color: var(--text, #e4e2dc);
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.88rem;
  padding: 5px 7px;
  text-align: right;
  outline: none;
  transition: border-color 0.15s;
  flex-shrink: 0;
  -moz-appearance: textfield;
}
.rf-number:focus { border-color: var(--accent, #c8963b); }
.rf-number::-webkit-outer-spin-button,
.rf-number::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.rf-unit {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-dim, #5a5650);
  white-space: nowrap;
  min-width: 52px;
}

/* ── Ergebnisbox ── */
.rechner-result {
  background: var(--bg-card, #1a1d20);
  border: 1px solid var(--border, #2a2e33);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  position: sticky;
  top: 72px;
}

.rr-label {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim, #5a5650);
}

.rr-value {
  font-family: var(--font-head, 'Playfair Display', serif);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent, #c8963b);
  transition: color 0.3s;
}

.rr-unit {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.72rem;
  color: var(--text-muted, #8a8880);
  letter-spacing: 0.04em;
}

.rr-badge {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid currentColor;
  margin: 0.25rem 0;
}
.rr-badge.excellent { color: #4fa8d4; }
.rr-badge.good      { color: #4caf6e; }
.rr-badge.ok        { color: #d4a843; }
.rr-badge.bad       { color: #e05454; }

.rr-formula {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.68rem;
  color: var(--text-dim, #5a5650);
  text-align: center;
  line-height: 1.7;
  border-top: 1px solid var(--border, #2a2e33);
  padding-top: 0.75rem;
  width: 100%;
}

.rr-breakdown {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.68rem;
  color: var(--text-muted, #8a8880);
  text-align: center;
  line-height: 1.7;
}

/* Skala-Balken */
.rrs-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--border, #2a2e33);
  border-radius: 3px;
  margin-top: 0.5rem;
  overflow: visible;
}
.rrs-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(to right,
    #4fa8d4 0%,
    #4caf6e 20%,
    #d4a843 40%,
    #e05454 80%
  );
  transition: width 0.3s ease;
}
.rrs-marker {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 14px;
  background: var(--text, #e4e2dc);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: left 0.3s ease;
}
.rrs-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.6rem;
  color: var(--text-dim, #5a5650);
  letter-spacing: 0.03em;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .rechner-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .rechner-result {
    position: static;
  }
}
@media (max-width: 480px) {
  .rf-input-row { flex-wrap: wrap; gap: 0.5rem; }
  .rf-range { min-width: 100%; order: 1; }
  .rf-number { order: 2; }
  .rf-unit { order: 3; }
  .rr-value { font-size: 2.4rem; }
}
