/*
 * Book-of-Business Growth Calculator - Stylesheet
 *
 * Common Wealth brand palette (Emerald/Spruce).
 * Typography: Inter via Google Fonts.
 *
 * ASCII only -- no em dashes or curly quotes in this file.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* -- CW Brand Palette -- */
  --cw-emerald: #00ce7c;
  --cw-emerald-light: #00eaa8;
  --cw-emerald-dark: #018c5a;
  --cw-spruce: #014751;
  --cw-spruce-light: #027985;
  --cw-spruce-dark: #002329;
  --cw-pistachio: #BAEE95;
  --cw-pistachio-light: #eeffd9;
  --cw-sand: #c2b26e;
  --cw-plum: #331f40;
  --cw-plum-light: #5b3a6d;
  --cw-lilac: #c5b6f1;
  --cw-chartreuse: #c6d92f;
  --cw-cloud: #fcfcf7;
  --cw-cloud-d1: #dbdbd7;
  --cw-cloud-d2: #bbbbb7;
  --cw-cloud-d3: #9c9c99;
  --cw-cloud-d4: #7e7e7c;
  /* Semantic aliases */
  --cw-green: var(--cw-emerald);
  --cw-dark: var(--cw-spruce);
  --cw-white: var(--cw-cloud);
  --cw-gray-200: var(--cw-cloud-d1);
  --cw-gray-300: var(--cw-cloud-d2);
  --cw-gray-600: var(--cw-cloud-d3);
  --cw-gray-800: var(--cw-cloud-d4);
  --cw-orange: #FF8A50;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cw-spruce);
  color: var(--cw-cloud);
  min-height: 100vh;
  width: 100%;
}

/* Focus indicators - accessibility */
:focus-visible {
  outline: 2px solid var(--cw-emerald);
  outline-offset: 2px;
}

/* -- Top Navigation Bar -- */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(1, 71, 81, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 206, 124, 0.15);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 60px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 600; letter-spacing: -0.5px;
  color: var(--cw-cloud); text-decoration: none;
}

.nav-title {
  font-size: 14px; font-weight: 500; color: var(--cw-cloud-d2);
  letter-spacing: 0.5px;
}

/* -- Main Content -- */
.main-content {
  padding: 100px 60px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.subtitle {
  font-size: 20px; color: var(--cw-emerald); font-weight: 500;
  margin-bottom: 8px;
}

h1 {
  font-size: 36px; font-weight: 600; line-height: 1.2;
  letter-spacing: -1px; margin-bottom: 20px;
  color: var(--cw-cloud);
}

h3 {
  font-size: 22px; font-weight: 600; margin-bottom: 16px;
  color: var(--cw-emerald);
}

.accent { color: var(--cw-emerald); }

p.intro {
  font-size: 18px; line-height: 1.7; color: var(--cw-cloud-d1);
  max-width: 800px; margin-bottom: 8px;
}

/* -- Calculator -- */
.calculator {
  background: rgba(252,252,247,0.04);
  border: 1px solid rgba(252,252,247,0.1);
  border-radius: 20px; padding: 36px;
  margin-top: 24px;
}

.calc-inputs {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px;
  margin-bottom: 32px;
}

.calc-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--cw-cloud-d2); margin-bottom: 8px; text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-field input, .calc-field select {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(252,252,247,0.12);
  background: rgba(252,252,247,0.06);
  color: var(--cw-cloud); font-size: 15px; font-family: inherit;
  font-weight: 500; transition: all 0.2s;
}

.calc-field input:focus, .calc-field select:focus {
  outline: none; border-color: var(--cw-emerald);
  box-shadow: 0 0 0 3px rgba(0, 206, 124, 0.15);
}

.calc-field input::placeholder { color: var(--cw-cloud-d3); }

.calc-field .input-hint {
  font-size: 11px; color: var(--cw-cloud-d3); margin-top: 4px;
}

.calc-field input[type="range"] {
  -webkit-appearance: none; height: 6px; border-radius: 3px;
  background: rgba(252,252,247,0.12); padding: 0; border: none;
  cursor: pointer;
}

.calc-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--cw-emerald); cursor: pointer; border: 2px solid var(--cw-spruce);
}

