/* ==========================================================================
   LENDSMART - PERSONAL LENDING PLATFORM
   Premium CSS with Design Tokens, Animations, Dark Mode
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================== */
:root {
    /* Brand Colors - Trustworthy Blue + Helpful Green */
    --color-primary-50: #eff6ff;
    --color-primary-100: #dbeafe;
    --color-primary-200: #bfdbfe;
    --color-primary-300: #93c5fd;
    --color-primary-400: #60a5fa;
    --color-primary-500: #2563eb;
    --color-primary-600: #1d4ed8;
    --color-primary-700: #1e40af;
    --color-primary-800: #1e3a8a;
    --color-primary-900: #1e3a5f;

    --color-success-50: #f0fdf4;
    --color-success-100: #dcfce7;
    --color-success-200: #bbf7d0;
    --color-success-300: #86efac;
    --color-success-400: #4ade80;
    --color-success-500: #22c55e;
    --color-success-600: #16a34a;
    --color-success-700: #15803d;

    --color-warning-50: #fffbeb;
    --color-warning-100: #fef3c7;
    --color-warning-500: #f59e0b;
    --color-warning-600: #d97706;

    --color-danger-50: #fef2f2;
    --color-danger-100: #fee2e2;
    --color-danger-500: #ef4444;
    --color-danger-600: #dc2626;

    /* Neutral Colors */
    --color-neutral-50: #f8fafc;
    --color-neutral-100: #f1f5f9;
    --color-neutral-200: #e2e8f0;
    --color-neutral-300: #cbd5e1;
    --color-neutral-400: #94a3b8;
    --color-neutral-500: #64748b;
    --color-neutral-600: #475569;
    --color-neutral-700: #334155;
    --color-neutral-800: #1e293b;
    --color-neutral-900: #0f172a;
    --color-neutral-950: #020617;

    /* Semantic Colors */
    --color-background: #ffffff;
    --color-background-alt: var(--color-neutral-50);
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-text-primary: var(--color-neutral-900);
    --color-text-secondary: var(--color-neutral-600);
    --color-text-tertiary: var(--color-neutral-500);
    --color-border: var(--color-neutral-200);
    --color-border-subtle: var(--color-neutral-100);

    /* Typography Scale (Clamp-based responsive) */
    --font-family-display: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family-mono: 'SF Mono', 'Fira Code', monospace;

    --text-hero: clamp(2.5rem, 6vw, 4.5rem);
    --text-display: clamp(2rem, 5vw, 3.5rem);
    --text-h1: clamp(1.75rem, 4vw, 2.5rem);
    --text-h2: clamp(1.5rem, 3vw, 2rem);
    --text-h3: clamp(1.25rem, 2.5vw, 1.5rem);
    --text-h4: clamp(1.125rem, 2vw, 1.25rem);
    --text-body-lg: 1.125rem;
    --text-body: 1rem;
    --text-body-sm: 0.875rem;
    --text-caption: 0.75rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    --line-height-tight: 1.1;
    --line-height-snug: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;

    /* Spacing Scale (8px base) */
    --space-0: 0;
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */
    --space-20: 5rem;    /* 80px */
    --space-24: 6rem;    /* 96px */
    --space-32: 8rem;    /* 128px */

    /* Border Radius */
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-3xl: 2rem;      /* 32px */
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);

    /* Glow Effects */
    --glow-primary: 0 0 20px rgba(37, 99, 235, 0.3);
    --glow-primary-lg: 0 0 40px rgba(37, 99, 235, 0.4);
    --glow-success: 0 0 20px rgba(34, 197, 94, 0.3);
    --glow-success-lg: 0 0 40px rgba(34, 197, 94, 0.4);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;

    /* Container */
    --container-max: 80rem; /* 1280px */
    --container-padding: var(--space-6);
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */
[data-theme="dark"],
.dark {
    --color-background: #0a0f1a;
    --color-background-alt: #0f172a;
    --color-surface: #1e293b;
    --color-surface-elevated: #334155;
    --color-text-primary: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-tertiary: #94a3b8;
    --color-border: #334155;
    --color-border-subtle: #1e293b;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);

    --glow-primary: 0 0 30px rgba(37, 99, 235, 0.4);
    --glow-primary-lg: 0 0 60px rgba(37, 99, 235, 0.5);
    --glow-success: 0 0 30px rgba(34, 197, 94, 0.4);
}

