/* ==========================================================================
   tools.css – Wärme mit System
   Altbau-Check, Förderrechner and WPForms.

   Loaded only on pages that contain [ws_altbau_check], [ws_foerderrechner] or
   a WPForms shortcode (inc/enqueue.php).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared panel shell (PROJECT_PLAN §5.4: 14px radius, one of only two places
   a shadow is allowed).
   -------------------------------------------------------------------------- */

.ws-panel {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--ws-line);
  border-radius: var(--ws-radius-panel);
  background: var(--ws-white);
}

.ws-panel.is-interactive {
  box-shadow: 0 20px 40px -24px rgba(14, 23, 49, 0.35);
}

/* --------------------------------------------------------------------------
   Form controls, shared by both tools and WPForms.
   -------------------------------------------------------------------------- */

.ws-panel label,
.ws-panel legend {
  font-family: var(--ws-font-body);
  font-weight: 500;
  color: var(--ws-ink);
}

.ws-panel input[type="number"],
.ws-panel input[type="text"],
.ws-panel select {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--ws-space-4);
  border: 1px solid var(--ws-line);
  border-radius: var(--ws-radius-image);
  background: var(--ws-white);
  box-shadow: none;
  font-family: var(--ws-font-body);
  font-size: 1.0625rem;
  color: var(--ws-ink);
}

.ws-panel input:focus-visible,
.ws-panel select:focus-visible {
  outline: 3px solid var(--ws-focus);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Altbau-Check
   -------------------------------------------------------------------------- */

.ws-ac__progress { margin-bottom: var(--ws-space-5); }

.ws-ac__progress-text {
  margin-bottom: var(--ws-space-2);
  color: var(--ws-muted);
}

.ws-ac__bar {
  height: 4px;
  border-radius: 2px;
  background: var(--ws-line);
  overflow: hidden;
}

.ws-ac__bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--ws-gradient);
  transition: width 0.35s ease;
}

.ws-ac__step {
  margin: 0;
  padding: 0;
  border: 0;
}

.ws-ac__question {
  display: block;
  margin-bottom: var(--ws-space-3);
  padding: 0;
  font-family: var(--ws-font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ws-ink);
}

.ws-ac__question:focus-visible {
  outline: 3px solid var(--ws-focus);
  outline-offset: 4px;
}

.ws-ac__help {
  margin-bottom: var(--ws-space-4);
  color: var(--ws-muted);
}

.ws-ac__options {
  display: grid;
  gap: var(--ws-space-2);
}

/* Big tap targets: the whole tile is the label. */
.ws-ac__option {
  display: flex;
  align-items: center;
  gap: var(--ws-space-3);
  min-height: 56px;
  padding: var(--ws-space-3) var(--ws-space-4);
  border: 1px solid var(--ws-line);
  border-radius: var(--ws-radius-image);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.ws-ac__option:hover {
  border-color: var(--ws-ink);
  background: var(--ws-stone);
}

.ws-ac__option:has(input:checked) {
  border-color: var(--ws-ink);
  background: var(--ws-stone);
}

.ws-ac__option:has(input:focus-visible) {
  outline: 3px solid var(--ws-focus);
  outline-offset: 2px;
}

.ws-ac__option input {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--ws-indigo);
}

.ws-ac__nav {
  margin-top: var(--ws-space-5);
}

.ws-ac__back[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.ws-ac__result-title {
  margin-bottom: var(--ws-space-3);
}

.ws-ac__result-title:focus-visible {
  outline: 3px solid var(--ws-focus);
  outline-offset: 4px;
}

.ws-ac__result-cta { margin: var(--ws-space-5) 0 var(--ws-space-4); }

.ws-ac__restart {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font-size: 0.9375rem;
}

.ws-ac__disclaimer {
  margin: var(--ws-space-5) 0 0;
  color: var(--ws-muted);
}

/* --------------------------------------------------------------------------
   Förderrechner
   -------------------------------------------------------------------------- */

.ws-fr__form {
  display: grid;
  gap: var(--ws-space-5);
  margin-bottom: var(--ws-space-6);
}

@media (min-width: 700px) {
  .ws-fr__form { grid-template-columns: 1fr 1fr; }
}

.ws-fr__field {
  margin: 0;
  padding: 0;
  border: 0;
}

.ws-fr__field > label,
.ws-fr__field > legend {
  display: block;
  margin-bottom: var(--ws-space-2);
}

.ws-fr__field fieldset { border: 0; }

.ws-fr__field label input[type="radio"] {
  margin-right: var(--ws-space-2);
  accent-color: var(--ws-indigo);
}

.ws-fr__field > label:not(:first-child) {
  display: inline-flex;
  align-items: center;
  margin-right: var(--ws-space-5);
}

fieldset.ws-fr__field label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: var(--ws-space-5);
}

.ws-fr__result:empty { display: none; }

.ws-fr__result {
  padding: var(--ws-space-5);
  border-radius: var(--ws-radius-image);
  background: var(--ws-stone);
}

.ws-fr__headline {
  margin-bottom: var(--ws-space-1);
  font-family: var(--ws-font-display);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--ws-ink);
}

.ws-fr__headline strong { font-variant-numeric: tabular-nums; }

.ws-fr__breakdown {
  margin: var(--ws-space-3) 0 0;
  color: var(--ws-muted);
}

/* The worked examples are the no-JS view; once the calculator is live they
   move below it as a reference rather than the main answer. */
.ws-fr__static { margin-top: var(--ws-space-6); }

.ws-fr__disclaimer {
  margin: var(--ws-space-5) 0 0;
  color: var(--ws-muted);
}
