/* -------------------------------------------------------------
   🎨 Premium "Silver Shadow" Visual System — MetricVault Car Finance
   ------------------------------------------------------------- */

/* --- 1. Global Reset & Variables --- */
:root {
    --bg-dark: #07090e;
    --bg-card: rgba(18, 24, 38, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Chrome/Silver Core Accent */
    --accent-silver: #e2e8f0;
    --accent-cyan: #06b6d4; /* Electric Cyan */
    --accent-cyan-glow: rgba(6, 182, 212, 0.35);
    --accent-danger: #f43f5e; /* Warnings / Residual alerts */
    --accent-danger-glow: rgba(244, 63, 94, 0.2);
    
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-inter);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- 2. Ambient Floating Mesh Backdrops --- */
.bg-glow {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
    z-index: -1;
}
.glow-silver {
    top: 10%;
    left: -150px;
    background-color: var(--accent-silver);
}
.glow-cyan {
    bottom: 15%;
    right: -150px;
    background-color: var(--accent-cyan);
}

/* --- 3. Glassmorphic Panels --- */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}
.glass-panel:hover {
    border-color: rgba(6, 182, 212, 0.15);
    box-shadow: 0 12px 35px rgba(6, 182, 212, 0.05);
}

/* --- 4. Premium App Header --- */
.app-header {
    background: rgba(7, 9, 14, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-glass);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-logo {
    font-size: 32px;
    text-shadow: 0 0 15px var(--accent-cyan-glow);
}
.brand-text h1 {
    font-family: var(--font-outfit);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}
.brand-text .accent {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan-glow);
}
.brand-text p {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* --- 5. Custom Ad Slots --- */
.ad-slot {
    display: none; /* Hidden by default to hide raw placeholder text. Unhide if manual ad scripts are injected. */
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.ad-placeholder {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.15);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px;
}
.ad-leaderboard {
    width: 728px;
    height: 90px;
}
.ad-banner {
    width: 100%;
    max-width: 970px;
    height: 250px;
    margin: 40px auto;
}
.ad-square {
    width: 300px;
    height: 250px;
    margin-top: 24px;
}

/* --- 6. Breadcrumb Link --- */
.breadcrumb {
    margin: 24px 0;
}
.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
    display: inline-block;
}
.back-link:hover {
    color: var(--accent-cyan);
    transform: translateX(-4px);
}

/* --- 7. Responsive Calculator Workspace --- */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
    margin-bottom: 40px;
    align-items: start;
}

/* --- 8. Input Components & Ranges --- */
.panel-header {
    margin-bottom: 28px;
}
.panel-header h2 {
    font-family: var(--font-outfit);
    font-size: 26px;
    font-weight: 700;
}
.panel-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.input-group {
    margin-bottom: 28px;
}
.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.input-group label {
    font-family: var(--font-outfit);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.input-numeric {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 6px 12px;
    transition: var(--transition-smooth);
}
.input-numeric:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}
.currency-symbol, .suffix {
    font-family: var(--font-outfit);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
}
.input-numeric input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-outfit);
    font-size: 16px;
    font-weight: 700;
    width: 90px;
    text-align: right;
    padding-right: 2px;
}
/* Hide number input spinners (Chrome, Safari, Edge, Opera) */
.input-numeric input::-webkit-outer-spin-button,
.input-numeric input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* Hide number input spinners (Firefox) */
.input-numeric input[type=number] {
    -moz-appearance: textfield;
}
/* Read-only elements styling */
.read-only-val {
    color: var(--accent-danger) !important;
}

/* Chrome-style sliders */
.custom-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    outline: none;
    transition: var(--transition-smooth);
}
.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-primary);
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan-glow);
    cursor: pointer;
    transition: var(--transition-smooth);
}
.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: var(--accent-cyan);
}
.range-warning::-webkit-slider-thumb {
    border-color: var(--accent-danger);
    box-shadow: 0 0 10px var(--accent-danger-glow);
}
.range-warning::-webkit-slider-thumb:hover {
    background: var(--accent-danger);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

/* Radio Tiles for Term Selection */
.radio-tiles {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 8px;
}
.tile {
    cursor: pointer;
    text-align: center;
}
.tile input {
    display: none;
}
.tile span {
    display: block;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}
.tile input:checked + span {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

/* Checkbox Tiles for Fees */
.fees-section {
    margin-top: 36px;
}
.checkbox-tile {
    margin-top: 12px;
}
.checkbox-tile input {
    display: none;
}
.checkbox-tile label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.checkbox-tile input:checked + label {
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.03);
}
.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2px;
    transition: var(--transition-smooth);
}
.checkbox-tile input:checked + label .checkbox-custom {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan);
}
.checkbox-tile input:checked + label .checkbox-custom::after {
    content: "✓";
    font-size: 11px;
    color: var(--bg-dark);
    font-weight: 800;
}
.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.checkbox-text strong {
    font-size: 14px;
    color: var(--text-primary);
}
.checkbox-text .desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- 9. Affiliate Offer Block --- */
.affiliate-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(18, 24, 38, 0.9));
    border-color: rgba(6, 182, 212, 0.15);
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}
.affiliate-card .tag {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid var(--accent-cyan);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-cyan);
}
.affiliate-card h4 {
    font-family: var(--font-outfit);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}