/* ==========================================================================
   BASE RESET & DEFAULTS
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-body);
    font-size: var(--text-body);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-primary);
}

.text-hero {
    font-size: var(--text-hero);
    font-weight: var(--font-weight-extrabold);
    letter-spacing: -0.03em;
}

.text-display {
    font-size: var(--text-display);
    font-weight: var(--font-weight-bold);
}

.text-h1 { font-size: var(--text-h1); }
.text-h2 { font-size: var(--text-h2); }
.text-h3 { font-size: var(--text-h3); }
.text-h4 { font-size: var(--text-h4); }

.text-body-lg {
    font-size: var(--text-body-lg);
    line-height: var(--line-height-relaxed);
}

.text-body-sm {
    font-size: var(--text-body-sm);
}

.text-caption {
    font-size: var(--text-caption);
    letter-spacing: var(--letter-spacing-wide);
}

/* Text Colors */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-brand { color: var(--color-primary-500); }
.text-success { color: var(--color-success-500); }

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container-narrow {
    max-width: 64rem; /* 1024px */
}

.container-wide {
    max-width: 90rem; /* 1440px */
}

.section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
}

.section-lg {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border-subtle);
    transition: var(--transition-base);
}

.dark .navbar {
    background: rgba(10, 15, 26, 0.9);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-500);
}

.navbar-logo svg {
    width: 2rem;
    height: 2rem;
}

.navbar-nav {
    display: none;
    align-items: center;
    gap: var(--space-8);
}

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

.navbar-link {
    position: relative;
    font-size: var(--text-body-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    transition: var(--transition-fast);
}

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

.navbar-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary-500);
    transition: var(--transition-base);
}

.navbar-link:hover::after,
.navbar-link.active::after {
    width: 100%;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
}

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

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    transition: var(--transition-fast);
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 4.5rem;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-background);
    padding: var(--space-6);
    transform: translateX(100%);
    transition: var(--transition-slow);
    overflow-y: auto;
    z-index: var(--z-fixed);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.mobile-menu-link {
    font-size: var(--text-h4);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-subtle);
    transition: var(--transition-fast);
}

.mobile-menu-link:hover {
    color: var(--color-primary-500);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 1.5rem;
    font-size: var(--text-body-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--text-caption);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--text-body);
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: var(--text-body-lg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
    box-shadow: var(--shadow-md), var(--glow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-primary-lg);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success-500), var(--color-success-600));
    color: white;
    box-shadow: var(--shadow-md), var(--glow-success);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--color-success-600), var(--color-success-700));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-success-lg);
}

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

.btn-secondary:hover {
    background: var(--color-background-alt);
    border-color: var(--color-primary-500);
    color: var(--color-primary-500);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-background-alt);
    color: var(--color-text-primary);
}

.btn-link {
    padding: 0;
    color: var(--color-primary-500);
    font-weight: var(--font-weight-medium);
}

.btn-link:hover {
    text-decoration: underline;
}

/* Button with icon */
.btn svg {
    width: 1.25em;
    height: 1.25em;
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-subtle);
    overflow: hidden;
    transition: var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary-200);
}

.dark .card-hover:hover {
    border-color: var(--color-primary-500);
}

.card-body {
    padding: var(--space-6);
}

.card-body-lg {
    padding: var(--space-8);
}

/* Feature Card */
.feature-card {
    padding: var(--space-8);
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border-subtle);
    transition: var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary-200);
}

