/* ============================================
   TaxPal - Premium Design System V2
   "The Trust Upgrade" - Premium FinTech Aesthetic
   ============================================ */

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

/* Utility Classes */
.hidden {
    display: none !important;
}

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

/* ============================================
   2. DESIGN TOKENS (CSS VARIABLES)
   ============================================ */
:root {
    /* --- Colors: Refined Premium Palette --- */
    --color-primary-deep: #0D3B44;
    /* Deep Teal */
    --color-primary: #1A6B7C;
    /* Medium Teal */
    --color-primary-light: #4EADC5;
    /* Light Teal */
    --color-primary-faded: rgba(78, 173, 197, 0.12);

    --color-accent: #E8C670;
    /* Rich Gold - matches logo gradient */
    --color-accent-dark: #D4A03C;
    --color-accent-light: #F5E6C3;

    --color-success: #1B7340;
    /* Forest Green */
    --color-success-light: #D4EFDF;
    --color-danger: #A32929;
    /* Deep Red */
    --color-danger-light: #FADBD8;

    /* --- Neutrals (Premium Light Theme) --- */
    --color-bg-page: #F0F4F7;
    /* Soft gray-blue */
    --color-bg-card: rgba(255, 255, 255, 0.72);
    /* Frosted white */
    --color-bg-card-solid: #FFFFFF;
    --color-bg-subtle: rgba(255, 255, 255, 0.5);

    --color-text-primary: #0F1C24;
    /* Near black */
    --color-text-secondary: #3D5A6A;
    --color-text-muted: #7A9AAD;
    --color-text-inverse: #FFFFFF;

    --color-border: rgba(13, 59, 68, 0.12);
    --color-border-light: rgba(13, 59, 68, 0.06);
    --color-border-glass: rgba(255, 255, 255, 0.18);

    /* --- Shadows (Premium Elevation) --- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 60px rgba(78, 173, 197, 0.15);
    --shadow-focus: 0 0 0 3px rgba(26, 107, 124, 0.25);

    /* --- Glass Effect --- */
    --glass-blur: blur(16px);
    --glass-saturate: saturate(180%);

    /* --- Typography --- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Manrope', var(--font-sans);

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.75rem;
    --text-5xl: 3.5rem;

    --leading-tight: 1.15;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;

    --tracking-tight: -0.025em;
    --tracking-normal: 0;

    /* --- Spacing Scale --- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* --- Radii --- */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* --- Transitions --- */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   2b. DARK MODE THEME
   ============================================ */
[data-theme="dark"] {
    /* --- Colors: Dark Theme --- */
    --color-bg-page: #0F1419;
    --color-bg-card: rgba(30, 40, 50, 0.85);
    --color-bg-card-solid: #1A242E;
    --color-bg-subtle: rgba(255, 255, 255, 0.05);

    --color-text-primary: #F0F4F7;
    --color-text-secondary: #A0B4C4;
    --color-text-muted: #6B7F8E;
    --color-text-inverse: #0F1419;

    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-light: rgba(255, 255, 255, 0.05);
    --color-border-glass: rgba(255, 255, 255, 0.08);

    /* --- Shadows: Dark Theme --- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 60px rgba(78, 173, 197, 0.25);
}

/* ============================================
   2c. SKELETON LOADING ANIMATION
   ============================================ */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg-subtle) 25%,
            var(--color-border) 50%,
            var(--color-bg-subtle) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-card {
    height: 120px;
}

/* ============================================
   2d. SUCCESS ANIMATION
   ============================================ */
.success-burst {
    animation: successBurst 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes successBurst {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   3. TYPOGRAPHY & BODY
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

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

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background: var(--color-bg-page);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ============================================
   4. MESH GRADIENT BACKGROUND (Aurora Effect)
   ============================================ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(78, 173, 197, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 10%, rgba(212, 160, 60, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse 50% 80% at 10% 100%, rgba(27, 115, 64, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(78, 173, 197, 0.18) 0%, transparent 45%);
    animation: aurora 20s ease-in-out infinite alternate;
}

@keyframes aurora {
    0% {
        opacity: 0.85;
        transform: scale(1) translateY(0);
    }

    100% {
        opacity: 1;
        transform: scale(1.05) translateY(-20px);
    }
}

/* Noise texture overlay for depth */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text-primary);
}

/* ============================================
   5. LAYOUT PRIMITIVES
   ============================================ */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* ============================================
   6. HEADER (Premium Glass)
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg-card);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
}

