/* ============================================================
   CarInsureCalc — Complete Stylesheet (2026)
   ============================================================ */

:root {
    --primary: #0c4a6e;
    --primary-light: #0ea5e9;
    --primary-dark: #082f49;
    --accent: #7dd3fc;
    --accent-light: #e0f2fe;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;
    --border: #e5e7eb;
    --border-light: #f1f5f9;
    --success: #059669;
    --success-bg: #d1fae5;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --error: #dc2626;
    --error-bg: #fee2e2;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --max-width: 1200px;
    --header-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-height); background: rgba(255,255,255,0.95); border-bottom: 1px solid var(--border); z-index: 1000; backdrop-filter: blur(10px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.25rem; }
.logo svg { flex-shrink: 0; }
.main-nav { display: flex; gap: 0.5rem; }
.nav-link { padding: 0.5rem 1rem; text-decoration: none; color: var(--text-light); font-weight: 500; font-size: 0.875rem; border-radius: var(--radius-sm); transition: all 0.2s; }
.nav-link:hover { color: var(--primary); background: var(--accent-light); }
.mobile-menu-btn { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.mobile-menu-btn span { display: block; width: 24px; height: 2px; background: var(--text); transition: all 0.3s; border-radius: 1px; }
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Hero */
.hero { padding: calc(var(--header-height) + 3rem) 0 3rem; text-align: center; background: linear-gradient(135deg, var(--bg-alt) 0%, var(--accent-light) 100%); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; color: var(--text); margin-bottom: 1rem; line-height: 1.2; }
.hero-subtitle { font-size: 1.125rem; color: var(--text-light); max-width: 700px; margin: 0 auto 1.5rem; }
.hero-badges { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.5rem 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 100px; font-size: 0.875rem; font-weight: 500; color: var(--primary); }

/* Ad Units */
.ad-unit { margin: 2rem auto; text-align: center; min-height: 90px; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border-radius: var(--radius); border: 1px dashed var(--border); }
.ad-banner { max-width: 728px; min-height: 90px; }
.ad-inline { max-width: 100%; min-height: 250px; }
.ad-unit::before { content: 'Advertisement'; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Hub Grid */
.hub-grid { padding: 3rem 0; }
.hub-grid h2 { text-align: center; font-size: 1.75rem; font-weight: 700; margin-bottom: 2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.calc-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: all 0.3s; cursor: default; }
.calc-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--accent); }
.calc-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.calc-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.calc-card p { font-size: 0.875rem; color: var(--text-light); margin-bottom: 1rem; }

/* Calculator Sections */
.calculator-section { padding: 3rem 0; scroll-margin-top: calc(var(--header-height) + 1rem); }
.calculator-section.alt-bg { background: var(--bg-alt); }
.calc-header { text-align: center; margin-bottom: 2rem; }
.calc-header h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.calc-description { color: var(--text-light); max-width: 600px; margin: 0 auto; }

.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .calc-layout { grid-template-columns: 1fr; } }

/* Inputs */
.calc-inputs { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.input-group { margin-bottom: 1.25rem; }
.input-group label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.input-group input, .input-group select { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 1rem; background: var(--bg); transition: border-color 0.2s, box-shadow 0.2s; }
.input-group input:focus, .input-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12, 74, 110, 0.1); }
.input-group small { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Checkbox Group */
.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; }
.checkbox-label { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; font-weight: 400; cursor: pointer; padding: 0.375rem; border-radius: var(--radius-sm); transition: background 0.2s; }
.checkbox-label:hover { background: var(--bg-alt); }
.checkbox-label input[type="checkbox"] { width: auto; margin-top: 0.125rem; accent-color: var(--primary); }

/* Buttons */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.875rem 1.5rem; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; width: 100%; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-reset { display: inline-flex; align-items: center; justify-content: center; padding: 0.625rem 1rem; background: transparent; color: var(--text-light); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; cursor: pointer; transition: all 0.2s; width: 100%; margin-top: 0.75rem; }
.btn-reset:hover { background: var(--border-light); color: var(--text); }

/* Results */
.calc-results { position: sticky; top: calc(var(--header-height) + 1rem); }
.results-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; background: var(--bg); border: 2px dashed var(--border); border-radius: var(--radius); text-align: center; color: var(--text-muted); min-height: 300px; }
.placeholder-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

