:root {
    --primary: #0c4a6e;
    --primary-light: #0369a1;
    --primary-dark: #082f49;
    --accent: #ea580c;
    --accent-hover: #c2410c;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;
    --success: #16a34a;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --radius: 8px;
    --max-width: 1200px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

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;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

img { max-width: 100%; height: auto; }

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

/* Header */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo:hover { text-decoration: none; color: var(--primary); }

.logo svg { width: 32px; height: 32px; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

.main-nav { display: flex; gap: 24px; align-items: center; }

.main-nav a {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.main-nav a:hover { color: var(--primary-light); text-decoration: none; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 16px 24px;
    font-size: 1.05rem;
    color: var(--text);
    outline: none;
}

.search-box button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-box button:hover { background: var(--accent-hover); }

/* Sections */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-dark);
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 24px;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.step h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--primary-dark); }
.step p { font-size: 0.9rem; color: var(--text-light); }

/* State grid */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.state-link {
    display: block;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.2s;
    text-decoration: none;
}

.state-link:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Info cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.2s;
}

.info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.info-card h3 {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card p { font-size: 0.9rem; color: var(--text-light); }

/* Installer cards */
.installer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.installer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.installer-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.installer-card h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.installer-card h3 a { color: var(--primary-dark); }
.installer-card h3 a:hover { color: var(--primary-light); }

.installer-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.installer-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.service-tag {
    background: #e0f2fe;
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.installer-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.installer-rating {
    font-size: 0.85rem;
    color: var(--text-lighter);
    font-style: italic;
}

/* Stats box */
.stats-box {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    border-radius: var(--radius);
    padding: 32px;
    margin: 32px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.stat-item { text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; display: block; }
.stat-label { font-size: 0.85rem; opacity: 0.8; }

.stats-note {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.breadcrumbs a { color: var(--primary-light); }
.breadcrumbs span { margin: 0 6px; color: var(--text-lighter); }

/* Page header */
.page-header {
    background: var(--bg-alt);
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.page-header p {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 700px;
    line-height: 1.7;
}

/* City links */
.city-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.city-pill {
    display: inline-block;
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.city-pill:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.city-pill-inactive {
    color: var(--text-lighter);
    border-color: var(--border);
    cursor: default;
}

.city-pill-inactive:hover {
    background: var(--bg-card);
    color: var(--text-lighter);
}

/* CTA box */
.cta-box {
    background: linear-gradient(135deg, var(--accent), #f97316);
    color: #fff;
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    margin: 40px 0;
}

.cta-box h2 { font-size: 1.5rem; margin-bottom: 8px; }
.cta-box p { opacity: 0.9; margin-bottom: 20px; }

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f1f5f9; color: var(--primary); text-decoration: none; }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* Lead form */
.lead-form-section {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin: 32px 0;
}

.lead-form-section h3 {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    text-align: center;
}

.lead-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(3,105,161,0.1);
}

.form-submit { grid-column: 1 / -1; text-align: center; margin-top: 8px; }

/* Flash messages */
.flash-messages { padding: 0; }

.flash {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin: 12px 0;
    font-size: 0.9rem;
}

.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Installer profile */
.profile-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin: 24px 0;
}

.profile-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.profile-row:last-child { border-bottom: none; }

.profile-label {
    font-weight: 600;
    width: 180px;
    flex-shrink: 0;
    color: var(--text);
}

.profile-value { color: var(--text-light); }

/* Blog */
.blog-list { max-width: 800px; margin: 0 auto; }

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.blog-card h2 { font-size: 1.25rem; margin-bottom: 8px; }
.blog-card h2 a { color: var(--primary-dark); }
.blog-card .blog-date { font-size: 0.8rem; color: var(--text-lighter); margin-bottom: 8px; }
.blog-card p { font-size: 0.9rem; color: var(--text-light); }

.article-content {
    max-width: 750px;
    margin: 0 auto;
    padding: 40px 0;
}

.article-content h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-date { font-size: 0.85rem; color: var(--text-lighter); margin-bottom: 32px; }

.article-body h2 {
    font-size: 1.35rem;
    color: var(--primary-dark);
    margin-top: 32px;
    margin-bottom: 12px;
}

.article-body h3 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-top: 24px;
    margin-bottom: 8px;
}

.article-body p { margin-bottom: 16px; color: var(--text); line-height: 1.7; }

.article-body ul, .article-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-body li { margin-bottom: 6px; line-height: 1.6; }

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.article-body th, .article-body td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.article-body th { background: var(--bg-alt); font-weight: 600; }

.article-cta {
    background: var(--bg-alt);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-top: 40px;
}

.article-cta p { font-size: 1.1rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 12px; }

/* Solar info box */
.solar-info-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 24px 0;
}

.solar-info-box h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.solar-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.solar-info-row:last-child { border-bottom: none; }
.solar-info-label { color: var(--text-light); }
.solar-info-value { font-weight: 600; color: var(--text); }

/* Footer */
.site-footer {
    background: var(--primary-dark);
    color: #fff;
    padding: 48px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand .logo { color: #fff; margin-bottom: 8px; }
.footer-tagline { font-size: 0.9rem; opacity: 0.7; margin-bottom: 16px; }

.footer-links h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    color: #fff;
    opacity: 0.8;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-decoration: none;
}

.footer-links a:hover { opacity: 1; text-decoration: none; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.6;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-bottom a { color: #fff; }

/* Legal pages */
.legal-content { max-width: 750px; margin: 0 auto; padding: 40px 0; }
.legal-content h1 { font-size: 2rem; color: var(--primary-dark); margin-bottom: 24px; }
.legal-content h2 { font-size: 1.3rem; color: var(--primary-dark); margin-top: 32px; margin-bottom: 12px; }
.legal-content p { margin-bottom: 16px; line-height: 1.7; color: var(--text); }
.legal-content ul { padding-left: 24px; margin-bottom: 16px; }
.legal-content li { margin-bottom: 6px; }

/* 404 */
.error-page { text-align: center; padding: 80px 0; }
.error-page h1 { font-size: 4rem; color: var(--primary); margin-bottom: 16px; }
.error-page p { font-size: 1.1rem; color: var(--text-light); margin-bottom: 24px; }

/* All states page */
.all-states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        gap: 12px;
    }

    .main-nav.active { display: flex; }

    .hero h1 { font-size: 1.75rem; }
    .hero { padding: 40px 0; }
    .hero p { font-size: 1rem; }

    .search-box { flex-direction: column; border-radius: var(--radius); }
    .search-box input { padding: 14px 20px; }
    .search-box button { padding: 14px 20px; }

    .steps-grid { grid-template-columns: 1fr; gap: 16px; }
    .state-grid { grid-template-columns: repeat(2, 1fr); }
    .installer-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .lead-form { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }

    .page-header h1 { font-size: 1.5rem; }
    .section-title { font-size: 1.4rem; }

    .profile-row { flex-direction: column; }
    .profile-label { width: auto; margin-bottom: 4px; }

    .article-content h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .state-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.5rem; }
    .container { padding: 0 16px; }
}