.site-header__logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, var(--color-primary-deep), var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-inverse);
    box-shadow: 0 4px 12px rgba(13, 59, 68, 0.3);
}

.site-header__logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--text-xl);
    color: var(--color-primary-deep);
    letter-spacing: var(--tracking-tight);
}

/* Premium Trust Badge */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, var(--color-success), #1B7340);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-text-inverse);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(27, 115, 64, 0.35);
}

.trust-badge__icon {
    width: 14px;
    height: 14px;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-bg-card);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background: var(--color-bg-card-solid);
    color: var(--color-primary);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Show sun in dark mode, moon in light mode */
.theme-toggle__sun {
    display: none;
}

.theme-toggle__moon {
    display: block;
}

[data-theme="dark"] .theme-toggle__sun {
    display: block;
}

[data-theme="dark"] .theme-toggle__moon {
    display: none;
}

/* ============================================
   7. MAIN CONTENT
   ============================================ */
.main-content {
    padding: var(--space-12) 0 var(--space-20);
}

/* ============================================
   8. HERO SECTION (Premium)
   ============================================ */
.hero {
    text-align: center;
    margin-bottom: var(--space-12);
    padding: var(--space-8) 0;
}

.hero__title {
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-bottom: var(--space-5);
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-primary-deep) 50%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 520px;
    margin: 0 auto var(--space-8);
    line-height: var(--leading-relaxed);
}

/* Trust Points (Premium Pills) */
.trust-points {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
}

.trust-point {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.trust-point:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.trust-point__icon {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
}

/* ============================================
   9. CARD COMPONENT (Frosted Glass)
   ============================================ */
.card {
    background: var(--color-bg-card);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md), inset 0 1px 0 var(--color-border-glass);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg), inset 0 1px 0 var(--color-border-glass);
    transform: translateY(-2px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.card__header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.card__step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary-deep), var(--color-primary));
    color: var(--color-text-inverse);
    font-size: var(--text-sm);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(13, 59, 68, 0.25);
}

.card__title {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
}

/* ============================================
   10. FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: var(--space-4);
}

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

.form-input {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    background: var(--color-bg-card-solid);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all var(--transition-fast);
}

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

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus), inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ============================================
   11. DROPZONE (The Vault)
   ============================================ */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-8);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 244, 247, 0.6) 100%);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.dropzone::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed var(--color-border-light);
    border-radius: calc(var(--radius-xl) - 4px);
    pointer-events: none;
}

.dropzone:hover {
    border-color: var(--color-primary);
    background: linear-gradient(180deg, rgba(78, 173, 197, 0.08) 0%, rgba(78, 173, 197, 0.02) 100%);
    transform: scale(1.01);
}

.dropzone.drag-over {
    border-color: var(--color-primary);
    border-style: solid;
    background: linear-gradient(180deg, rgba(78, 173, 197, 0.12) 0%, rgba(78, 173, 197, 0.04) 100%);
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

.dropzone__icon {
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-4);
    color: var(--color-primary);
    opacity: 0.8;
    transition: all var(--transition-base);
}

.dropzone:hover .dropzone__icon {
    transform: translateY(-4px);
    opacity: 1;
}

.dropzone__text {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.dropzone__subtext {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* Supported Banks */
.supported-banks {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.supported-banks__tag {
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-card-solid);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.supported-banks__tag:hover {
    border-color: var(--color-primary-light);
    color: var(--color-primary);
}

/* File List */
.file-list {
    list-style: none;
    margin-top: var(--space-5);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--color-bg-card-solid);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.file-item__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-faded), rgba(78, 173, 197, 0.06));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-primary);
}