.dark .feature-card:hover {
    border-color: var(--color-primary-500);
}

.feature-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-100), var(--color-primary-50));
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
}

.dark .feature-card-icon {
    background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-800));
}

.feature-card-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--color-primary-500);
}

.feature-card-title {
    font-size: var(--text-h4);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-3);
}

.feature-card-description {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

/* Stats Card */
.stats-card {
    text-align: center;
    padding: var(--space-8);
}

.stats-card-value {
    font-size: var(--text-display);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-500);
    margin-bottom: var(--space-2);
}

.stats-card-label {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

/* ==========================================================================
   LOAN CALCULATOR (SIGNATURE COMPONENT)
   ========================================================================== */
.calculator-card {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
    padding: var(--space-8);
    box-shadow: var(--shadow-2xl);
}

.calculator-title {
    font-size: var(--text-h3);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-6);
    text-align: center;
}

.calculator-field {
    margin-bottom: var(--space-6);
}

.calculator-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.calculator-label-text {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.calculator-label-value {
    font-size: var(--text-h3);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-500);
}

/* Range Slider */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--color-primary-500);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-md), var(--glow-primary);
    transition: var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg), var(--glow-primary-lg);
}

.range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--color-primary-500);
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md), var(--glow-primary);
}

.range-slider::-moz-range-track {
    height: 8px;
    background: var(--color-border);
    border-radius: var(--radius-full);
}

/* Calculator Results */
.calculator-results {
    background: linear-gradient(135deg, var(--color-primary-50), var(--color-primary-100));
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-top: var(--space-6);
}

.dark .calculator-results {
    background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-800));
}

.calculator-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
}

.calculator-result-row:not(:last-child) {
    border-bottom: 1px solid var(--color-primary-200);
}

.dark .calculator-result-row:not(:last-child) {
    border-bottom: 1px solid var(--color-primary-700);
}

.calculator-result-label {
    color: var(--color-text-secondary);
}

.calculator-result-value {
    font-weight: var(--font-weight-bold);
    font-size: var(--text-h4);
}

.calculator-monthly {
    text-align: center;
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 2px solid var(--color-primary-300);
}

.dark .calculator-monthly {
    border-top-color: var(--color-primary-600);
}

.calculator-monthly-label {
    font-size: var(--text-body-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

.calculator-monthly-value {
    font-size: var(--text-display);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-primary-600);
}

.dark .calculator-monthly-value {
    color: var(--color-primary-400);
}

.calculator-monthly-suffix {
    font-size: var(--text-body);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-secondary);
}

/* ==========================================================================
   QUALIFICATION METER (SIGNATURE COMPONENT)
   ========================================================================== */
.qualification-meter {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--color-border-subtle);
}

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

.qualification-title {
    font-weight: var(--font-weight-semibold);
}

.qualification-score {
    font-size: var(--text-h3);
    font-weight: var(--font-weight-bold);
    color: var(--color-success-500);
}

.qualification-bar {
    height: 12px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.qualification-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-danger-500), var(--color-warning-500), var(--color-success-500));
    border-radius: var(--radius-full);
    transition: width 0.5s ease-out;
}

.qualification-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-2);
    font-size: var(--text-caption);
    color: var(--color-text-tertiary);
}

/* ==========================================================================
   RATE COMPARISON TABLE (SIGNATURE COMPONENT)
   ========================================================================== */
.rate-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.rate-table th,
.rate-table td {
    padding: var(--space-4) var(--space-5);
    text-align: left;
}

.rate-table th {
    background: var(--color-primary-500);
    color: white;
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-body-sm);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

.rate-table td {
    border-bottom: 1px solid var(--color-border-subtle);
}

.rate-table tr:last-child td {
    border-bottom: none;
}

.rate-table tbody tr {
    transition: var(--transition-fast);
}

.rate-table tbody tr:hover {
    background: var(--color-background-alt);
}

.rate-highlight {
    background: var(--color-success-50) !important;
    position: relative;
}

