/*
 * calculator.css — Threshr
 *
 * Styles specific to the calculator homepage (index.html): hero section,
 * two-column grid layout, sticky results panel, occupancy slider tick, and
 * the extras-tip info block.
 *
 * Shared component styles (cards, buttons, inputs, verdict, flags …) live
 * in components.css. Design tokens live in base.css.
 */

/* ─── Hero section ────────────────────────────────────────────────────────── */

.hero {
  margin: 2.75rem 0 2.5rem;
  padding: 0 0.25rem;
}

.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
  letter-spacing: -0.035em;
}
.hero h1 .soft   { font-weight: 600; }
.hero h1 .accent {
  font-weight: 800;
  font-size: 1.13em;
  background: linear-gradient(100deg, #4A35BE 0%, #8A5CF0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent); /* fallback */
}

.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
  font-weight: 500;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  margin-top: 1.75rem;
}
.trust-item { display: flex; align-items: center; gap: 0.6rem; }
.trust-item svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.trust-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.trust-text strong { color: var(--text-primary); font-weight: 700; }

.hero-aside {
  margin-top: 1.75rem;
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}
.hero-aside a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
.hero-aside a:hover { text-decoration: underline; }

/* ─── Two-column calculator grid ──────────────────────────────────────────── */

/* Mobile: single column (default) */
.calc-grid  { display: block; }
.calc-left  { min-width: 0; }
.calc-right { min-width: 0; }

/* Desktop: 3-part inputs | 2-part results */
@media (min-width: 1024px) {
  .calc-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.25rem;
    align-items: stretch;
    margin-bottom: 1.1rem;
  }
  .calc-left .section:last-child { margin-bottom: 0; }
}

/* ─── Sticky results panel ────────────────────────────────────────────────── */

.results-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 1.85rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 6px 28px rgba(26,23,38,0.05);
}

@media (min-width: 1024px) {
  .results-panel {
    position: sticky;
    top: 1.5rem;
    margin-bottom: 0;
  }
}

.results-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.results-net       { margin-bottom: 1.6rem; }
.results-net-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; margin-bottom: 5px; }
.results-net-value {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--text-primary);
}
.results-occ { margin-bottom: 1.6rem; }

/* ─── Occupancy slider with threshold tick ────────────────────────────────── */

.occ-slider-wrap {
  position: relative;
  height: 34px;
  margin-top: 6px;
}
.occ-slider-wrap input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 6px;
  left: 0;
  width: 100%;
  margin: 0;
  height: 6px;
  z-index: 3;
  /* Fill driven by JS-set custom properties --occ-color and --occ-fill */
  background: linear-gradient(
    to right,
    var(--occ-color, var(--accent)) 0%,
    var(--occ-color, var(--accent)) var(--occ-fill, 68%),
    var(--border) var(--occ-fill, 68%),
    var(--border) 100%
  );
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.occ-slider-wrap input[type=range]:focus-visible {
  outline: 2px solid var(--occ-color, var(--accent));
  outline-offset: 3px;
  border-radius: 3px;
}
.occ-slider-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--occ-color, var(--accent));
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(26, 23, 38, 0.25);
  margin-top: -7px;
}
.occ-slider-wrap input[type=range]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}
.occ-slider-wrap input[type=range]::-moz-range-progress {
  height: 6px;
  border-radius: 3px 0 0 3px;
  background: var(--occ-color, var(--accent));
}
.occ-slider-wrap input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--occ-color, var(--accent));
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(26, 23, 38, 0.25);
}

/* Vertical tick marking the 182-day / 70-day regulatory threshold */
.occ-tick {
  position: absolute;
  top: 1px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translateX(-50%);
  transition: left 0.2s ease;
}
.occ-tick-mark  { width: 2px; height: 15px; background: var(--text-primary); border-radius: 1px; }
.occ-tick-label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; margin-top: 4px; white-space: nowrap; }

.occ-statement {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

/* ─── Inline-editable slider value labels ─────────────────────────────────── */

#oval, #rval, #pval, #mval {
  cursor: text;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-color: var(--text-secondary);
  text-underline-offset: 3px;
}

#oval:hover, #rval:hover, #pval:hover, #mval:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.inline-edit-input {
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  outline: none;
  padding: 0;
  min-width: 3ch;
}

/* ─── Mobile overrides ────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .hero h1 { font-size: 2.1rem; }
}

.print-summary {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 2cm;
  }

  html,
  body {
    background: #FFFFFF !important;
    color: #111111 !important;
    font-size: 10.5pt;
    line-height: 1.45;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #splash,
  .site-header,
  .hero,
  .calc-left,
  .export-bar,
  .version-note,
  .modal-overlay,
  .cookie-consent,
  .cookie-settings,
  .disclaimer,
  #site-footer,
  .site-footer,
  script {
    display: none !important;
  }

  .wrap {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-summary {
    display: block;
    margin: 0 0 12pt;
    padding-bottom: 10pt;
    border-bottom: 1px solid #D9D6E5;
  }

  .print-summary h1 {
    margin: 0 0 4pt;
    color: #111111 !important;
    font-size: 20pt;
    line-height: 1.15;
    letter-spacing: 0;
  }

  .print-summary p {
    margin: 0;
    color: #444444 !important;
    font-size: 10pt;
  }

  .calc-grid {
    display: block !important;
    margin: 0 0 10pt !important;
  }

  .calc-right,
  .section,
  .results-panel,
  .tax-panel,
  .metrics,
  .flag,
  .verdict {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .section,
  .results-panel {
    margin: 0 0 10pt !important;
    padding: 12pt !important;
    background: #FFFFFF !important;
    border: 1px solid #D9D6E5 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .results-panel {
    position: static !important;
  }

  .results-head,
  .section-head {
    color: #4A35BE !important;
    margin-bottom: 8pt !important;
  }

  .results-net-value {
    font-size: 26pt;
    color: #111111 !important;
  }

  .tax-panel,
  .metric,
  .flag,
  .verdict,
  .info {
    background: #FFFFFF !important;
    color: #111111 !important;
    border-color: #D9D6E5 !important;
    box-shadow: none !important;
  }

  .tax-row,
  .metric,
  .flag {
    background: #FFFFFF !important;
    color: #111111 !important;
  }

  .tax-row {
    display: flex !important;
    justify-content: space-between !important;
    gap: 12pt;
    padding: 5pt 0 !important;
    border-bottom: 1px solid #ECEAF3;
  }

  .tax-row span:first-child {
    min-width: 0;
  }

  .tax-row span:last-child {
    text-align: right;
    white-space: nowrap;
  }

  .metrics {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8pt !important;
  }

  .metric {
    padding: 8pt !important;
    border: 1px solid #D9D6E5 !important;
  }

  .metric-value,
  .good,
  .warn,
  .bad,
  .results-net-value,
  #mo-net,
  #mo-net-row {
    color: #111111 !important;
  }

  .occ-slider-wrap,
  input,
  button {
    display: none !important;
  }
}