.file-item__name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.file-item__size {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.file-item__remove {
    padding: var(--space-2);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.file-item__remove:hover {
    color: var(--color-danger);
    background: var(--color-danger-light);
}

/* ============================================
   12. BUTTONS (Premium)
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 700;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-primary-deep) 0%, var(--color-primary) 100%);
    color: var(--color-text-inverse);
    box-shadow: 0 4px 16px rgba(13, 59, 68, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn--primary:hover::before {
    opacity: 1;
}

.btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(13, 59, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn--primary:active {
    transform: translateY(-1px);
}

.btn--lg {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
    border-radius: var(--radius-xl);
}

.btn--full {
    width: 100%;
}

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

/* ============================================
   13. LOADING STATE
   ============================================ */
.loading-state {
    text-align: center;
    padding: var(--space-12);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--space-4);
}

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

/* ============================================
   14. RESULTS SECTION (Premium)
   ============================================ */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.summary-card {
    background: var(--color-bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md), inset 0 1px 0 var(--color-border-glass);
    padding: var(--space-6);
    text-align: center;
    transition: all var(--transition-base);
}

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

.summary-card__label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.summary-card__value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
}

.summary-card__value--income {
    color: var(--color-success);
}

.summary-card__value--tax {
    background: linear-gradient(135deg, var(--color-accent), #B8860B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tax Breakdown */
.tax-breakdown {
    margin-bottom: var(--space-6);
}

.tax-bar {
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-bg-subtle);
    overflow: hidden;
    margin: var(--space-2) 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tax-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.tax-bar-fill--0 {
    background: linear-gradient(90deg, #94A3B8, #64748B);
}

.tax-bar-fill--15 {
    background: linear-gradient(90deg, var(--color-success-light), var(--color-success));
}

.tax-bar-fill--18 {
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
}

.tax-bar-fill--21 {
    background: linear-gradient(90deg, var(--color-accent-light), var(--color-accent));
}

.tax-bar-fill--23 {
    background: linear-gradient(90deg, #FDBA74, #EA580C);
}

.tax-bar-fill--25 {
    background: linear-gradient(90deg, var(--color-danger-light), var(--color-danger));
}

/* Excluded Summary */
.excluded-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-4);
}

.excluded-badge {
    padding: var(--space-4);
    background: var(--color-bg-card-solid);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.excluded-badge:hover {
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
}

.excluded-badge__count {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--color-text-primary);
}

.excluded-badge__label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Transactions Table */
.transactions-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

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

.transactions-table th,
.transactions-table td {
    padding: var(--space-4);
    text-align: left;
    font-size: var(--text-sm);
}

.transactions-table thead th {
    background: var(--color-bg-card-solid);
    color: var(--color-text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: var(--text-xs);
    border-bottom: 1px solid var(--color-border);
}

.transactions-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
}

.transactions-table tbody tr:hover {
    background: var(--color-primary-faded);
}

.transactions-table .amount {
    font-family: var(--font-display);
    font-weight: 700;
    text-align: right;
}

.transactions-table .amount--credit {
    color: var(--color-success);
}

.bank-tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-primary-faded);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-primary-deep);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-bg-card-solid);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(.active):not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--color-primary-deep), var(--color-primary));
    color: var(--color-text-inverse);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(13, 59, 68, 0.25);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   15. FOOTER
   ============================================ */
.site-footer {
    text-align: center;
    padding: var(--space-10);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.site-footer__disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-weight: 500;
}

/* ============================================
   16. UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

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

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

/* ============================================
   17. ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

/* ============================================
   18. RESPONSIVE OVERRIDES
   ============================================ */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .hero__title {
        font-size: var(--text-3xl);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 var(--space-4);
    }

    .hero__title {
        font-size: var(--text-2xl);
    }

    .hero__subtitle {
        font-size: var(--text-base);
    }

    .card {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
    }

    .dropzone {
        padding: var(--space-8) var(--space-4);
    }

    .trust-points {
        flex-direction: column;
        align-items: center;
    }

    .site-header__inner {
        flex-direction: column;
        gap: var(--space-3);
    }

    .summary-card__value {
        font-size: var(--text-2xl);
    }
}

