/* ===================================================================
   COVERAGE CALCULATOR — CSS
   All styles use #ow-calc wrapper for specificity (beats HubSpot theme)
   Edit colors/spacing via CSS variables below — single source of truth
   =================================================================== */

/* --- DESIGN TOKENS (edit these to change the whole page) --- */
#ow-calc {
  --green: #009368;
  --green-accent: #3FB48E;
  --green-tint: #CFE9E0;
  --green-tint-light: #E8F4EF;
  --text-dark: #09152B;
  --text-body: #374151;
  --text-muted: #64748B;
  --text-on-green: rgba(255,255,255,0.95);
  --text-on-green-sub: rgba(255,255,255,0.85);
  --white: #FFFFFF;
  --bg-input: #F7F9FC;
  --bg-card: #F3F4F3;
  --border: #E2E8F0;
  --border-input: #D1D9E6;
  --red: #DC2626;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --slider-fill: var(--green);
  --slider-track: var(--border);
}

/* --- RESET (scoped) --- */
#ow-calc, #ow-calc * { margin: 0; padding: 0; box-sizing: border-box; }
#ow-calc { font-family: var(--font); color: var(--text-dark); line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* --- HERO --- */
#ow-calc .hero { background: var(--green); padding: clamp(48px, 8vw, 88px) 24px clamp(40px, 6vw, 72px); text-align: center; }
#ow-calc .hero h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 600; line-height: 1.15; margin-bottom: 16px; color: var(--white); max-width: 900px; margin-left: auto; margin-right: auto; }
#ow-calc .hero h1 span { font-weight: 700; }
#ow-calc .hero p { font-size: clamp(15px, 2vw, 18px); color: var(--text-on-green); max-width: 640px; margin: 0 auto; font-weight: 400; }

/* --- LAYOUT --- */
#ow-calc .calculator-wrapper { max-width: 1100px; margin: 0 auto; padding: 48px 24px 60px; }
#ow-calc .calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 48px; }

/* --- CARDS --- */
#ow-calc .card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
#ow-calc .card-label { font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dark); margin-bottom: 20px; }

/* --- INPUTS --- */
#ow-calc .input-group { margin-bottom: 20px; }
#ow-calc .input-group:last-child { margin-bottom: 0; }
#ow-calc .input-group .input-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
#ow-calc .input-label span:first-child { font-size: 14px; font-weight: 500; color: var(--text-dark); }
#ow-calc .input-label .input-hint { font-size: 12px; color: var(--text-muted); font-weight: 500; }
#ow-calc .input-field-wrap { position: relative; }
#ow-calc .input-field-wrap .prefix { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 600; color: var(--text-muted); pointer-events: none; left: 14px; }
#ow-calc input[type="text"] { width: 100%; background: var(--bg-input); border: 1.5px solid var(--border-input); border-radius: var(--radius-sm); padding: 12px 14px 12px 30px; font-family: var(--font); font-size: 16px; font-weight: 600; color: var(--text-dark); transition: border-color 0.2s, box-shadow 0.2s; -moz-appearance: textfield; }
#ow-calc input[type="text"]:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,147,104,0.15); }

/* --- SECTION DIVIDERS --- */
#ow-calc .input-section-divider { height: 1px; background: var(--border); margin: 24px 0; }
#ow-calc .input-section-label { font-size: 14px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--green); margin-bottom: 16px; }