.dark .rate-highlight {
    background: rgba(34, 197, 94, 0.1) !important;
}

.rate-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--color-success-500);
    color: white;
    font-size: var(--text-caption);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
}

.rate-value {
    font-size: var(--text-h4);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-500);
}

/* ==========================================================================
   MONTHLY PAYMENT PREVIEW (SIGNATURE COMPONENT)
   ========================================================================== */
.payment-preview {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-6);
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    border-radius: var(--radius-xl);
    color: white;
}

.payment-preview-icon {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    flex-shrink: 0;
}

.payment-preview-icon svg {
    width: 2rem;
    height: 2rem;
}

.payment-preview-content {
    flex: 1;
}

.payment-preview-label {
    font-size: var(--text-body-sm);
    opacity: 0.9;
    margin-bottom: var(--space-1);
}

.payment-preview-amount {
    font-size: var(--text-h1);
    font-weight: var(--font-weight-bold);
}

.payment-preview-amount span {
    font-size: var(--text-body);
    font-weight: var(--font-weight-normal);
    opacity: 0.8;
}

.payment-preview-action {
    background: white;
    color: var(--color-primary-600);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-semibold);
    transition: var(--transition-fast);
}

.payment-preview-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-size: var(--text-body);
    color: var(--color-text-primary);
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-100);
}

.dark .form-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.form-input::placeholder {
    color: var(--color-text-tertiary);
}

.form-input-lg {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-body-lg);
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    background-size: 1rem;
    padding-right: var(--space-10);
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
}

.form-checkbox input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--color-primary-500);
    flex-shrink: 0;
    margin-top: 2px;
}

.form-checkbox-label {
    color: var(--color-text-secondary);
    line-height: var(--line-height-normal);
}

/* Form Help Text */
.form-help {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-body-sm);
    color: var(--color-text-tertiary);
}

/* Form Error */
.form-error {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-body-sm);
    color: var(--color-danger-500);
}

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */
.testimonial-card {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    border: 1px solid var(--color-border-subtle);
    transition: var(--transition-base);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.testimonial-stars {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}

.testimonial-stars svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-warning-500);
    fill: var(--color-warning-500);
}

.testimonial-content {
    font-size: var(--text-body-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.testimonial-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.testimonial-info {
    flex: 1;
}

.testimonial-name {
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-1);
}

.testimonial-meta {
    font-size: var(--text-body-sm);
    color: var(--color-text-tertiary);
}

/* ==========================================================================
   BLOG CARDS
   ========================================================================== */
.blog-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--color-border-subtle);
    transition: var(--transition-base);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.blog-card-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-category {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    padding: var(--space-1) var(--space-3);
    background: var(--color-primary-500);
    color: white;
    font-size: var(--text-caption);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
}

.blog-card-body {
    padding: var(--space-6);
}

.blog-card-date {
    font-size: var(--text-body-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-2);
}

.blog-card-title {
    font-size: var(--text-h4);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-3);
    line-height: var(--line-height-snug);
}