/* ============================================
   19. V3 - CURSOR SPOTLIGHT EFFECT
   ============================================ */
.card--spotlight {
    --spotlight-x: 50%;
    --spotlight-y: 50%;
    --spotlight-opacity: 0;
}

.card--spotlight::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at var(--spotlight-x) var(--spotlight-y),
            rgba(78, 173, 197, 0.15),
            transparent 40%);
    opacity: var(--spotlight-opacity);
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   20. V3 - SMART SCANNER ANIMATION
   ============================================ */
.scanner-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    text-align: center;
}

.scanner-icon {
    position: relative;
    width: 80px;
    height: 100px;
    margin-bottom: var(--space-6);
}

.scanner-icon__file {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--color-bg-card-solid), var(--color-bg-subtle));
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: var(--shadow-md);
}

.scanner-icon__file::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    background: var(--color-bg-card-solid);
    border-left: 2px solid var(--color-border);
    border-bottom: 2px solid var(--color-border);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.scanner-icon__beam {
    position: absolute;
    left: -8px;
    right: -8px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-primary-light), var(--color-primary), transparent);
    border-radius: var(--radius-full);
    box-shadow: 0 0 12px var(--color-primary-light), 0 0 24px rgba(78, 173, 197, 0.4);
    animation: scanBeam 1.5s ease-in-out infinite;
}

@keyframes scanBeam {

    0%,
    100% {
        top: 10%;
        opacity: 0.5;
    }

    50% {
        top: 80%;
        opacity: 1;
    }
}

.scanner-text {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.scanner-subtext {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ============================================
   21. V3 - DONUT CHART
   ============================================ */
.donut-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-6) 0;
}

.donut-chart {
    position: relative;
    width: 180px;
    height: 180px;
}

.donut-chart__svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-chart__ring {
    fill: none;
    stroke-width: 20;
    stroke-linecap: round;
}

.donut-chart__ring--bg {
    stroke: var(--color-bg-subtle);
}

.donut-chart__ring--income {
    stroke: url(#incomeGradient);
    transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.donut-chart__ring--tax {
    stroke: url(#taxGradient);
    transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.donut-chart__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.donut-chart__value {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--color-text-primary);
}

.donut-chart__label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

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

.donut-legend__color {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
}

.donut-legend__color--income {
    background: linear-gradient(135deg, var(--color-success-light), var(--color-success));
}

.donut-legend__color--tax {
    background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent));
}

.donut-legend__text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.donut-legend__value {
    font-weight: 700;
    color: var(--color-text-primary);
}

/* ============================================
   22. V3 - BENTO GRID (Trust Points)
   ============================================ */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-10);
}

.bento-item {
    background: var(--color-bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.bento-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.bento-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.bento-item:hover::before {
    opacity: 1;
}

.bento-item__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-faded), rgba(78, 173, 197, 0.05));
    border-radius: var(--radius-lg);
    color: var(--color-primary);
}

.bento-item__icon svg {
    width: 24px;
    height: 24px;
}