/* --- SLIDERS --- */
#ow-calc .slider-group { margin-bottom: 20px; }
#ow-calc .slider-group:last-child { margin-bottom: 0; }
#ow-calc .slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#ow-calc .slider-header .slider-name { font-size: 14px; font-weight: 500; color: var(--text-dark); }
#ow-calc .slider-header .slider-value-display { font-size: 20px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; min-width: 50px; text-align: right; }
#ow-calc .slider-hint { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
#ow-calc .slider-wrap { position: relative; display: flex; align-items: center; gap: 12px; }
#ow-calc .slider-min, #ow-calc .slider-max { font-size: 11px; color: var(--text-muted); font-weight: 500; flex-shrink: 0; min-width: 28px; }
#ow-calc .slider-max { text-align: right; }
#ow-calc input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 4px; background: var(--border); outline: none; cursor: pointer; }
#ow-calc input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--green); cursor: pointer; border: 3px solid var(--white); box-shadow: 0 1px 4px rgba(0,0,0,0.2); transition: transform 0.15s, box-shadow 0.15s; }
#ow-calc input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,147,104,0.35); }
#ow-calc input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--green); cursor: pointer; border: 3px solid var(--white); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
#ow-calc input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: var(--border); }

/* --- BREAKDOWN --- */
#ow-calc .breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bg-card); }
#ow-calc .breakdown-row:last-of-type { border-bottom: none; }
#ow-calc .breakdown-row .label { font-size: 14px; color: var(--text-body); font-weight: 500; }
#ow-calc .breakdown-row .value { font-size: 14px; font-weight: 600; color: var(--text-dark); font-variant-numeric: tabular-nums; }
#ow-calc .breakdown-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; margin-top: 12px; background: var(--green-tint-light); border-radius: var(--radius-sm); border: 1px solid var(--green-tint); }
#ow-calc .breakdown-total .label { font-size: 15px; font-weight: 600; color: var(--green); }
#ow-calc .breakdown-total .value { font-size: 18px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }

/* --- PIE CHART --- */
#ow-calc .cost-pie-container { margin-top: 20px; margin-bottom: 8px; display: flex; justify-content: center; }
#ow-calc .cost-pie-canvas { max-width: 360px; max-height: 360px; }
#ow-calc .bar-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
#ow-calc .bar-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-body); font-weight: 500; }
#ow-calc .bar-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* --- REALITY SECTION --- */
#ow-calc .reality-section { margin-bottom: 40px; }
#ow-calc .reality-section .section-title { font-size: clamp(24px, 3.5vw, 36px); font-weight: 600; color: var(--text-dark); margin-bottom: 24px; text-align: center; }
#ow-calc .reality-section .section-title span { color: var(--green); }
#ow-calc .math-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 32px; }
#ow-calc .math-step { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 16px; text-align: center; }
#ow-calc .math-step .step-number { font-size: 28px; font-weight: 800; color: var(--green); line-height: 1; margin-bottom: 6px; }
#ow-calc .math-step .step-label { font-size: 12px; color: var(--text-body); font-weight: 500; }
#ow-calc .math-step.highlight { background: var(--green); }
#ow-calc .math-step.highlight .step-number, #ow-calc .math-step.highlight .step-label { color: var(--white); }

/* --- BIG RESULTS --- */
#ow-calc .big-results { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 40px; }
#ow-calc .big-result-card { background: var(--green); border-radius: var(--radius-lg); padding: 32px; text-align: center; }
#ow-calc .big-result-card .result-label { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-on-green); margin-bottom: 8px; }
#ow-calc .big-result-card .result-value { font-size: clamp(32px, 5vw, 44px); font-weight: 800; color: var(--white); line-height: 1.1; font-variant-numeric: tabular-nums; }
#ow-calc .big-result-card .result-sub { font-size: 13px; color: var(--text-on-green-sub); margin-top: 4px; font-weight: 500; }

/* --- WARNING --- */
#ow-calc .warning-box { background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: var(--radius-md); padding: 24px; margin-bottom: 40px; }
#ow-calc .warning-box h3 { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 14px; }
#ow-calc .warning-list { list-style: none; padding: 0; }
#ow-calc .warning-list li { font-size: 14px; color: var(--text-body); padding: 5px 0 5px 24px; position: relative; }
#ow-calc .warning-list li::before { content: "\2717"; position: absolute; left: 0; color: var(--red); font-weight: 700; font-size: 13px; }