.slider-row {
  display: flex; align-items: center; gap: 12px;
}

.slider-row input[type="range"] { flex: 1; }

.slider-value {
  font-size: 16px; font-weight: 600; color: var(--cw-emerald);
  min-width: 48px; text-align: right;
}

.calc-toggle {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; cursor: pointer; border-radius: 10px;
  background: rgba(252,252,247,0.05); border: 1px solid rgba(252,252,247,0.08);
  margin-bottom: 16px; user-select: none; transition: background 0.2s;
}

.calc-toggle:hover { background: rgba(252,252,247,0.08); }
.calc-toggle span:first-child { font-size: 14px; font-weight: 600; color: var(--cw-cloud); }

.calc-toggle-icon { font-size: 12px; color: var(--cw-emerald); transition: transform 0.3s; }
.calc-toggle-icon.collapsed { transform: rotate(-90deg); }

.calc-collapsible {
  max-height: 600px; overflow: hidden; transition: max-height 0.4s ease;
}

.calc-collapsible.collapsed {
  max-height: 0;
}

.calc-chart {
  margin-top: 32px; padding: 24px;
  background: rgba(252,252,247,0.03);
  border-radius: 14px;
}

.chart-bar-row {
  display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
}

.chart-bar-year {
  font-size: 14px; font-weight: 600; width: 60px; text-align: right;
  color: var(--cw-cloud-d2);
}

.chart-bar-track {
  flex: 1; height: 32px; background: rgba(252,252,247,0.04);
  border-radius: 8px; overflow: hidden; position: relative;
}

.chart-bar-fill-aum {
  position: absolute; top: 0; left: 0; height: 50%;
  background: var(--cw-emerald);
  border-radius: 4px 4px 0 0; transition: width 0.8s ease;
}

.chart-bar-fill-rev {
  position: absolute; bottom: 0; left: 0; height: 50%;
  background: var(--cw-pistachio);
  border-radius: 0 0 4px 4px; transition: width 0.8s ease;
}

.chart-bar-value {
  font-size: 13px; font-weight: 600; width: 200px;
  color: var(--cw-cloud-d1); display: flex; gap: 12px;
}

.chart-bar-value .aum-val { color: var(--cw-emerald); }
.chart-bar-value .rev-val { color: var(--cw-pistachio); }

/* -- Footer -- */
.footer {
  margin-top: 48px; padding: 24px 0;
  border-top: 1px solid rgba(252,252,247,0.06);
  text-align: center;
  font-size: 13px; color: var(--cw-cloud-d3);
}

/* -- Responsive: Tablet (max 1024px) -- */
@media (max-width: 1024px) {
  .top-nav { padding: 0 20px; }
  .main-content { padding: 80px 32px 40px; }
  h1 { font-size: 30px; }
  .chart-bar-value { width: 120px; }
}

/* -- Responsive: Small Tablet / Large Phone (max 768px) -- */
@media (max-width: 768px) {
  .top-nav { height: 52px; padding: 0 16px; }
  .main-content { padding: 72px 20px 32px; }
  h1 { font-size: 26px; margin-bottom: 14px; }
  .subtitle { font-size: 17px; }
  p.intro { font-size: 16px; line-height: 1.6; }

  .calc-inputs { grid-template-columns: 1fr; gap: 14px; }
  .calculator { padding: 24px 20px; border-radius: 16px; }

  .chart-bar-row { gap: 10px; }
  .chart-bar-year { width: 44px; font-size: 12px; }
  .chart-bar-value { width: 80px; font-size: 11px; }
}

/* -- Responsive: Phone (max 480px) -- */
@media (max-width: 480px) {
  .top-nav { padding: 0 12px; }
  .main-content { padding: 64px 16px 24px; }
  h1 { font-size: 22px; }
  p.intro { font-size: 15px; }

  .chart-bar-row { gap: 8px; flex-wrap: wrap; }
  .chart-bar-year { width: 38px; font-size: 11px; }
  .chart-bar-value { width: 100%; font-size: 11px; margin-top: 2px; }
}

/* -- Touch device affordances -- */
@media (hover: none) and (pointer: coarse) {
  .calc-toggle { padding: 14px 16px; }
}
