/* CarFlow — Clean Tech Automotive Microsite + Admin Dashboard */

/* ==================== DESIGN TOKENS ==================== */
:root {
    /* Dark palette (microsite) */
    --bg-primary: #071226;
    --bg-secondary: #0f2243;
    --bg-elevated: #142d56;
    --surface-glass: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(148, 181, 229, 0.28);
    --border-glass-hover: rgba(182, 210, 250, 0.56);

    /* Light palette (admin dashboard) */
    --bg-light: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;

    /* Action colors */
    --action: #2f6fed;
    --action-hover: #275fce;
    --action-glow: rgba(47, 111, 237, 0.28);
    --action-alt: #19926f;
    --action-alt-hover: #14795c;
    --action-alt-glow: rgba(25, 146, 111, 0.28);

    /* Text */
    --text-primary: #f4f8ff;
    --text-secondary: #c1d0ea;
    --text-muted: #95a6c5;
    --text-dark: #0f172a;
    --text-dark-muted: #64748b;

    /* Status */
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;

    /* Shape */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background: #071226;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #071226;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ==================== MICROSITE BASE ==================== */
.page-site {
    background:
        radial-gradient(1400px 600px at -5% -10%, rgba(47, 111, 237, 0.18), transparent 58%),
        radial-gradient(1200px 500px at 105% 0%, rgba(25, 146, 111, 0.16), transparent 60%),
        linear-gradient(180deg, #091a33 0%, #071226 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ==================== LANDING HEADER ==================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: rgba(7, 18, 38, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(182, 210, 250, 0.18);
}

.site-header-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 0.68rem 1.5rem;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.site-brand-name {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: 1.03rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #f7fbff;
}

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--action);
    transition: width 0.4s var(--ease);
    z-index: 100;
    border-radius: 0 2px 2px 0;
}

/* ==================== HERO ==================== */
.hero {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5.25rem 1.5rem 3.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(47, 111, 237, 0.1) 0%, transparent 46%),
        linear-gradient(245deg, rgba(25, 146, 111, 0.08) 0%, transparent 52%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    width: min(1120px, 100%);
    z-index: 1;
}

.hero-grid {
    display: grid;
    gap: 2rem;
}

.hero-copy {
    max-width: 650px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    background: rgba(47, 111, 237, 0.15);
    border: 1px solid rgba(47, 111, 237, 0.3);
    border-radius: var(--radius-full);
    color: #8bb8ff;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.42rem 0.9rem;
    margin-bottom: 1.25rem;
    font-family: 'Sora', 'Manrope', sans-serif;
}

