/* -------------------------------------------------------------
   🎨 Premium Liberty Indigo Design System — MetricVault US
   ------------------------------------------------------------- */

/* Custom Variables */
:root {
    --bg-dark: #030712;
    --bg-dark-gray: #0b0f19;
    --bg-glass: rgba(15, 23, 42, 0.45);
    --border-glass: rgba(99, 102, 241, 0.12);
    --border-glass-focus: rgba(99, 102, 241, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-indigo: #6366f1;
    --accent-indigo-glow: rgba(99, 102, 241, 0.15);
    --accent-cobalt: #3b82f6;
    --accent-rose: #f43f5e;
    
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

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

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

/* Ambient Liberty Mesh Glows */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.22;
    pointer-events: none;
}

.glow-indigo {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--accent-indigo) 0%, transparent 70%);
}

.glow-purple {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, #a855f7 0%, transparent 70%);
}

.glow-cobalt {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--accent-cobalt) 0%, transparent 70%);
}

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

/* Header Area */
.app-header {
    padding: 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(12px);
    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;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
}

.brand-text h1 {
    font-family: var(--font-outfit);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand-text h1 .accent {
    color: var(--accent-indigo);
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-text p {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1px;
}

/* Ad Slots */
.ad-slot {
    display: none; /* Hidden by default to hide raw placeholder text. Unhide if manual ad scripts are injected. */
    background: rgba(11, 15, 25, 0.8);
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-placeholder {
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-outfit);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-leaderboard {
    width: 728px;
    height: 90px;
}

.ad-banner {
    width: 100%;
    height: 120px;
    margin: 40px auto 0 auto;
}

.ad-square {
    width: 100%;
    height: 250px;
    margin-top: 24px;
}

/* Main Layout Grid */
.app-main {
    padding-top: 32px;
    padding-bottom: 80px;
}

.breadcrumb {
    margin-bottom: 24px;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--accent-indigo);
    transform: translateX(-3px);
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
    align-items: start;
}

/* Glassmorphic Panels */
.glass-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 20px 45px rgba(99, 102, 241, 0.04);
}

.panel-header {
    margin-bottom: 28px;
}

.panel-header h2 {
    font-family: var(--font-outfit);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Form Styling */
.input-group {
    margin-bottom: 24px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

label {
    font-family: var(--font-outfit);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-numeric {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(11, 15, 25, 0.9);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0 12px;
    transition: all 0.3s ease;
}

.input-numeric:focus-within {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.currency-symbol {
    font-family: var(--font-outfit);
    font-weight: 700;
    color: var(--accent-indigo);
    margin-right: 4px;
    font-size: 15px;
}

.input-numeric input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 16px;
    padding: 8px 0;
    text-align: right;
    width: 100px;
    -moz-appearance: textfield;
}

/* Banish standard white arrows inside numeric inputs */
.input-numeric input::-webkit-outer-spin-button,
.input-numeric input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.suffix, .suffix-pct {
    color: var(--text-secondary);
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 13px;
    margin-left: 6px;
}

/* Synced custom sliders */
.custom-range {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    outline: none;
    margin: 12px 0 6px 0;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: var(--accent-indigo);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.8);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Radio Tiles selector style */
.radio-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.credit-tiles {
    grid-template-columns: repeat(2, 1fr);
}

.tile {
    background: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tile input[type="radio"] {
    display: none;
}

.tile span {
    font-family: var(--font-outfit);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.tile:has(input[type="radio"]:checked) {
    background: var(--accent-indigo-glow);
    border-color: var(--accent-indigo);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.tile:has(input[type="radio"]:checked) span {
    color: var(--text-primary);
}

/* Expandable Drawer Panel */
.expandable-panel {
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    margin-top: 24px;
    background: rgba(11, 15, 25, 0.3);
    transition: all 0.3s ease;
}

.expandable-panel.open {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(11, 15, 25, 0.6);
}

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

.expandable-header h4 {
    font-family: var(--font-outfit);
    font-size: 14px;
    font-weight: 700;
}

.chevron {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.expandable-panel.open .chevron {
    transform: rotate(180deg);
}

.expandable-content {
    transition: all 0.3s ease;
}

.hidden {
    display: none;
}

.input-caption {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* High Conversion Affiliate Card styling */
.affiliate-card {
    margin-top: 32px;
    padding: 24px !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(11, 15, 25, 0.95)) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.affiliate-card .tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-indigo);
    color: #000;
    font-family: var(--font-outfit);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.affiliate-card h4 {
    font-family: var(--font-outfit);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    max-width: 80%;
}

.affiliate-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.cta-btn {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    font-family: var(--font-outfit);
    font-size: 13px;
    font-weight: 800;
    padding: 12px;
    border-radius: 8px;
    background: var(--text-primary);
    color: #030712;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.cta-btn:hover {
    background: var(--accent-indigo);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

/* PITI / Side-by-Side Outputs */
.side-by-side-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 28px;
}

.payout-col {
    background: rgba(11, 15, 25, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.conventional-col {
    border-color: rgba(59, 130, 246, 0.15);
}

.conventional-col:hover {
    border-color: var(--accent-cobalt);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.05);
}

.fha-col {
    border-color: rgba(244, 63, 94, 0.15);
}

.fha-col:hover {
    border-color: var(--accent-rose);
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.05);
}

.col-title {
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.col-main-val {
    font-family: var(--font-outfit);
    font-weight: 800;
    font-size: 26px;
    display: block;
    line-height: 1.1;
}

.conventional-col .col-main-val {
    color: var(--accent-cobalt);
}

.fha-col .col-main-val {
    color: var(--accent-rose);
}

.col-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 20px;
}

.col-breakdown-details {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.col-breakdown-details .item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    position: relative;
}

.col-breakdown-details .item .lbl {
    color: var(--text-secondary);
}

.col-breakdown-details .item .val {
    font-family: var(--font-outfit);
    font-weight: 600;
    color: var(--text-primary);
}

.col-breakdown-details .item .caption {
    font-size: 9px;
    color: var(--text-muted);
    position: absolute;
    bottom: -10px;
    right: 0;
    font-weight: 500;
}

.col-breakdown-details .highlight-row {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    margin-top: 4px;
}

.col-breakdown-details .highlight-row .lbl {
    font-weight: 700;
    color: var(--text-primary);
}

.col-breakdown-details .highlight-row .val {
    font-weight: 700;
}

.conventional-col .highlight-row .val {
    color: var(--accent-cobalt);
}

.fha-col .highlight-row .val {
    color: var(--accent-rose);
}

/* Dynamic advisory notification box */
.custom-alert {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    margin-top: 28px;
    align-items: start;
    line-height: 1.5;
}

.alert-icon {
    font-size: 20px;
}

.alert-text strong {
    font-family: var(--font-outfit);
    font-size: 14px;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.alert-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

.alert-text p strong {
    display: inline;
    color: var(--text-primary);
}

/* Explore More Grids */
.explore-section {
    margin-top: 60px;
}

.explore-section h2 {
    font-family: var(--font-outfit);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.explore-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.3s ease;
}

.explore-card h3 {
    font-family: var(--font-outfit);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.explore-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
}

.explore-card a {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    font-family: var(--font-outfit);
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: all 0.25s ease;
}

.explore-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-2px);
}

.explore-card:hover a {
    background: var(--text-primary);
    color: #030712;
}

/* FAQ SEO block */
.faq-section {
    margin-top: 40px;
}

.faq-section h2 {
    font-family: var(--font-outfit);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.faq-accordion details {
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 16px;
}

.faq-accordion summary {
    font-family: var(--font-outfit);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    user-select: none;
    transition: color 0.2s ease;
}

.faq-accordion summary:hover {
    color: var(--accent-indigo);
}

.faq-accordion p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 10px;
}

/* Footer Section */
.app-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(3, 7, 18, 0.85);
    padding: 60px 0 30px 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
}

.footer-brand h3 {
    font-family: var(--font-outfit);
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
}

.footer-brand h3 .accent {
    color: var(--accent-indigo);
}

.footer-brand p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 80%;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    justify-content: flex-end;
    align-content: flex-start;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-indigo);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 40px;
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Sticky sidebar setup */
.sticky {
    position: sticky;
    top: 120px;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .ad-leaderboard {
        display: none;
    }
}

@media (max-width: 768px) {
    .side-by-side-results {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .footer-links {
        justify-content: flex-start;
    }
    .glass-panel {
        padding: 24px;
    }
}
