/*
 * io7 Financial Suite - Premium Design System
 * Agency-grade styling with modern aesthetics
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Colors - Dark Premium Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: rgba(26, 26, 36, 0.7);
    --bg-card-hover: rgba(32, 32, 45, 0.8);

    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.35);

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);

    /* Status Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);

    /* Scenario Colors */
    --conservative: #3b82f6;
    --moderate: #10b981;
    --aggressive: #f59e0b;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

    /* Z-Index */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-modal: 1000;
    --z-tooltip: 1500;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   Animated Background
   ============================================ */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(139, 92, 246, 0.1), transparent),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(168, 85, 247, 0.08), transparent);
    z-index: -2;
    animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 64px 64px;
    z-index: -1;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    padding: var(--space-md) var(--space-xl);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-base);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: none;
}

@media (min-width: 768px) {
    .logo-text {
        display: block;
    }
}

.nav-links {
    display: none;
    gap: var(--space-lg);
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: var(--transition-base);
    transform: translateX(-50%);
}

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

.nav-link:hover::after {
    width: 60%;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

@media (min-width: 1024px) {
    .nav-toggle {
        display: none;
    }
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

.mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: var(--space-lg);
    display: none;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: var(--z-dropdown);
    border-bottom: 1px solid var(--glass-border);
}

.mobile-menu.active {
    display: flex;
}

.mobile-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.mobile-link:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: var(--space-3xl);
    padding: calc(80px + var(--space-3xl)) var(--space-xl) var(--space-3xl);
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .hero {
        grid-template-columns: 1fr 1fr;
        min-height: 100vh;
    }
}

.hero-content {
    text-align: center;
}

@media (min-width: 1024px) {
    .hero-content {
        text-align: left;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.6s ease;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: var(--radius-full);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease 0.1s backwards;
}

.gradient-text {
    display: block;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: var(--space-2xl);
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

@media (min-width: 1024px) {
    .hero-subtitle {
        margin-left: 0;
        margin-right: auto;
    }
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-3xl);
    animation: fadeInUp 0.6s ease 0.3s backwards;
}

@media (min-width: 1024px) {
    .hero-cta {
        justify-content: flex-start;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

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

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    animation: fadeInUp 0.6s ease 0.4s backwards;
}

@media (min-width: 1024px) {
    .hero-stats {
        justify-content: flex-start;
    }
}

.stat {
    text-align: center;
}

@media (min-width: 1024px) {
    .stat {
        text-align: left;
    }
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--glass-border);
}

/* Hero Visual */
.hero-visual {
    display: none;
    position: relative;
    height: 400px;
}

@media (min-width: 1024px) {
    .hero-visual {
        display: block;
    }
}

.floating-card {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
}

.card-1 {
    top: 10%;
    right: 20%;
    animation-delay: 0s;
}

.card-2 {
    top: 40%;
    right: 5%;
    animation-delay: -2s;
}

.card-3 {
    bottom: 10%;
    right: 25%;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.card-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.card-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.card-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--success);
}

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

/* ============================================
   Main Content
   ============================================ */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-xl) var(--space-4xl);
}

/* ============================================
   Calculator Sections
   ============================================ */
.calculator-section {
    padding: var(--space-4xl) 0;
    scroll-margin-top: 80px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.section-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

@media (min-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr 1.5fr;
    }
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-xl);
}