.hero h1 {
    font-size: clamp(2.1rem, 5.8vw, 3.8rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    font-family: 'Sora', 'Manrope', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #c8ddff 50%, #7df0cb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 0 2rem;
    line-height: 1.55;
}

.hero-ctas {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 620px) {
    .hero-ctas {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
}

.hero-link {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25rem;
    transition: color 0.2s var(--ease);
}

.hero-link:hover {
    color: var(--text-primary);
}

.hero-note {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.hero-panel {
    background: linear-gradient(170deg, rgba(47, 111, 237, 0.1), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(47, 111, 237, 0.25);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 14px 36px rgba(3, 12, 29, 0.4);
}

.hero-panel h2 {
    font-size: 1rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.9rem;
    font-family: 'Sora', 'Manrope', sans-serif;
}

.hero-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hero-steps li {
    border-left: 2px solid var(--action);
    padding-left: 0.75rem;
}

.hero-steps li:nth-child(2) { border-left-color: var(--action-alt); }
.hero-steps li:nth-child(3) { border-left-color: var(--warning); }

.hero-steps strong {
    display: block;
    font-size: 0.93rem;
    color: var(--text-primary);
}

.hero-steps span {
    display: block;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.hero-panel-meta {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

@media (min-width: 980px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        gap: 2.5rem;
        align-items: start;
    }
}

/* ==================== SOCIAL PROOF TICKER ==================== */
.ticker-section {
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    background: linear-gradient(90deg, rgba(47, 111, 237, 0.06), rgba(25, 146, 111, 0.06));
    padding: 1rem 0;
    overflow: hidden;
}

.ticker-inner {
    display: block;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.ticker-marquee {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.ticker-track {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker 50s linear infinite;
}

.ticker-section:hover .ticker-track {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.ticker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--action-alt);
    flex-shrink: 0;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==================== VALUE PROPS ==================== */
.value-section {
    padding: 5rem 1.5rem 5rem;
    max-width: 1120px;
    margin: 0 auto;
}

.value-section h2 {
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    text-align: center;
    font-family: 'Sora', 'Manrope', sans-serif;
}

.value-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 880px) {
    .value-grid { grid-template-columns: repeat(3, 1fr); }
}

.value-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-glass);
    border-top: 3px solid var(--action);
    border-radius: 16px;
    padding: 2rem;
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.value-card:nth-child(2) { border-top-color: var(--action-alt); }
.value-card:nth-child(3) { border-top-color: var(--warning); }

.value-card:hover {
    border-color: var(--border-glass-hover);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.value-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.value-icon.blue { background: rgba(14, 165, 233, 0.15); color: var(--action); }
.value-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--action-alt); }
.value-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.value-card h3 {
    font-size: 1.03rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    font-family: 'Sora', 'Manrope', sans-serif;
}

.value-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==================== PROCESS ==================== */
.process-section {
    padding: 5rem 1.5rem 5rem;
    max-width: 1120px;
    margin: 0 auto;
    border-top: 1px solid rgba(148, 181, 229, 0.12);
}

.process-section h2 {
    text-align: center;
    font-size: clamp(1.55rem, 2.7vw, 2rem);
    margin-bottom: 2.5rem;
    font-family: 'Sora', 'Manrope', sans-serif;
}

.process-grid {
    display: grid;
    gap: 1rem;
}

.process-card {
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    background: linear-gradient(145deg, rgba(47, 111, 237, 0.06), rgba(255, 255, 255, 0.03));
    padding: 1.75rem;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.process-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.process-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: var(--radius-full);
    background: rgba(47, 111, 237, 0.2);
    color: #bcd1ff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 0.65rem;
    font-family: 'Sora', 'Manrope', sans-serif;
}

.process-card h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    font-family: 'Sora', 'Manrope', sans-serif;
}

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

@media (min-width: 900px) {
    .process-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== BOTTOM CTA ==================== */
.bottom-cta {
    text-align: center;
    padding: 3rem 1.5rem 6rem;
}

.bottom-cta-card {
    width: min(100%, 1020px);
    margin: 0 auto;
    border: 1px solid rgba(47, 111, 237, 0.3);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(47, 111, 237, 0.1), rgba(25, 146, 111, 0.08), rgba(255, 255, 255, 0.03));
    padding: 3.5rem 2rem;
    box-shadow: 0 16px 40px rgba(2, 10, 26, 0.35);
}

.bottom-cta h2 {
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.55rem;
    font-family: 'Sora', 'Manrope', sans-serif;
}

.bottom-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.bottom-cta-actions {
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}

/* ==================== STICKY FOOTER ==================== */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(7, 18, 38, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-glass);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s var(--ease);
    z-index: 50;
}

.sticky-footer.visible { transform: translateY(0); }

.sticky-footer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: none;
}

@media (min-width: 480px) {
    .sticky-footer-text { display: block; }
}

@media (max-width: 980px) {
    .hero {
        padding-top: 4.8rem;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .site-header-inner {
        padding: 0.62rem 1rem;
    }

    .site-brand-name {
        font-size: 0.97rem;
    }
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
    text-decoration: none;
    font-family: 'Sora', 'Manrope', sans-serif;
}

.btn:hover { text-decoration: none; }

.btn-action {
    background: var(--action);
    color: #fff;
    box-shadow: 0 6px 14px rgba(47, 111, 237, 0.25);
}
.btn-action:hover {
    background: var(--action-hover);
    box-shadow: 0 10px 18px rgba(47, 111, 237, 0.3);
    transform: translateY(-1px);
}

.btn-action-alt {
    background: var(--action-alt);
    color: #fff;
    box-shadow: 0 6px 14px rgba(25, 146, 111, 0.25);
}
.btn-action-alt:hover {
    background: var(--action-alt-hover);
    box-shadow: 0 10px 18px rgba(25, 146, 111, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(25, 146, 111, 0.12);
    color: #5ee9b8;
    border: 1.5px solid rgba(25, 146, 111, 0.5);
}
.btn-outline:hover {
    background: rgba(25, 146, 111, 0.22);
    border-color: var(--action-alt);
    color: #7df0cb;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-block { display: flex; width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ==================== TYPEFORM-STYLE QUIZ ==================== */
.quiz-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.quiz-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 15, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.quiz-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.quiz-back:hover { color: var(--text-primary); }
.quiz-back.hidden { visibility: hidden; }

.quiz-step-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.quiz-close {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.quiz-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 1.5rem 2rem;
}

.quiz-step {
    width: 100%;
    max-width: 560px;
    display: none;
    animation: fadeUp 0.4s var(--ease);
}

.quiz-step.active { display: block; }

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

.quiz-question {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.quiz-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Type selector cards */
.type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .type-grid { grid-template-columns: repeat(3, 1fr); }
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.type-card:hover {
    border-color: var(--border-glass-hover);
    background: rgba(255, 255, 255, 0.06);
}

.type-card.selected {
    border-color: var(--action);
    background: rgba(14, 165, 233, 0.1);
    box-shadow: 0 0 0 1px var(--action);
}

.type-card svg {
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.type-card.selected svg { color: var(--action); }

.type-card span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.type-card.selected span { color: var(--text-primary); }

/* Option cards */
.option-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

@media (min-width: 480px) {
    .option-cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.opt-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem 0.75rem;
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
}

.opt-card:hover {
    border-color: var(--border-glass-hover);
    background: rgba(255, 255, 255, 0.06);
}

.opt-card.selected {
    border-color: var(--action);
    background: rgba(14, 165, 233, 0.1);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--action);
}

/* Budget inputs */
.budget-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.budget-field { flex: 1; }

.budget-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Form inputs (dark theme) */
.input-dark {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.input-dark::placeholder { color: var(--text-muted); }

.input-dark:focus {
    border-color: var(--action);
    box-shadow: 0 0 0 3px var(--action-glow);
}

select.input-dark {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
}

select.input-dark option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Contact form fields */
.contact-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Quiz navigation */
.quiz-nav {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
}

.quiz-nav .btn { min-width: 140px; }

/* ==================== TRADE-IN ESTIMATOR ==================== */
.estimator-step {
    width: 100%;
    max-width: 480px;
    display: none;
    animation: fadeUp 0.4s var(--ease);
}

.estimator-step.active { display: block; }

.vehicle-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vehicle-row {
    display: flex;
    gap: 1rem;
}

.vehicle-row > * { flex: 1; }

/* Loading animation */
.loading-screen {
    text-align: center;
    padding: 3rem 1rem;
    display: none;
    animation: fadeUp 0.4s var(--ease);
}

.loading-screen.active { display: block; }

.loading-spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--border-glass);
    border-top-color: var(--action);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.loading-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== THANK YOU / REWARD ==================== */
.reward-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

.reward-content { max-width: 480px; }

.reward-check {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s var(--ease);
}

.reward-check svg {
    width: 36px;
    height: 36px;
    color: var(--action-alt);
}

@keyframes scaleIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.reward-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.reward-content p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.reward-next {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
}

.reward-next h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.reward-next ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reward-next li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.reward-next li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--action-alt);
    flex-shrink: 0;
}

/* ==================== ADMIN DASHBOARD ==================== */

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-contacted { background: #fef3c7; color: #92400e; }
.badge-converted { background: #d1fae5; color: #065f46; }
.badge-dead { background: #fee2e2; color: #991b1b; }
.badge-quiz { background: #ede9fe; color: #5b21b6; }
.badge-trade_in { background: #fce7f3; color: #9d174d; }
.badge-craigslist { background: #e0e7ff; color: #3730a3; }
.badge-facebook { background: #dbeafe; color: #1e40af; }
.badge-reddit { background: #ffedd5; color: #9a3412; }
.badge-autodev { background: #f0fdf4; color: #166534; }
.badge-manual { background: #f1f5f9; color: #475569; }

/* Dashboard Layout */
.inbox-layout { display: flex; min-height: 100vh; }
.inbox-sidebar {
    width: 220px;
    background: #1e293b;
    color: white;
    padding: 1.25rem 0;
    flex-shrink: 0;
}
.inbox-sidebar h2 {
    padding: 0 1rem;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.inbox-sidebar a {
    display: block;
    padding: 0.5rem 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}
.inbox-sidebar a:hover,
.inbox-sidebar a.active {
    color: white;
    background: #334155;
    text-decoration: none;
}
.inbox-main {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-x: auto;
    background: var(--bg-light);
    color: var(--text-dark);
}
.inbox-main h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.inbox-main a { color: #1a56db; }
.inbox-main a:hover { text-decoration: underline; }

/* Dashboard Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* Dashboard Buttons */
.btn-primary { background: #1a56db; color: white; display: inline-block; padding: 0.75rem 1.5rem; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 600; border: none; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: #1e40af; text-decoration: none; }
.btn-accent { background: #059669; color: white; display: inline-block; padding: 0.75rem 1.5rem; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 600; border: none; cursor: pointer; }
.btn-accent:hover { background: #047857; text-decoration: none; }
.btn-danger { background: var(--danger); color: white; display: inline-block; padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; border: none; cursor: pointer; }
.btn-dash-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card { text-align: center; }
.stat-label { font-size: 0.8rem; color: var(--text-dark-muted); text-transform: uppercase; }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-value.blue { color: #1a56db; }
.stat-value.green { color: #059669; }
.stat-value.yellow { color: var(--warning); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); padding: 0.5rem; }
td { padding: 0.5rem; border-bottom: 1px solid var(--border); }
tr:hover { background: #f8fafc; }

/* Dashboard Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--surface);
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

/* ==================== POST MANAGER ==================== */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}
.post-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.post-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.post-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}
.post-last {
    font-size: 0.75rem;
    color: #64748b;
}
.post-card-body {
    padding: 1rem;
}
.post-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.25rem;
}
.post-preview {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #1e293b;
    margin-bottom: 0.5rem;
    word-break: break-word;
}
.post-body-preview {
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}
.post-card-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}
.mark-posted-btn {
    color: #10b981 !important;
    border-color: #10b981 !important;
}
.mark-posted-btn:hover {
    background: #10b981 !important;
    color: #fff !important;
}

/* ==================== CONVERSATIONS ==================== */

/* State badges */
.conv-state-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.conv-state-pending { background: #f1f5f9; color: #475569; }
.conv-state-greeting_sent { background: #dbeafe; color: #1e40af; }
.conv-state-qualifying { background: #fef3c7; color: #92400e; }
.conv-state-scheduling { background: #ede9fe; color: #5b21b6; }
.conv-state-confirmed { background: #d1fae5; color: #065f46; }
.conv-state-closed { background: #f1f5f9; color: #475569; }
.conv-state-opted_out { background: #fee2e2; color: #991b1b; }
.conv-state-escalated { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.conv-state-stale { background: #f1f5f9; color: #94a3b8; }

/* Appointment status badges */
.appt-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.appt-status-booked { background: #dbeafe; color: #1e40af; }
.appt-status-confirmed { background: #d1fae5; color: #065f46; }
.appt-status-cancelled { background: #fee2e2; color: #991b1b; }
.appt-status-completed { background: #f0fdf4; color: #166534; }
.appt-status-no_show { background: #fef3c7; color: #92400e; }

/* Chat UI */
.chat-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
}
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.chat-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    position: relative;
}
.chat-inbound {
    background: #f1f5f9;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-outbound {
    background: #dbeafe;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    gap: 1rem;
}
.chat-sender {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
}
.chat-time {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}
.chat-body {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-status {
    font-size: 0.65rem;
    color: #94a3b8;
    text-align: right;
    margin-top: 0.25rem;
}

/* Sales tracker — progress bar */
.progress-bar-container {
    position: relative;
    background: #e2e8f0;
    border-radius: 8px;
    height: 32px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 8px;
    transition: width 0.4s ease;
    min-width: 2px;
}
.progress-bar-fill.progress-mid { background: #f59e0b; }
.progress-bar-fill.progress-complete { background: #16a34a; }
.progress-bar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

/* Sales tracker — tier cards */
.tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}
.tier-card {
    text-align: center;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}
.tier-card.tier-achieved {
    border-color: #16a34a;
    background: #f0fdf4;
}
.tier-card.tier-next {
    border-color: #f59e0b;
    background: #fffbeb;
}
.tier-cars {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}
.tier-bonus {
    font-size: 1.5rem;
    font-weight: 800;
    color: #16a34a;
    margin: 0.25rem 0;
}
.tier-status {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
}
.tier-status.achieved { color: #16a34a; }
.tier-status.next { color: #f59e0b; }

/* Funnel */
.funnel-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0;
}
.funnel-step { text-align: center; }
.funnel-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
}
.funnel-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
}
.funnel-arrow {
    font-size: 1.5rem;
    color: #94a3b8;
}

/* Active row highlight */
.active-row { background: #eff6ff; }

/* Inbox buttons (scoped to avoid overriding site buttons) */
.inbox-main .btn {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
}
.inbox-main .btn:hover { background: #f1f5f9; }
.inbox-main .btn-primary {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
.inbox-main .btn-primary:hover { background: #2563eb; }
.inbox-main .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

/* ==================== MOBILE HEADER & SIDEBAR ==================== */

/* Mobile header — hidden on desktop */
.mobile-header {
    display: none;
}

/* Sidebar overlay — hidden by default */
.sidebar-overlay {
    display: none;
}

/* Page header helper */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.header-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Table scroll wrapper */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Detail grid (lead detail 2-col) */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Sales meta row */
.sales-meta {
    display: flex;
    gap: 2rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
    flex-wrap: wrap;
}

/* ==================== RESPONSIVE — MOBILE ==================== */
@media (max-width: 768px) {
    /* Mobile header bar */
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        background: #1e293b;
        color: white;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    .mobile-title {
        font-size: 1rem;
        font-weight: 700;
    }

    /* Hamburger button */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
    }
    .hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: white;
        border-radius: 2px;
        transition: transform 0.2s;
    }

    /* Layout becomes vertical */
    .inbox-layout {
        flex-direction: column;
    }

    /* Sidebar becomes slide-over drawer */
    .inbox-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 2000;
        overflow-y: auto;
        transition: left 0.25s ease;
        padding-top: 1.5rem;
    }
    .inbox-sidebar.open {
        left: 0;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay.open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1500;
    }

    /* Main content */
    .inbox-main {
        padding: 1rem;
        min-height: calc(100vh - 50px);
    }
    .inbox-main h1 {
        font-size: 1.25rem;
    }

    /* Stat grid — 2 columns on mobile */
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .stat-card {
        padding: 0.75rem;
    }
    .stat-value {
        font-size: 1.4rem;
    }
    .stat-label {
        font-size: 0.7rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
    }

    /* Tables — horizontal scroll */
    .table-scroll {
        margin: -1rem;
        padding: 0;
    }
    .table-scroll table {
        min-width: 600px;
    }
    table {
        font-size: 0.8rem;
    }
    th, td {
        padding: 0.4rem;
        white-space: nowrap;
    }

    /* Detail grid stacks on mobile */
    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Sales meta wraps */
    .sales-meta {
        gap: 0.75rem;
        font-size: 0.8rem;
    }

    /* Post grid */
    .post-grid {
        grid-template-columns: 1fr;
    }

    /* Chat bubbles */
    .chat-bubble {
        max-width: 90%;
    }

    /* Tier grid — 2 columns */
    .tier-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .tier-card {
        padding: 0.75rem;
    }
    .tier-bonus {
        font-size: 1.2rem;
    }

    /* Funnel — vertical */
    .funnel-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    .funnel-arrow {
        transform: rotate(90deg);
    }
    .funnel-value {
        font-size: 1.5rem;
    }

    /* Page header stacks */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Filter forms */
    .inbox-main form {
        flex-wrap: wrap;
    }
    .inbox-main form input[type="text"],
    .inbox-main form input[type="number"] {
        width: 100% !important;
        max-width: none;
    }
    .inbox-main form select {
        min-width: 0;
    }

    /* Progress bar */
    .progress-bar-label {
        font-size: 0.75rem;
    }

    /* Buttons */
    .btn-primary, .btn-accent, .btn-danger {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==================== RESPONSIVE — SMALL PHONES ==================== */
@media (max-width: 380px) {
    .inbox-main {
        padding: 0.75rem;
    }
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
    .stat-value {
        font-size: 1.2rem;
    }
    .tier-grid {
        grid-template-columns: 1fr;
    }
    .chat-bubble {
        max-width: 95%;
    }
}
