/* Lumenear Acoustic Calculator — Dark Theme */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-var.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dm-serif-display-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dm-serif-display-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dm-mono-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/dm-mono-medium.woff2') format('woff2');
}

:root {
  --bg: #141414;
  --surface: #1E1E1E;
  --raised: #252525;
  --border: #2E2E2E;
  --border-hover: #3a3a3a;
  --text: #F0EDEA;
  --text-sec: #8A8480;
  --accent: #C8B89A;
  --accent-dim: #7A6E60;
  --ok: #6B8F71;
  --warn: #C8891A;
  --alert: #B85C38;
  --radius: 6px;
  --radius-sm: 4px;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-mono: 'DM Mono', 'SF Mono', monospace;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
}
#root { height: 100%; }

/* ── Typography ── */
.t-display { font-family: var(--font-display); font-weight: 400; }
.t-mono { font-family: var(--font-mono); font-weight: 400; }
.t-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-sec); margin-bottom: 8px;
}
.t-step-title { font-size: 28px; font-weight: 300; color: var(--text); line-height: 1.2; }
.t-step-subtitle { font-size: 15px; color: var(--text-sec); margin-top: 6px; }

/* ── App Shell ── */
.app-shell { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* Header */
.app-header {
  background: #0C0C0C; padding: 0 28px; height: 54px; display: flex;
  align-items: center; justify-content: space-between; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.logo-mark { font-size: 16px; font-weight: 700; letter-spacing: -.5px; color: var(--text); }
.logo-sub {
  font-size: 10px; font-weight: 500; color: var(--text-sec);
  text-transform: uppercase; letter-spacing: 2px; margin-left: 12px;
}
.header-actions { display: flex; gap: 6px; }

/* Buttons */
.btn {
  padding: 8px 20px; border-radius: var(--radius-sm); font-size: 12px;
  font-weight: 600; cursor: pointer; border: none; font-family: var(--font-ui);
  transition: all .15s var(--ease); display: inline-flex; align-items: center; gap: 6px;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #111; }
.btn-primary:hover { background: #d4c4a6; }
.btn-primary:disabled { opacity: .4; cursor: default; pointer-events: none; }
.btn-ghost { background: transparent; color: var(--text-sec); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--raised); color: var(--text); border-color: var(--border-hover); }
.btn-sm { padding: 6px 14px; font-size: 11px; }
.btn-lg { padding: 12px 32px; font-size: 14px; }

/* Progress indicator */
.progress-bar {
  display: flex; align-items: center; gap: 4px; padding: 14px 28px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.progress-step {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 20px; font-size: 11px; font-weight: 500;
  color: var(--text-sec); cursor: pointer; transition: all .15s var(--ease);
  white-space: nowrap;
}
.progress-step.active { background: var(--raised); color: var(--accent); }
.progress-step.done { color: var(--ok); }
.progress-step .step-num {
  width: 22px; height: 22px; border-radius: 11px; display: flex;
  align-items: center; justify-content: center; font-size: 10px;
  font-weight: 700; background: var(--border); color: var(--text-sec);
  flex-shrink: 0; transition: all .15s var(--ease);
}
.progress-step.active .step-num { background: var(--accent); color: #111; }
.progress-step.done .step-num { background: var(--ok); color: #fff; }
.progress-connector { flex: 0 0 20px; height: 1px; background: var(--border); }

/* Step container */
.step-container {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.step-content {
  max-width: 760px; margin: 0 auto; padding: 40px 32px;
}

/* Split layout for Step 2 */
.split-layout {
  flex: 1; display: grid; grid-template-columns: 1fr 320px;
  overflow: hidden; min-height: 0;
}
.split-main { overflow-y: auto; padding: 24px 28px; }
.split-sidebar {
  background: var(--surface); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 20px;
}

/* ── Inputs ── */
.field { margin-bottom: 12px; }
.field-label {
  display: block; font-size: 11px; font-weight: 500;
  color: var(--text-sec); margin-bottom: 4px;
}
.field-input, .field-select {
  width: 100%; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-family: var(--font-ui);
  transition: border-color .15s var(--ease);
}
.field-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A8480' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
.field-input:focus, .field-select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 184, 154, .12);
}
.field-input::placeholder { color: var(--text-sec); opacity: .6; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

/* α hint below selects */
.alpha-hint { font-size: 10px; color: var(--text-sec); margin-top: 3px; font-family: var(--font-mono); }

/* Preset cards */
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.preset-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 10px; text-align: center;
  font-size: 12px; color: var(--text-sec); cursor: pointer;
  transition: all .15s var(--ease); font-weight: 500;
}
.preset-card:hover { border-color: var(--border-hover); background: var(--raised); color: var(--text); }
.preset-card.active { border-color: var(--accent); color: var(--accent); background: rgba(200,184,154,.06); }

/* Dimension grid */
.dim-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Checkboxes */
.checkbox-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  font-size: 12px; color: var(--text-sec); cursor: pointer;
}
.checkbox-row input { accent-color: var(--accent); cursor: pointer; }
.checkbox-row:hover { color: var(--text); }

/* ── Product cards ── */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; display: flex; gap: 12px;
  transition: all .15s var(--ease); cursor: default;
}
.product-card:hover { border-color: var(--border-hover); background: var(--raised); }
.product-card.selected { border-color: var(--accent); background: rgba(200,184,154,.04); }
.product-card.selected:hover { background: rgba(200,184,154,.07); }
.product-thumb {
  width: 52px; height: 52px; background: var(--raised); border-radius: var(--radius-sm);
  flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: var(--text-sec); text-transform: uppercase; letter-spacing: .5px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.product-name {
  font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-specs { display: flex; gap: 10px; font-size: 10px; color: var(--text-sec); }
.product-aeq { color: var(--accent); font-weight: 600; font-family: var(--font-mono); }
.product-family {
  font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-sec); background: var(--raised); padding: 2px 6px;
  border-radius: 3px; flex-shrink: 0;
}

/* Quantity stepper */
.qty-stepper { display: flex; align-items: center; margin-top: auto; }
.qty-btn {
  width: 28px; height: 26px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-sec); font-size: 14px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .1s var(--ease);
  font-family: var(--font-ui);
}
.qty-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.qty-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.qty-btn:hover { background: var(--raised); color: var(--text); }
.qty-btn.plus { border-color: var(--accent-dim); color: var(--accent); }
.qty-btn.plus:hover { background: rgba(200,184,154,.1); }
.qty-input {
  width: 36px; height: 26px; border: 1px solid var(--border); border-left: 0; border-right: 0;
  background: var(--surface); text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text); font-family: var(--font-mono);
}
.qty-input:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(200,184,154,.2); }

/* Filter tabs */
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tab {
  padding: 5px 12px; border-radius: 16px; font-size: 11px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: transparent;
  color: var(--text-sec); transition: all .12s var(--ease); font-family: var(--font-ui);
}
.filter-tab:hover { border-color: var(--accent-dim); color: var(--accent); }
.filter-tab.active { background: var(--accent); color: #111; border-color: var(--accent); }

/* Filter panel (Step 3 — family + light specs), collapsed by default */
.filter-panel {
  background: var(--surface); border: 1px solid rgba(200,184,154,.35);
  border-radius: var(--radius); padding: 4px 14px; margin-bottom: 16px;
  transition: border-color .15s var(--ease);
}
.filter-panel:has(.filter-panel-toggle:hover) { border-color: var(--accent); }
.filter-panel-head { display: flex; justify-content: space-between; align-items: center; }
.filter-panel-toggle {
  display: flex; align-items: center; gap: 9px; background: none; border: none;
  padding: 12px 0; margin: 0; cursor: pointer; color: var(--accent); font-family: var(--font-ui);
  flex: 1;
}
.filter-funnel-icon { color: var(--accent); flex-shrink: 0; }
.filter-panel-label {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--accent);
}
.filter-panel-toggle:hover .filter-panel-label,
.filter-panel-toggle:hover .filter-funnel-icon,
.filter-panel-toggle:hover .filter-chevron { color: var(--text); }
.filter-chevron { color: var(--accent); transition: transform .2s var(--ease); flex-shrink: 0; margin-left: auto; }
.filter-chevron.open { transform: rotate(90deg); }
.filter-count-badge {
  background: var(--accent); color: #111; font-size: 10px; font-weight: 700;
  border-radius: 10px; min-width: 16px; height: 16px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); line-height: 1;
}
.filter-panel-body {
  max-height: 0; overflow: hidden;
  transition: max-height .28s var(--ease);
}
.filter-panel-body.open { max-height: 800px; }
.filter-panel-body-inner { padding-top: 16px; padding-bottom: 10px; }
.filter-row { margin-bottom: 14px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-row-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--text-sec); margin-bottom: 8px;
}
.filter-row-value { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }
.filter-reset-btn {
  background: none; border: none; color: var(--text-sec); cursor: pointer;
  font-size: 10px; padding: 0; font-family: var(--font-ui);
}
.filter-reset-btn:hover { color: var(--accent); }