.blog-card-excerpt {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */
.faq-item {
    border-bottom: 1px solid var(--color-border-subtle);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) 0;
    text-align: left;
    font-size: var(--text-body-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    transition: var(--transition-fast);
}

.faq-question:hover {
    color: var(--color-primary-500);
}

.faq-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    transition: var(--transition-base);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer-inner {
    padding-bottom: var(--space-5);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background: var(--color-neutral-900);
    color: white;
    padding-top: var(--space-16);
    padding-bottom: var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

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

.footer-brand {
    grid-column: span 2;
}

@media (min-width: 768px) {
    .footer-brand {
        grid-column: span 1;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-4);
}

.footer-logo svg {
    width: 2rem;
    height: 2rem;
    color: var(--color-primary-400);
}

.footer-description {
    color: var(--color-neutral-400);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-6);
    max-width: 20rem;
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.footer-social-link {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-neutral-800);
    border-radius: var(--radius-lg);
    color: var(--color-neutral-400);
    transition: var(--transition-fast);
}

.footer-social-link:hover {
    background: var(--color-primary-500);
    color: white;
}

.footer-social-link svg {
    width: 1.25rem;
    height: 1.25rem;
}

.footer-title {
    font-size: var(--text-body-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wider);
    margin-bottom: var(--space-4);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-link {
    color: var(--color-neutral-400);
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: white;
}

.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-neutral-800);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-copyright {
    color: var(--color-neutral-500);
    font-size: var(--text-body-sm);
}

.footer-legal {
    display: flex;
    gap: var(--space-6);
}

.footer-legal-link {
    color: var(--color-neutral-500);
    font-size: var(--text-body-sm);
    transition: var(--transition-fast);
}

.footer-legal-link:hover {
    color: white;
}

/* ==========================================================================
   BADGES & TAGS
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-caption);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
}

.badge-primary {
    background: var(--color-primary-100);
    color: var(--color-primary-700);
}

.dark .badge-primary {
    background: var(--color-primary-900);
    color: var(--color-primary-300);
}

.badge-success {
    background: var(--color-success-100);
    color: var(--color-success-700);
}

.dark .badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success-400);
}

.badge-warning {
    background: var(--color-warning-100);
    color: var(--color-warning-600);
}

.badge-new {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: center;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-background-alt);
    border-radius: var(--radius-lg);
    font-size: var(--text-body-sm);
    color: var(--color-text-secondary);
}

.trust-badge svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-success-500);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: calc(4.5rem + var(--space-12));
    padding-bottom: var(--space-12);
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-gradient {
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
}

.hero-gradient-1 {
    top: -200px;
    right: -200px;
    background: var(--color-primary-400);
}

.hero-gradient-2 {
    bottom: -200px;
    left: -200px;
    background: var(--color-success-400);
}

.hero-grid {
    display: grid;
    gap: var(--space-12);
    align-items: center;
}

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

.hero-content {
    max-width: 36rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-success-100);
    color: var(--color-success-700);
    border-radius: var(--radius-full);
    font-size: var(--text-body-sm);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-6);
}

.dark .hero-badge {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success-400);
}

.hero-badge svg {
    width: 1rem;
    height: 1rem;
}

.hero-title {
    margin-bottom: var(--space-6);
}

.hero-description {
    font-size: var(--text-body-lg);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-8);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.hero-stats {
    display: flex;
    gap: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.hero-stat-value {
    font-size: var(--text-h2);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-500);
}

.hero-stat-label {
    font-size: var(--text-body-sm);
    color: var(--color-text-tertiary);
}

/* ==========================================================================
   SCROLL ANIMATIONS
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

.reveal-blur {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-blur.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ==========================================================================
   HOVER EFFECTS
   ========================================================================== */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--glow-primary-lg);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Image zoom on hover */
.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-zoom:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   CONTINUOUS ANIMATIONS
   ========================================================================== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-pulse-soft {
    animation: pulse-soft 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

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

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mx-auto { margin-left: auto; margin-right: auto; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }

.relative { position: relative; }
.absolute { position: absolute; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-blur {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* ==========================================================================
   SELECTION & SCROLLBAR
   ========================================================================== */
::selection {
    background: var(--color-primary-200);
    color: var(--color-primary-900);
}

.dark ::selection {
    background: var(--color-primary-700);
    color: white;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-neutral-300);
    border-radius: var(--radius-full);
    border: 3px solid var(--color-background);
}

.dark ::-webkit-scrollbar-thumb {
    background: var(--color-neutral-600);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-400);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-500);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    .navbar,
    .footer,
    .btn,
    .mobile-menu {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */
.section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* GPU acceleration for animations */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale,
.reveal-blur,
.hover-lift,
.hover-scale,
.animate-float {
    will-change: transform, opacity;
    transform: translateZ(0);
}