.results-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.results-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.results-header h3 { font-size: 1.125rem; font-weight: 600; }
.filing-badge { padding: 0.375rem 0.75rem; background: var(--accent-light); color: var(--primary); border-radius: 100px; font-size: 0.75rem; font-weight: 600; }

.results-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; padding: 1.5rem; border-bottom: 1px solid var(--border); }
.summary-item { display: flex; flex-direction: column; gap: 0.25rem; }
.summary-item .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.summary-item .value { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.summary-item.highlight .value { font-size: 1.5rem; color: var(--primary); }
.summary-item.highlight.success .value { color: var(--success); }
.summary-item.highlight.warning .value { color: var(--warning); }
.summary-item .value.primary { color: var(--primary); }
.summary-item .value.credit { color: var(--success); }
.summary-item .value.owed { color: var(--error); }

.results-detail { padding: 1.5rem; }
.results-detail h4 { font-size: 0.875rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }

.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 0.625rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.875rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row.deduction { color: var(--text-light); }
.detail-row.credit { color: var(--success); font-weight: 600; }
.detail-row.owed { color: var(--error); }
.detail-row.subtotal { font-weight: 600; border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); }
.detail-row.total { font-weight: 700; font-size: 1rem; border-top: 2px solid var(--border); margin-top: 0.5rem; padding-top: 1rem; }
.detail-row.total.refund { color: var(--success); }
.detail-row.total.owed { color: var(--error); }

/* Discount Breakdown */
.discount-breakdown, .savings-breakdown { padding: 1.5rem; border-top: 1px solid var(--border); }
.discount-breakdown h4, .savings-breakdown h4 { font-size: 0.875rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }

.savings-row { display: flex; justify-content: space-between; align-items: center; padding: 0.625rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.875rem; }
.savings-row:last-child { border-bottom: none; }
.savings-info { display: flex; flex-direction: column; gap: 0.125rem; }
.savings-name { font-weight: 500; }
.savings-pct { font-size: 0.75rem; color: var(--text-muted); }
.savings-amount { font-weight: 600; }
.savings-row.total { font-weight: 700; font-size: 1rem; border-top: 2px solid var(--border); margin-top: 0.5rem; padding-top: 1rem; }