/* Input Styles */
.input-group {
    margin-bottom: var(--space-lg);
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0 var(--space-md);
    transition: var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-prefix,
.input-suffix {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.input-field {
    flex: 1;
    background: none;
    border: none;
    padding: var(--space-md) var(--space-sm);
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

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

/* Range Slider */
.input-slider {
    width: 100%;
    height: 4px;
    margin-top: var(--space-md);
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.input-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: var(--transition-spring);
}

.input-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.input-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.input-slider.accent::-webkit-slider-thumb {
    background: var(--success);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    position: relative;
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-base);
    margin-top: var(--space-md);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.calculate-btn:active {
    transform: translateY(0);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.calculate-btn:hover .btn-shine {
    left: 100%;
}

/* Results Styles */
.calculator-results {
    display: flex;
    flex-direction: column;
}

.result-header {
    text-align: center;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: var(--space-lg);
}

.result-header h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.result-main {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.result-item {
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.result-item.full-width {
    grid-column: 1 / -1;
}

.result-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.result-value {
    font-size: 1.125rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.result-value.accent {
    color: var(--accent-primary);
}

.result-value.highlight {
    color: var(--success);
}

.result-value.muted {
    color: var(--text-tertiary);
}

/* Chart Container */
.chart-container {
    flex: 1;
    min-height: 200px;
    position: relative;
}

.chart-container.chart-tall {
    min-height: 300px;
}

/* ============================================
   Amortisation Schedule
   ============================================ */
.schedule-card {
    margin-top: var(--space-xl);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.schedule-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.schedule-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    color: var(--accent-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.schedule-toggle:hover {
    color: var(--accent-secondary);
}

.schedule-toggle svg {
    transition: var(--transition-base);
}

.schedule-toggle.active svg {
    transform: rotate(180deg);
}

.schedule-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.schedule-content.active {
    max-height: 600px;
    overflow-y: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    padding: var(--space-md);
    text-align: right;
    font-size: 0.875rem;
}

.schedule-table th {
    color: var(--text-tertiary);
    font-weight: 500;
    border-bottom: 1px solid var(--glass-border);
}

.schedule-table th:first-child,
.schedule-table td:first-child {
    text-align: left;
}

.schedule-table td {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.schedule-table tr:hover td {
    background: var(--glass-bg);
}

/* ============================================
   Investment Scenarios
   ============================================ */
.rate-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.preset-item {
    text-align: center;
}

.preset-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preset-value {
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.scenario-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    border: 1px solid transparent;
    transition: var(--transition-base);
}

.scenario-card:hover {
    transform: translateY(-4px);
}

.scenario-card.conservative {
    border-color: var(--conservative);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.scenario-card.moderate {
    border-color: var(--moderate);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.scenario-card.aggressive {
    border-color: var(--aggressive);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
}

.scenario-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.scenario-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.scenario-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.scenario-card.conservative .scenario-value { color: var(--conservative); }
.scenario-card.moderate .scenario-value { color: var(--moderate); }
.scenario-card.aggressive .scenario-value { color: var(--aggressive); }

/* ============================================
   Debt Calculator Specific
   ============================================ */
.highlight-group {
    background: rgba(16, 185, 129, 0.05);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.highlight-group .input-label {
    color: var(--success);
}

.comparison-header {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}

.comparison-item {
    text-align: center;
}

.comparison-item h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.comparison-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.comparison-item.highlight .comparison-value {
    color: var(--success);
}

.comparison-vs {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.savings-highlight {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
}

.savings-icon {
    font-size: 2rem;
}

.savings-content {
    flex: 1;
}

.savings-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.savings-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}

.savings-time {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success);
    padding: var(--space-sm) var(--space-md);
    background: rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-full);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: var(--space-4xl) var(--space-xl) var(--space-2xl);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: var(--space-xl);
}

.footer-brand .logo-icon {
    font-size: 2.5rem;
}

.footer-brand p {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-top: var(--space-sm);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

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

.footer-disclaimer {
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.footer-disclaimer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--glass-border);
}

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

/* ============================================
   Utility Classes
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .hero {
        padding-top: calc(60px + var(--space-2xl));
    }

    .hero-title {
        font-size: 2rem;
    }

    .result-main {
        font-size: 2rem;
    }

    .scenario-grid {
        grid-template-columns: 1fr;
    }

    .comparison-header {
        flex-direction: column;
        gap: var(--space-md);
    }

    .comparison-vs {
        display: none;
    }

    .savings-highlight {
        flex-direction: column;
        text-align: center;
    }

    .savings-time {
        margin-top: var(--space-sm);
    }
}

/* ============================================
   Loading State
   ============================================ */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Selection Styling
   ============================================ */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* ============================================
   Additional Form Components
   ============================================ */

/* Select Input */
.input-select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    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='%23888' 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: 40px;
}

.input-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

/* Input Row */
.input-row {
    display: flex;
    gap: var(--space-md);
}

.input-group.half {
    flex: 1;
}

/* Input Hint */
.input-hint {
    margin-top: var(--space-sm);
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 500;
}

/* Checkbox Styles */
.checkbox-group {
    margin-bottom: var(--space-lg);
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.checkbox-label.small {
    font-size: 0.8125rem;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    position: relative;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--accent-gradient);
    border-color: transparent;
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ============================================
   Salary Calculator Specific
   ============================================ */

.salary-breakdown {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--glass-border);
}

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

.breakdown-row.deduction .breakdown-value {
    color: var(--error);
}

.breakdown-row.total {
    padding-top: var(--space-md);
    margin-top: var(--space-sm);
    border-top: 2px solid var(--glass-border);
    border-bottom: none;
}

.breakdown-row.total .breakdown-label,
.breakdown-row.total .breakdown-value {
    font-weight: 700;
    font-size: 1rem;
}

.breakdown-row.total .breakdown-value {
    color: var(--success);
}

.breakdown-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breakdown-value {
    font-size: 0.875rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.result-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
}

/* ============================================
   Mortgage Calculator Specific
   ============================================ */

.mortgage-summary,
.pcp-summary {
    margin-bottom: var(--space-lg);
}

.summary-row {
    display: flex;
    gap: var(--space-md);
}

.summary-item {
    flex: 1;
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.summary-item.highlight {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.summary-item.highlight .summary-value {
    color: var(--accent-primary);
}

/* ============================================
   PCP Calculator Specific
   ============================================ */

.pcp-comparison {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.pcp-comparison h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.pcp-comparison .comparison-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
}

.pcp-comparison .comparison-row span:first-child {
    color: var(--text-secondary);
}

.pcp-comparison .comparison-row span:last-child {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.pcp-comparison .comparison-row.highlight {
    padding-top: var(--space-md);
    margin-top: var(--space-sm);
    border-top: 1px solid var(--glass-border);
}

.pcp-comparison .comparison-row.highlight span:last-child {
    color: var(--success);
}

.pcp-options {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.pcp-options h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.option-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--glass-border);
}

.option-card:last-child {
    border-bottom: none;
}

.option-icon {
    font-size: 1.25rem;
}

.option-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.option-text span {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-primary);
}

/* ============================================
   Responsive Updates
   ============================================ */

@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
    }

    .result-grid.three-col {
        grid-template-columns: 1fr 1fr;
    }

    .result-grid.three-col .result-item:last-child {
        grid-column: 1 / -1;
    }

    .summary-row {
        flex-direction: column;
    }

    .checkbox-row {
        flex-direction: column;
        gap: var(--space-sm);
    }
}
