:root {
    --bg-color: #F6F7F9;
    --card-bg: #ffffff;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --accent-color: #F97316;
    --accent-hover: #EA580C;
    --success-color: #10B981;
    --border-color: #E2E8F0;
    --font-stack: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== HEADER ==================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: transparent;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 10;
}

.logo {
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 14px;
}

.header nav { display: none; }

@media (min-width: 768px) {
    .header nav {
        display: flex;
        gap: 24px;
    }
    .header nav a {
        text-decoration: none;
        color: var(--text-primary);
        font-weight: 500;
        font-size: 14px;
        transition: color var(--transition);
    }
    .header nav a:hover { color: var(--text-secondary); }
}

.user-actions {
    display: flex;
    gap: 16px;
    cursor: pointer;
}

/* ==================== LAYOUT ==================== */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    min-height: 100vh;
    padding-top: 80px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
        gap: 32px;
        padding: 24px 32px;
        align-items: start;
    }
}

/* ==================== TYPOGRAPHY ==================== */
h1.main-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 14px;
}

.highlight-text {
    font-weight: 600;
    color: var(--accent-color);
}

/* ==================== RESULTS PANEL (LEFT) ==================== */
.results-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 280px 280px;
    gap: 16px;
}

.quadrant {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition);
}

.quadrant:hover {
    box-shadow: var(--shadow-md);
}

/* Q1: Video */
.video-quadrant {
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    min-height: 220px;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.video-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Q2: KPIs */
.kpi-quadrant {
    justify-content: center;
    gap: 12px;
}

.kpi-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.kpi-card:hover {
    border-color: #CBD5E1;
}

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    margin: 4px 0;
    letter-spacing: -0.02em;
}

.kpi-value.highlight {
    color: #0F172A;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Q3/Q4: Charts */
.chart-quadrant h3 {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: -0.01em;
}

.chart-box {
    flex: 1;
    position: relative;
    width: 100%;
}

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

.kpi-micro {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
}

/* ==================== CONTROLS PANEL (RIGHT) ==================== */
.controls-panel {
    background: #F8FAFC;
    padding: 32px 28px;
    border-radius: var(--radius-xl);
    border: 1px solid #E2E8F0;
    position: relative;
}

@media (min-width: 1024px) {
    .controls-panel {
        position: sticky;
        top: 100px;
    }
}

.control-group {
    margin-bottom: 28px;
}

.control-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Inputs */
.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 16px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.input-wrapper span {
    color: var(--text-secondary);
    margin-right: 6px;
    font-weight: 500;
}

.input-wrapper input {
    border: none;
    background: transparent;
    font-size: 16px;
    width: 100%;
    outline: none;
    font-family: var(--font-stack);
    font-weight: 500;
    color: var(--text-primary);
}

.hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Slider */
.tesla-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--accent-color) 0%, #E2E8F0 0%);
    outline: none;
    margin-top: 12px;
    transition: background var(--transition);
}

.tesla-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px var(--accent-color);
    border: none;
    transition: transform var(--transition), box-shadow var(--transition);
}

.tesla-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 3px var(--accent-color);
}

.slider-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

/* Select */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-secondary);
    pointer-events: none;
}

.select-wrapper select {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    font-size: 15px;
    font-family: var(--font-stack);
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color var(--transition);
}

.select-wrapper select:focus {
    border-color: var(--accent-color);
}

/* Summary Box */
.summary-box {
    background: var(--bg-color);
    padding: 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-row.total {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px solid var(--border-color);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 17px;
}

/* Battery Selector */
.battery-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.battery-pill {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.battery-pill:hover {
    border-color: #CBD5E1;
    background: #F8FAFC;
}

.battery-pill.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: #FFF7ED;
}

/* ==================== BUTTONS ==================== */
.cta-button {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.modal-card {
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 420px;
    text-align: left;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.wide {
    max-width: 520px;
}

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

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    float: right;
    line-height: 1;
    transition: color var(--transition);
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    background: #F8FAFC;
    outline: none;
    transition: all var(--transition);
    font-family: var(--font-stack);
    color: var(--text-primary);
}

.form-group input:focus {
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 10px;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input { display: none; }

.radio-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background: #F8FAFC;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.radio-label input:checked + .radio-button {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* Phone Input */
.phone-input-group {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
    background: #F8FAFC;
}

.phone-input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background: white;
}

.prefix {
    background: #F1F5F9;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.phone-input-group input {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 12px 14px;
    width: 100%;
    outline: none;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-stack);
}

.phone-input-group input:focus {
    background: transparent;
}

#lead-phone {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

/* Tabs */
.tabs {
    display: flex;
    background: #F1F5F9;
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.tab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ==================== PRICING MODAL ==================== */
.pricing-content {
    margin-top: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #F1F5F9;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.price-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.price-row.total {
    border-bottom: none;
    font-weight: 800;
    font-size: 22px;
    margin-top: 8px;
    color: var(--text-primary);
}

.divider {
    border: 0;
    border-top: 2px solid #F1F5F9;
    margin: 4px 0;
}

.due-today {
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    border: 1px solid #FED7AA;
}

.due-today .price-row {
    border: none;
    padding: 0;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.disclaimer {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.small-text {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .results-panel-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .controls-panel {
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 768px) {
    .modal-card {
        padding: 28px 24px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: var(--radius-lg);
    }
    h2 { font-size: 18px; }
    .dashboard-grid { padding: 12px; gap: 16px; }
    .controls-panel { padding: 24px 20px; }
    .kpi-value { font-size: 22px; }
}