.bento-item__title {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.bento-item__desc {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
}

/* Bento responsive */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .donut-chart-container {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .bento-item {
        padding: var(--space-4);
    }

    .bento-item__icon {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   23. MOBILE-FIRST RESPONSIVE DESIGN
   ============================================ */

/* --- Safe Area Support (iPhone notch, home bar) --- */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-content {
        padding-bottom: calc(var(--space-20) + env(safe-area-inset-bottom));
    }

    .site-header {
        padding-top: env(safe-area-inset-top);
    }
}

/* --- Mobile: 480px and below --- */
@media (max-width: 480px) {

    /* Touch-friendly base sizing */
    :root {
        --touch-target-min: 48px;
    }

    /* Container */
    .container {
        padding: 0 var(--space-4);
    }

    /* Header: Stack vertically */
    .site-header__inner {
        flex-direction: column;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
    }

    .site-header__brand {
        gap: var(--space-2);
    }

    .site-header__logo-icon {
        width: 40px;
        height: 40px;
    }

    .site-header__logo-text {
        font-size: var(--text-lg);
    }

    .trust-badge {
        font-size: 0.65rem;
        padding: var(--space-1) var(--space-3);
    }

    /* Hero: Compact mobile */
    .hero {
        margin-bottom: var(--space-8);
        padding: var(--space-4) 0;
    }

    .hero__title {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-3);
    }

    .hero__subtitle {
        font-size: var(--text-sm);
        margin-bottom: var(--space-6);
    }

    /* Bento Grid: Single column */
    .bento-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
        margin-bottom: var(--space-6);
    }

    .bento-item {
        padding: var(--space-4);
        display: flex;
        align-items: center;
        gap: var(--space-4);
        text-align: left;
    }

    .bento-item__icon {
        margin: 0;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
    }

    .bento-item__title {
        margin-bottom: var(--space-1);
    }

    .bento-item__desc {
        font-size: var(--text-xs);
    }

    /* Cards: Touch-friendly padding */
    .card {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
        margin-bottom: var(--space-4);
    }

    .card__header {
        margin-bottom: var(--space-4);
        gap: var(--space-3);
    }

    .card__step-number {
        width: 32px;
        height: 32px;
        font-size: var(--text-xs);
    }

    .card__title {
        font-size: var(--text-lg);
    }

    /* Form inputs: 48px minimum height */
    .form-input {
        min-height: var(--touch-target-min);
        font-size: var(--text-base);
        /* Prevents iOS zoom */
        padding: var(--space-3) var(--space-4);
    }

    .form-label {
        font-size: var(--text-xs);
    }

    /* Dropzone: Compact mobile */
    .dropzone {
        padding: var(--space-6) var(--space-4);
        border-radius: var(--radius-lg);
    }

    .dropzone__icon {
        width: 40px;
        height: 40px;
        margin-bottom: var(--space-3);
    }

    .dropzone__text {
        font-size: var(--text-base);
    }

    .dropzone__subtext {
        font-size: var(--text-xs);
    }

    .supported-banks {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-2);
        margin-top: var(--space-4);
        font-size: var(--text-xs);
    }

    .supported-banks__tag {
        padding: var(--space-1) var(--space-2);
    }

    /* File list: Touch-friendly remove button */
    .file-item {
        padding: var(--space-3);
        gap: var(--space-3);
    }

    .file-item__icon {
        width: 40px;
        height: 40px;
    }

    .file-item__remove {
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Buttons: Full width, 48px height */
    .btn {
        width: 100%;
        min-height: var(--touch-target-min);
        font-size: var(--text-base);
    }

    .btn--lg {
        min-height: 56px;
        font-size: var(--text-lg);
        padding: var(--space-4) var(--space-6);
    }

    /* Summary Cards: Stack */
    .summary-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .summary-card {
        padding: var(--space-4);
    }

    .summary-card__value {
        font-size: var(--text-2xl);
    }

    .summary-card__label {
        font-size: var(--text-xs);
    }

    /* Donut Chart: Stack vertically */
    .donut-chart-container {
        flex-direction: column;
        gap: var(--space-6);
        padding: var(--space-4) 0;
    }

    .donut-chart {
        width: 160px;
        height: 160px;
    }

    .donut-chart__value {
        font-size: var(--text-xl);
    }

    .donut-legend {
        flex-direction: row;
        gap: var(--space-6);
    }

    /* Tax Breakdown */
    .tax-bar {
        height: 12px;
    }

    /* Excluded Summary */
    .excluded-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .excluded-badge {
        padding: var(--space-3);
    }

    .excluded-badge__count {
        font-size: var(--text-xl);
    }

    /* Transactions Table: Horizontal scroll */
    .transactions-table-wrapper {
        margin: 0 calc(var(--space-5) * -1);
        padding: 0 var(--space-5);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .transactions-table th,
    .transactions-table td {
        padding: var(--space-3) var(--space-2);
        font-size: var(--text-xs);
        white-space: nowrap;
    }

    /* Pagination: Larger touch targets */
    .pagination {
        gap: var(--space-1);
    }

    .page-btn {
        min-width: var(--touch-target-min);
        height: var(--touch-target-min);
        font-size: var(--text-sm);
    }

    /* Footer */
    .site-footer {
        padding: var(--space-8) var(--space-4);
        font-size: var(--text-xs);
    }

    .site-footer__disclaimer {
        flex-direction: column;
        gap: var(--space-1);
    }

    /* Scanner (Loading) */
    .scanner-state {
        padding: var(--space-8);
    }

    .scanner-icon {
        width: 60px;
        height: 75px;
        margin-bottom: var(--space-4);
    }

    .scanner-text {
        font-size: var(--text-base);
    }

    .scanner-subtext {
        font-size: var(--text-xs);
    }
}

/* --- Tablet: 481px to 768px --- */
@media (min-width: 481px) and (max-width: 768px) {
    .hero__title {
        font-size: var(--text-3xl);
    }

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

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

/* --- Disable hover effects on touch devices --- */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
        box-shadow: var(--shadow-md), inset 0 1px 0 var(--color-border-glass);
    }

    .bento-item:hover {
        transform: none;
    }

    .bento-item:hover::before {
        opacity: 0;
    }

    .trust-point:hover {
        transform: none;
    }

    .btn--primary:hover {
        transform: none;
    }

    .summary-card:hover {
        transform: none;
    }
}

