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

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #10b981;
    --accent: #f59e0b;
    
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

body.light-mode {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    text-align: center;
    padding: 40px 20px 20px;
    position: relative;
}

.header-content {
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.bolt {
    font-size: 2rem;
}

h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.update-info {
    font-size: 0.8rem;
    color: var(--secondary);
    margin-top: 4px;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}

.theme-toggle:hover {
    border-color: var(--primary);
}

.theme-icon {
    font-size: 1.2rem;
}

main {
    padding: 30px 0;
}

.popular-states {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.popular-states h2 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 500;
}

.state-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.state-tag {
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.state-tag:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.calculator-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group:last-child {
    grid-column: span 2;
}

label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
}

select, input {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
    height: 46px;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select option {
    background: var(--card-bg);
    color: var(--text);
    padding: 10px;
}

.hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.calculate-btn {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.calculate-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.result-section, .reverse-section, .solar-section {
    margin-top: 24px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
}

.result-header {
    text-align: center;
    margin-bottom: 20px;
}

.result-header h2 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.total-amount {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--secondary);
}

.currency {
    font-size: 1.5rem;
    vertical-align: top;
}

.breakdown {
    background: var(--bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.breakdown h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.slab-row:last-child { border-bottom: none; }
.slab-row .range { color: var(--text-muted); }
.slab-row .units { color: var(--accent); font-weight: 500; }

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}

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

.summary-row.total {
    border-top: 2px solid var(--border);
    border-bottom: none;
    margin-top: 8px;
    padding-top: 16px;
    font-weight: 700;
    font-size: 1.1rem;
}

.summary-row.total span:last-child { color: var(--secondary); }

.estimate-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.estimate-item {
    background: var(--bg);
    padding: 14px 10px;
    border-radius: 10px;
    text-align: center;
}

.estimate-item.highlight {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--secondary);
}

.estimate-item .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.estimate-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.estimate-item.highlight .value { color: var(--secondary); }

.share-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
}

.reverse-section .result-card {
    border-color: var(--accent);
}

.reverse-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.reverse-inputs { display: flex; gap: 12px; }
.reverse-inputs.single { justify-content: center; }

.secondary-btn {
    padding: 12px 24px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.secondary-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.solar-section .result-card {
    border-color: var(--secondary);
}

.solar-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.solar-result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.solar-item {
    background: var(--bg);
    padding: 14px 10px;
    border-radius: 10px;
    text-align: center;
}

.solar-item.highlight-box {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--secondary);
}

.solar-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.solar-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.solar-value.highlight { color: var(--secondary); font-size: 1.15rem; }

.how-it-works {
    margin-bottom: 24px;
    padding: 24px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.step-card {
    background: var(--bg);
    padding: 20px 16px;
    border-radius: 12px;
    text-align: center;
    position: relative;
}

.step-number {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.step-card h3 {
    font-size: 0.95rem;
    margin: 10px 0 8px;
    font-weight: 600;
}

.step-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.trust-signals {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.08));
    border-radius: 16px;
    border: 1px solid var(--border);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    text-align: center;
}

.trust-item { padding: 10px; }

.trust-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.trust-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.data-source {
    text-align: center;
    margin-bottom: 32px;
    padding: 14px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.data-source p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.about-section {
    margin-bottom: 24px;
    padding: 24px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.about-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.about-section .about-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.board-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
}

.board-header {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.board-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.board-tag {
    padding: 5px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tips-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.tips-section h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: 10px;
    font-size: 0.85rem;
}

.tip-icon { font-size: 1.2rem; }
.tip p { color: var(--text-muted); }

.faq-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.faq-section h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
    width: 100%;
    padding: 16px 0;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
}

.faq-question::after {
    content: '+';
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.faq-item.active .faq-question::after { transform: rotate(45deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer { max-height: 200px; }

.faq-answer p {
    padding-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

footer p:first-child { margin-bottom: 8px; font-weight: 500; }

.disclaimer { font-size: 0.75rem; }
.disclaimer a { color: var(--text-muted); text-decoration: none; }
.disclaimer a:hover { color: var(--primary); }

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-group:last-child { grid-column: span 1; }
    
    .steps-grid { grid-template-columns: 1fr; gap: 24px; }
    .trust-grid { grid-template-columns: repeat(2, 1fr); }
    .estimate-grid { grid-template-columns: repeat(2, 1fr); }
    .solar-result-grid { grid-template-columns: repeat(2, 1fr); }
    .boards-grid { grid-template-columns: repeat(2, 1fr); }
    .tips-grid { grid-template-columns: 1fr; }
    .solar-form { flex-direction: column; }
    
    h1 { font-size: 1.4rem; }
    .total-amount { font-size: 2.2rem; }
    .trust-number { font-size: 1.3rem; }
    
    header { padding: 30px 15px 15px; }
    .about-section, .how-it-works, .calculator-card, .result-card { padding: 16px; }
}

@media (max-width: 400px) {
    .boards-grid { grid-template-columns: 1fr; }
    .state-links { gap: 6px; }
    .state-tag { padding: 6px 14px; font-size: 0.8rem; }
}