.affiliate-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
}
.cta-btn {
    display: block;
    text-align: center;
    background: var(--text-primary);
    color: var(--bg-dark);
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}
.cta-btn:hover {
    background: var(--accent-cyan);
    color: var(--text-primary);
    box-shadow: 0 4px 20px var(--accent-cyan-glow);
    transform: translateY(-2px);
}

/* --- 10. Output Panels & Visualization --- */
.results-pane h3 {
    font-family: var(--font-outfit);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* Donut Chart and Centered Text */
.chart-container {
    position: relative;
    width: 230px;
    height: 230px;
    margin: 0 auto 32px auto;
}
.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.chart-center-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.chart-center-val {
    display: block;
    font-family: var(--font-outfit);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 2px;
}

/* Output Cards Grid */
.result-highlight-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}
.result-highlight-card .label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.result-highlight-card .value {
    display: block;
    font-family: var(--font-outfit);
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}
.result-highlight-card .caption {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}
.bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.color-silver .bullet { background-color: var(--accent-silver); }
.color-cyan .bullet { background-color: var(--accent-cyan); }
.color-red .bullet { background-color: var(--accent-danger); }

.item-value {
    font-family: var(--font-outfit);
    font-size: 16px;
    font-weight: 700;
}
.item-value.warning {
    color: var(--accent-danger);
}

.breakdown-item.sub-item {
    border-top: 1px solid var(--border-glass);
    border-bottom: none;
    margin-top: 8px;
    padding-top: 16px;
}
.breakdown-item.sub-item .item-label {
    font-weight: 600;
    color: var(--text-primary);
}
.breakdown-item.sub-item .item-value.highlight {
    font-size: 18px;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan-glow);
}

/* Warnings and Alerts */
.custom-alert {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-radius: 16px;
    padding: 20px;
    margin-top: 24px;
    border: 1px solid transparent;
}
.custom-alert.warning {
    background: var(--accent-danger-glow);
    border-color: rgba(244, 63, 94, 0.25);
}
.alert-icon {
    font-size: 22px;
}
.alert-text strong {
    font-family: var(--font-outfit);
    font-size: 15px;
    color: var(--text-primary);
    display: block;
}
.alert-text p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}
.warning-highlight {
    color: var(--accent-danger) !important;
}

/* --- 11. SEO FAQ Section --- */
.faq-section {
    margin-top: 40px;
    margin-bottom: 60px;
}
.faq-section h2 {
    font-family: var(--font-outfit);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}
.faq-accordion details {
    border-bottom: 1px solid var(--border-glass);
    padding: 18px 0;
    cursor: pointer;
}
.faq-accordion details[open] {
    border-bottom-color: rgba(6, 182, 212, 0.2);
}
.faq-accordion summary {
    font-family: var(--font-outfit);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-accordion summary::-webkit-details-marker {
    display: none;
}
.faq-accordion summary::after {
    content: "+";
    font-size: 20px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}
.faq-accordion details[open] summary::after {
    content: "−";
    color: var(--accent-cyan);
}
.faq-accordion details p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 12px;
}

/* --- 12. Footer Architecture --- */
.app-footer {
    background: #04060a;
    border-top: 1px solid var(--border-glass);
    padding: 48px 0 24px 0;
    font-size: 13px;
}
.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-brand {
    max-width: 400px;
}
.footer-brand h3 {
    font-family: var(--font-outfit);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
}
.footer-brand h3 .accent {
    color: var(--accent-cyan);
}
.footer-brand p {
    color: var(--text-secondary);
    line-height: 1.6;
}
.footer-links {
    display: flex;
    gap: 24px;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}
.footer-links a:hover {
    color: var(--accent-cyan);
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    font-size: 11px;
}

/* --- 13. System Utilities & Responsiveness --- */
.hidden {
    display: none !important;
}

@media (max-width: 992px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
    .app-header .container {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .ad-leaderboard {
        width: 100%;
        height: auto;
        min-height: 50px;
    }
    .ad-placeholder {
        padding: 12px;
    }
}

@media (max-width: 576px) {
    .radio-tiles {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-grid {
        flex-direction: column;
        gap: 24px;
    }
}