/* Coverage Comparison Cards */
.coverage-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; padding: 1.5rem; }
.coverage-card { background: var(--bg-alt); border: 2px solid var(--border); border-radius: var(--radius); padding: 1.25rem; transition: all 0.3s; }
.coverage-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.coverage-card.recommended { border-color: var(--success); background: var(--success-bg); }
.coverage-card.cheapest { border-color: var(--primary); }
.coverage-card h4 { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text); }
.coverage-price { font-size: 1.75rem; font-weight: 800; color: var(--primary); margin-bottom: 0.5rem; }
.coverage-price span { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.coverage-details { font-size: 0.75rem; color: var(--text-light); margin-bottom: 1rem; }
.coverage-details p { padding: 0.25rem 0; }
.coverage-monthly { font-size: 1rem; font-weight: 600; color: var(--text); }
.coverage-diff { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }

/* State Comparison */
.state-comparison { padding: 1.5rem; border-top: 1px solid var(--border); }
.state-comparison h4 { font-size: 0.875rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }

/* Vehicle Comparison */
.vehicle-comparison { padding: 1.5rem; }
.vehicle-row { display: grid; grid-template-columns: 1fr 1fr 120px; gap: 1rem; align-items: center; padding: 0.875rem 0; border-bottom: 1px solid var(--border-light); transition: background 0.2s; }
.vehicle-row:hover { background: var(--bg-alt); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; border-radius: var(--radius-sm); }
.vehicle-row.best-value { background: var(--success-bg); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; border-radius: var(--radius-sm); }
.vehicle-row.expensive { background: var(--error-bg); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; border-radius: var(--radius-sm); }
.vehicle-info { display: flex; flex-direction: column; gap: 0.125rem; }
.vehicle-name { font-weight: 600; font-size: 0.875rem; }
.vehicle-desc { font-size: 0.75rem; color: var(--text-muted); }
.vehicle-bar-container { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.vehicle-bar-fill { height: 100%; background: linear-gradient(90deg, var(--success), var(--warning), var(--error)); border-radius: 4px; transition: width 0.5s ease; }
.vehicle-price { display: flex; flex-direction: column; align-items: flex-end; gap: 0.125rem; }
.price-annual { font-weight: 700; font-size: 0.875rem; }
.price-monthly { font-size: 0.75rem; color: var(--text-muted); }
.price-diff { font-size: 0.75rem; }

/* Age Milestone Chart */
.age-milestone-chart { padding: 1.5rem; border-top: 1px solid var(--border); }
.age-milestone-chart h4 { font-size: 0.875rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.age-bar { display: grid; grid-template-columns: 60px 1fr 100px; gap: 1rem; align-items: center; padding: 0.5rem 0; }
.age-bar.current { background: var(--accent-light); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; border-radius: var(--radius-sm); }
.age-label { font-weight: 600; font-size: 0.875rem; }
.age-progress { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.age-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 4px; transition: width 0.5s ease; }
.age-price { font-weight: 600; font-size: 0.875rem; text-align: right; }

/* Winner Banner */
.winner-banner { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem; background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.winner-banner.winner-buy { background: var(--success-bg); border-color: var(--success); }
.winner-banner.winner-rent { background: var(--accent-light); border-color: var(--accent); }
.winner-icon { font-size: 1.5rem; }
.winner-text { font-weight: 600; font-size: 1rem; }

/* Info Boxes */
.info-box { padding: 1.25rem 1.5rem; background: var(--bg-alt); border-left: 4px solid var(--primary); margin: 1rem 1.5rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.info-box.success { border-left-color: var(--success); background: var(--success-bg); }
.info-box.warning { border-left-color: var(--warning); background: var(--warning-bg); }
.info-box h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; }
.info-box p { font-size: 0.875rem; color: var(--text-light); line-height: 1.6; margin-bottom: 0.5rem; }
.info-box ul { list-style: none; padding-left: 0; font-size: 0.875rem; color: var(--text-light); }
.info-box ul li { padding: 0.25rem 0; padding-left: 1.25rem; position: relative; }
.info-box ul li::before { content: '•'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.info-box small { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.75rem; }

/* Disclaimer */
.disclaimer { padding: 1rem 1.5rem; background: var(--warning-bg); border-top: 1px solid var(--border); }
.disclaimer p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

/* Error */
.error-message { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2rem; background: var(--error-bg); border: 1px solid var(--error); border-radius: var(--radius); color: var(--error); }
.error-icon { font-size: 2rem; }

/* FAQ */
.faq-section { padding: 3rem 0; background: var(--bg-alt); }
.faq-section h2 { text-align: center; font-size: 1.75rem; font-weight: 700; margin-bottom: 2rem; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1rem; }
.faq-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-item summary { padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--primary); transition: transform 0.3s; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 1.25rem 1.25rem; font-size: 0.875rem; color: var(--text-light); line-height: 1.6; }

/* Footer */
.site-footer { background: var(--bg-dark); color: var(--text-muted); padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand .logo { color: white; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; max-width: 300px; }
.footer-links h4 { color: white; font-size: 0.875rem; font-weight: 600; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-links a { display: block; color: var(--text-muted); text-decoration: none; font-size: 0.875rem; padding: 0.375rem 0; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; text-align: center; }
.footer-bottom p { font-size: 0.75rem; margin-bottom: 0.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 1rem; }
    .main-nav.active { display: flex; }
    .mobile-menu-btn { display: flex; }
    .hero { padding: calc(var(--header-height) + 2rem) 0 2rem; }
    .hero h1 { font-size: 1.75rem; }
    .grid { grid-template-columns: 1fr; }
    .calc-layout { grid-template-columns: 1fr; }
    .calc-results { position: static; }
    .results-summary { grid-template-columns: 1fr 1fr; }
    .coverage-comparison { grid-template-columns: 1fr; }
    .vehicle-row { grid-template-columns: 1fr; gap: 0.5rem; }
    .vehicle-bar-container { width: 100%; }
    .age-bar { grid-template-columns: 50px 1fr 80px; }
    .faq-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .results-summary { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .ad-banner { min-height: 50px; }
    .ad-inline { min-height: 150px; }
}

/* Print */
@media print {
    .site-header, .ad-unit, .btn-primary, .btn-reset, .mobile-menu-btn { display: none !important; }
    .calculator-section { page-break-inside: avoid; }
    .results-card { border: 1px solid #000; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}
input:focus, select:focus, button:focus, a:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-contrast: high) { :root { --border: #000; --text-light: #333; } }