/* Dual-thumb range slider: two overlaid <input type=range>, one visible track */
.range-slider { position: relative; height: 20px; display: flex; align-items: center; }
.range-slider-track {
  position: absolute; left: 0; right: 0; height: 3px;
  background: var(--border); border-radius: 2px;
}
.range-slider-fill {
  position: absolute; height: 3px; background: var(--accent); border-radius: 2px;
}
.range-slider-input {
  position: absolute; left: 0; right: 0; width: 100%; margin: 0;
  background: transparent; -webkit-appearance: none; appearance: none;
  pointer-events: none; height: 20px;
}
.range-slider-input:focus { outline: none; z-index: 3; }
.range-slider-input::-webkit-slider-runnable-track { background: transparent; }
.range-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; cursor: pointer;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #111; margin-top: -5.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.range-slider-input::-moz-range-track { background: transparent; border: none; }
.range-slider-input::-moz-range-thumb {
  pointer-events: auto; cursor: pointer; width: 14px; height: 14px;
  border-radius: 50%; background: var(--accent); border: 2px solid #111;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* ── RT60 Meter (sticky footer) ── */
.rt60-meter {
  background: #0C0C0C; border-top: 1px solid var(--border);
  padding: 10px 28px 14px; flex-shrink: 0;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.rt60-meter.hidden { opacity: 0; transform: translateY(100%); pointer-events: none; height: 0; padding: 0; overflow: hidden; }
.meter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.meter-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-sec); }
.meter-values { display: flex; gap: 20px; font-size: 12px; }
.meter-track {
  position: relative; height: 6px; background: var(--surface);
  border-radius: 3px; overflow: visible;
}
.meter-zone {
  position: absolute; height: 100%; border-radius: 3px;
  background: var(--ok); opacity: .15;
}
.meter-marker {
  position: absolute; top: -3px; width: 4px; height: 12px;
  border-radius: 2px; transition: left .5s cubic-bezier(.4, 0, .2, 1);
}
.meter-scale {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: 8px; color: var(--text-sec);
}