/* --- HIDDEN COSTS --- */
#ow-calc .hidden-costs { background: var(--green-tint-light); border: 1px solid var(--green-tint); border-radius: var(--radius-lg); padding: 32px; margin-bottom: 48px; }
#ow-calc .hidden-costs h3 { font-size: 16px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
#ow-calc .hidden-costs .subtitle { font-size: 13px; color: var(--text-body); margin-bottom: 16px; }
#ow-calc .hidden-costs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
#ow-calc .hidden-cost-item { font-size: 14px; color: var(--text-body); padding: 6px 0 6px 26px; position: relative; }
#ow-calc .hidden-cost-item::before { content: "+"; position: absolute; left: 0; color: var(--green); font-weight: 700; font-size: 16px; }

/* --- CTA --- */
#ow-calc .cta-section { text-align: center; background: var(--green); border-radius: 20px; padding: 56px 32px; }
#ow-calc .cta-section h2 { font-size: clamp(20px, 3vw, 28px); font-weight: 700; color: var(--white); margin-bottom: 12px; max-width: 600px; margin-left: auto; margin-right: auto; }
#ow-calc .cta-section p { font-size: 15px; color: var(--text-on-green); margin-bottom: 28px; max-width: 500px; margin-left: auto; margin-right: auto; }
#ow-calc .cta-button { display: inline-block; background: var(--white); color: var(--green); font-family: var(--font); font-size: 17px; font-weight: 600; padding: 16px 32px; border-radius: var(--radius-sm); text-decoration: none; transition: background 0.2s, transform 0.15s, box-shadow 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
#ow-calc .cta-button:hover { background: #F0FDF4; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* --- FOOTER --- */
#ow-calc .footer-note { text-align: center; margin-top: 40px; font-size: 12px; color: var(--text-muted); }

/* --- MOBILE --- */
@media (max-width: 768px) { #ow-calc .calc-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { #ow-calc .big-results { grid-template-columns: 1fr; } }
@media (max-width: 600px) { #ow-calc .hidden-costs-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  #ow-calc .hero { padding: 32px 16px 28px; }
  #ow-calc .hero h1 { font-size: 24px; }
  #ow-calc .hero p { font-size: 14px; }
  #ow-calc .hero img { height: 28px !important; margin-bottom: 16px !important; }
  #ow-calc .calculator-wrapper { padding: 24px 12px 40px; }
  #ow-calc .card { padding: 18px 14px; border-radius: var(--radius-md); }
  #ow-calc .card-label { font-size: 11px; margin-bottom: 14px; }
  #ow-calc .input-section-label { font-size: 12px; }
  #ow-calc .input-label span:first-child { font-size: 13px; }
  #ow-calc input[type="text"] { font-size: 15px; padding: 10px 12px 10px 26px; }
  #ow-calc .slider-header .slider-value-display { font-size: 17px; }
  #ow-calc .breakdown-total .label { font-size: 13px; }
  #ow-calc .breakdown-total .value { font-size: 16px; }
  #ow-calc .cost-pie-canvas { max-width: 280px; max-height: 280px; }
  #ow-calc .bar-legend { gap: 6px 12px; justify-content: center; }
  #ow-calc .math-steps { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  #ow-calc .math-step { padding: 14px 10px; border-radius: var(--radius-md); }
  #ow-calc .math-step .step-number { font-size: 22px; }
  #ow-calc .math-step .step-label { font-size: 11px; }
  #ow-calc .big-result-card { padding: 24px 16px; border-radius: var(--radius-md); }
  #ow-calc .big-result-card .result-value { font-size: 28px; }
  #ow-calc .warning-box { padding: 18px 14px; }
  #ow-calc .hidden-costs { padding: 22px 16px; border-radius: var(--radius-md); }
  #ow-calc .cta-section { padding: 36px 18px; border-radius: 14px; }
  #ow-calc .cta-section h2 { font-size: 18px; }
  #ow-calc .cta-button { font-size: 15px; padding: 14px 24px; }
}