/* ============================================
   24. MOBILE UX ENHANCEMENTS
   ============================================ */

/* --- Active/Press States (Native Feel) --- */
.btn:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.bento-item:active,
.summary-card:active,
.file-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.dropzone:active {
    transform: scale(0.99);
    border-color: var(--color-primary);
}

/* --- Mobile Sticky CTA & Enhancements --- */
@media (max-width: 480px) {

    /* Tighter hero spacing */
    .hero {
        margin-bottom: var(--space-4);
        padding: var(--space-2) 0;
    }

    .hero__title {
        font-size: var(--text-xl);
        margin-bottom: var(--space-2);
    }

    .hero__subtitle {
        font-size: var(--text-xs);
        margin-bottom: var(--space-4);
        display: none;
        /* Hide subtitle on mobile for cleaner look */
    }

    /* Larger dropzone */
    .dropzone {
        min-height: 180px;
        padding: var(--space-8) var(--space-4);
    }

    /* Sticky bottom CTA */
    #processSection {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 50;
        padding: var(--space-4);
        padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(to top, var(--color-bg-page) 80%, transparent);
        margin-bottom: 0 !important;
    }

    #processSection .btn {
        box-shadow: var(--shadow-lg);
    }

    /* Add bottom padding to prevent content being hidden behind sticky button */
    .main-content {
        padding-bottom: 120px;
    }

    /* Compact bento items */
    .bento-grid {
        gap: var(--space-2);
        margin-bottom: var(--space-4);
    }

    .bento-item {
        padding: var(--space-3);
        gap: var(--space-3);
    }

    .bento-item__icon {
        width: 36px;
        height: 36px;
    }

    .bento-item__icon svg {
        width: 18px;
        height: 18px;
    }

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

    .bento-item__desc {
        display: none;
        /* Hide description on very small screens */
    }

    /* Compact cards */
    .card {
        padding: var(--space-4);
        margin-bottom: var(--space-3);
    }

    .card__header {
        margin-bottom: var(--space-3);
    }

    /* Compact file list */
    .file-item {
        padding: var(--space-2) var(--space-3);
    }

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

    .file-item__size {
        font-size: var(--text-xs);
    }
}