/* ── Result cards ── */
.result-hero {
  display: flex; gap: 40px; align-items: center; justify-content: center;
  padding: 32px 0; margin-bottom: 24px;
}
.result-number { text-align: center; }
.result-number .label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-sec); font-weight: 600; margin-bottom: 6px;
}
.result-number .value {
  font-family: var(--font-display); font-size: 72px; line-height: 1;
  transition: color .3s var(--ease);
}
.rt-before { color: #94a3b8; }
.rt-after { color: var(--accent); }
.result-number .unit { font-size: 11px; color: var(--text-sec); margin-top: 4px; }
.result-arrow { font-size: 28px; color: var(--accent); opacity: .6; }
.result-badge {
  text-align: center; padding: 12px 20px; border-radius: 24px;
  background: rgba(107, 143, 113, .12);
}
.result-badge .pct { font-size: 28px; font-weight: 700; color: var(--ok); }
.result-badge .pct-label { font-size: 9px; color: var(--ok); margin-top: 2px; }

/* Advice box */
.advice-box {
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 13px; line-height: 1.7;
}
.advice-box.ok {
  background: rgba(107, 143, 113, .08); border: 1px solid rgba(107, 143, 113, .25);
}
.advice-box.warn {
  background: rgba(200, 137, 26, .08); border: 1px solid rgba(200, 137, 26, .25);
}
.advice-box.bad {
  background: rgba(184, 92, 56, .08); border: 1px solid rgba(184, 92, 56, .25);
}

/* Summary table */
.summary-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.summary-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.summary-table .row-label { color: var(--text-sec); width: 50%; }
.summary-table .row-value { text-align: right; font-family: var(--font-mono); }
.summary-table .row-total td {
  font-weight: 700; color: var(--accent);
  border-top: 2px solid var(--accent); border-bottom: none;
}

/* ── Animated number ── */
.animated-value { display: inline-block; }
.animated-value.bump { animation: numBump .4s var(--ease); }
@keyframes numBump {
  0% { transform: scale(1); }
  30% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Smooth volume info */
.volume-info {
  font-size: 12px; color: var(--text-sec); margin-top: 8px;
  line-height: 1.6; padding: 10px 12px; background: var(--surface);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.volume-info .vol-number {
  font-family: var(--font-mono); font-weight: 500; color: var(--text);
}

/* ── Footer nav — sticky within scrollable step-container ── */
.step-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding: 16px 0 20px;
  position: sticky; bottom: 0; z-index: 10;
  background: transparent;
}
/* Result step variant: solid bg so download/quote bar is always readable */
.step-nav.step-nav-solid {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 16px 0 24px;
}

/* Sidebar sticky action bar */
.sidebar-actions {
  position: sticky; bottom: 0; background: var(--surface);
  padding-top: 12px; margin-top: 16px; z-index: 10;
  border-top: 1px solid var(--border);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

/* @media print is handled entirely by result-styles.css */

/* ── Mobile gate — block phones, prompt desktop/tablet ── */
#mobile-gate { display: none; }
.mg-inner { max-width: 340px; }
.mg-logo { height: 30px; object-fit: contain; filter: invert(1); opacity: .95; margin-bottom: 28px; }
.mg-title { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.2; margin-bottom: 12px; }
.mg-text { font-size: 14px; color: var(--text-sec); line-height: 1.6; }
.mg-text b { color: var(--accent); font-weight: 600; }
@media screen and (max-width: 767px), screen and (max-height: 430px) and (orientation: landscape) {
  #mobile-gate {
    display: flex; position: fixed; inset: 0; z-index: 9999;
    align-items: center; justify-content: center;
    padding: 32px; text-align: center; background: var(--bg);
  }
  #root { display: none !important; }
  body { overflow: auto; }
}
