/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--radius) 0;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* =====================================================
   WCAG 2.1 AA Focus Styles
   ===================================================== */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast focus for buttons */
button:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.2);
}

/* Upload box focus state */
.upload-box:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
    border-color: var(--primary);
}

/* Ensure minimum color contrast - reduce motion for vestibular disorders */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --gray-400: #555;
        --gray-500: #444;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

/* User Auth Area */
.user-auth-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    cursor: pointer;
}

.user-avatar-header {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
}

.user-dropdown-header {
    display: flex;
    flex-direction: column;
}

.user-name-header {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
}

.user-tier-header {
    font-size: 0.6875rem;
    color: var(--primary);
    font-weight: 500;
}

.dropdown-menu-header {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 0.5rem 0;
    min-width: 180px;
    display: none;
    z-index: 100;
    margin-top: 0.5rem;
}

.user-menu-header:hover .dropdown-menu-header {
    display: block;
}

.dropdown-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.dropdown-item-header:hover {
    background: var(--gray-100);
}

.dropdown-item-header svg {
    color: var(--gray-400);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-full {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 4rem 2rem 6rem;
    text-align: center;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Upload Section */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-box {
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.upload-box:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.upload-box.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--gray-400);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.upload-hint {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.upload-formats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.format-badge {
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.format-info {
    color: var(--gray-400);
}

.tier-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.tier-icon {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
}

.tier-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.tier-link:hover {
    text-decoration: underline;
}

/* Processing Section */
.processing-section {
    max-width: 400px;
    margin: 0 auto;
}

.processing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-card h3 {
    font-size: 1.125rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.processing-status {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.3s ease;
}

/* Results Section */
.results-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.results-subtitle {
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.results-actions {
    display: flex;
    gap: 0.75rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon-blue {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-icon-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon-orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Table */
.table-container {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.results-table td {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

.results-table tbody tr:hover {
    background: var(--gray-50);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.merchant-name {
    font-weight: 600;
    color: var(--gray-900);
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-entertainment { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.category-streaming { background: rgba(236, 72, 153, 0.1); color: #db2777; }
.category-software { background: rgba(14, 165, 233, 0.1); color: #0284c7; }
.category-fitness { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.category-news { background: rgba(249, 115, 22, 0.1); color: #ea580c; }
.category-utilities { background: rgba(107, 114, 128, 0.1); color: #4b5563; }

.amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.frequency-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--gray-600);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-suspicious {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-new {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Pro Upsell */
.pro-upsell {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.upsell-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.upsell-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upsell-icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.upsell-text {
    flex: 1;
    min-width: 250px;
}

.upsell-text h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.upsell-text p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Features Section */
.features-section {
    padding: 4rem 2rem;
    background: var(--white);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.9375rem;
}

/* Pricing Section */
.pricing-section {
    padding: 4rem 2rem;
    background: var(--gray-50);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    position: relative;
}

.pricing-card-featured {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary);
}

.featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient);
    color: var(--white);
    padding: 0.375rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.pricing-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-500);
}

.pricing-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.pricing-features svg {
    width: 18px;
    height: 18px;
    color: var(--success);
    flex-shrink: 0;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 2rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-800);
}

.footer-brand .logo {
    margin-bottom: 0.5rem;
}

.footer-brand .logo-icon {
    color: var(--primary-light);
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-brand p {
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ============================================
   NEW STYLES: Experimental Banner, Disclaimers, Language Selector
   ============================================ */

/* Beta Badge */
.beta-badge {
    background: var(--warning);
    color: var(--gray-900);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Language Selector */
.language-selector {
    position: relative;
    margin-left: 1rem;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.375rem 0.75rem;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.15s;
}

.lang-option:hover {
    background: var(--gray-100);
}

.lang-option:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Experimental Banner */
.experimental-banner {
    background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid #f59e0b;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #92400e;
}

.experimental-banner svg {
    flex-shrink: 0;
    color: #d97706;
}

/* Data Notice (Privacy Box) */
.data-notice {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #10b981;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.notice-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: #065f46;
}

.notice-header svg {
    width: 24px;
    height: 24px;
    color: #10b981;
}

.notice-header strong {
    font-size: 1rem;
    font-weight: 600;
}

.notice-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notice-list li {
    font-size: 0.875rem;
    color: #065f46;
    line-height: 1.5;
}

.notice-list strong {
    font-weight: 600;
}

/* Results Disclaimer */
.results-disclaimer {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.results-disclaimer svg {
    flex-shrink: 0;
    color: #d97706;
    margin-top: 0.125rem;
}

.results-disclaimer p {
    font-size: 0.875rem;
    color: #92400e;
    line-height: 1.5;
    margin: 0;
}

/* Legal Section */
.legal-section {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.legal-box {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
}

.legal-box h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.legal-box p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.7;
}

.legal-box strong {
    color: var(--gray-700);
}

/* Accessibility Section */
.accessibility-section {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.accessibility-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
}

.accessibility-box h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.accessibility-box p {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.accessibility-features {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
}

.accessibility-features li {
    background: white;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

/* Mobile Responsive for new elements */
@media (max-width: 640px) {
    .experimental-banner {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }
    
    .experimental-banner svg {
        display: none;
    }
    
    .data-notice {
        padding: 1rem;
    }
    
    .notice-list li {
        font-size: 0.8125rem;
    }
    
    .results-disclaimer {
        flex-direction: column;
        padding: 1rem;
    }
    
    .results-disclaimer svg {
        align-self: center;
    }
    
    .legal-box {
        padding: 1rem 1.25rem;
    }
    
    .language-selector {
        margin-left: 0.5rem;
    }
    
    .lang-btn span {
        display: none;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    text-align: center;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    width: 32px;
    height: 32px;
    color: var(--white);
}

.modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.modal p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.modal-price {
    margin-bottom: 1.5rem;
}

.modal-price-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-price-period {
    font-size: 1rem;
    color: var(--gray-500);
}

.upgrade-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

.upgrade-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-note {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Privacy Notice */
.privacy-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.privacy-notice svg {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}

/* Summary Card */
.summary-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.summary-icon svg {
    width: 24px;
    height: 24px;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.summary-amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.amount-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.amount-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.amount-period {
    font-size: 1rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-stat.stat-primary .stat-number {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-align: center;
}

/* Subscriptions List */
.subscriptions-list {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    max-width: 700px;
    margin: 0 auto 2rem;
    overflow: hidden;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.list-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.subscriptions-table {
    display: flex;
    flex-direction: column;
}

/* subscription-row styling moved to end of file for forgot button support */

.subscription-row:last-child {
    border-bottom: none;
}

.subscription-row:hover {
    background: var(--gray-50);
}

.sub-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sub-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.9375rem;
}

.sub-category {
    display: inline-block;
    width: fit-content;
    padding: 0.125rem 0.5rem;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sub-next {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.next-label {
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.next-date {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.next-days {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sub-next.urgent .next-date,
.sub-next.urgent .next-days {
    color: var(--danger);
}

.sub-next.soon .next-date,
.sub-next.soon .next-days {
    color: var(--warning);
}

.sub-amount {
    display: flex;
    align-items: baseline;
    gap: 0.125rem;
    min-width: 80px;
    justify-content: flex-end;
}

.sub-amount .amount-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    background: none;
    -webkit-text-fill-color: var(--gray-900);
}

.sub-amount .amount-freq {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Empty State */
.empty-state {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--gray-500);
}

.empty-state svg {
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1.125rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
}

.summary-teaser {
    border-top: 1px solid var(--gray-200);
    padding-top: 1.5rem;
}

.summary-teaser p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.teaser-merchants {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.teaser-merchant {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: transparent;
    text-shadow: 0 0 8px var(--gray-500);
    user-select: none;
    transition: all 0.3s;
}

.teaser-merchant.revealed {
    color: var(--gray-700);
    text-shadow: none;
}

.teaser-more {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Upgrade Card */
.upgrade-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 900px;
    margin: 0 auto 2rem;
}

.upgrade-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: start;
}

.upgrade-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upgrade-icon svg {
    width: 32px;
    height: 32px;
    color: var(--white);
}

.upgrade-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.upgrade-text p {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.upgrade-features {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}

.upgrade-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.upgrade-features svg {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}

.upgrade-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
}

.price-tag {
    margin-bottom: 1rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gray-900);
}

.price-type {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.payment-note {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.75rem;
}

/* Detailed Report */
.detailed-report {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    max-width: 1000px;
    margin: 0 auto 2rem;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.report-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.report-actions {
    display: flex;
    gap: 0.75rem;
}

/* Scan Another Button */
.scan-another {
    text-align: center;
    margin-top: 2rem;
}

/* Payment Form in Modal */
.payment-form {
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Spinner small for buttons */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* How It Works Section */
.how-it-works {
    padding: 4rem 2rem;
    background: var(--white);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.step-number {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.step-icon {
    width: 64px;
    height: 64px;
    margin: 2rem auto 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.step-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--gray-600);
    font-size: 0.9375rem;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 2rem;
    background: var(--gray-50);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.faq-item p {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .nav-link {
        display: none;
    }

    .hero {
        padding: 2rem 1rem 4rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .upload-box {
        padding: 2rem 1.5rem;
    }

    .results-section {
        padding: 1.5rem 1rem;
    }

    .summary-card {
        padding: 1.5rem;
    }

    .amount-value {
        font-size: 3rem;
    }

    .summary-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .upgrade-card {
        padding: 1.5rem;
    }

    .upgrade-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .upgrade-icon {
        margin: 0 auto;
    }

    .upgrade-features {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .upgrade-action {
        width: 100%;
    }

    .btn-large {
        width: 100%;
    }

    .report-header {
        flex-direction: column;
        align-items: stretch;
    }

    .report-actions {
        justify-content: stretch;
    }

    .report-actions .btn {
        flex: 1;
    }

    .table-container {
        overflow-x: auto;
    }

    .results-table {
        min-width: 500px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* =====================================================
   GLOBAL SAVINGS BANNER
   ===================================================== */
.global-savings-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.savings-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.savings-content {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.savings-label {
    font-size: 0.875rem;
    opacity: 0.95;
}

.savings-amount {
    font-size: 1.75rem;
    font-weight: 800;
    transition: transform 0.3s, color 0.3s;
}

.savings-amount.updated {
    transform: scale(1.2);
    color: #fef08a;
}

.savings-period {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* =====================================================
   FORGOT THIS BUTTON
   ===================================================== */
.subscription-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
}

.forgot-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
    transition: all 0.2s;
    white-space: nowrap;
}

.forgot-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.forgot-btn:active:not(:disabled) {
    transform: translateY(0);
}

.forgot-btn.clicked {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
    color: #065f46;
    cursor: default;
}

.forgot-btn:disabled {
    opacity: 0.8;
}

.forgot-icon {
    font-size: 1rem;
}

.forgot-text {
    display: inline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .subscription-row {
        grid-template-columns: 1fr auto;
        gap: 0.75rem;
    }
    
    .sub-next {
        display: none;
    }
    
    .forgot-btn {
        padding: 0.375rem 0.5rem;
    }
    
    .forgot-text {
        display: none;
    }
    
    .global-savings-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .savings-amount {
        font-size: 1.5rem;
    }
}

/* =====================================================
   HERO SAVINGS COUNTER - Marketing
   ===================================================== */
.hero-savings-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    margin: 1.5rem auto 2rem;
    max-width: 500px;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
        transform: scale(1.02);
    }
}

.hero-savings-icon {
    font-size: 2.5rem;
    animation: bounce 2s ease-in-out infinite;
}

.hero-savings-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.hero-savings-label {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

.hero-savings-amount {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-savings-suffix {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

@media (max-width: 768px) {
    .hero-savings-counter {
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .hero-savings-icon {
        font-size: 2rem;
    }
    
    .hero-savings-amount {
        font-size: 1.75rem;
    }
    
    .hero-savings-text {
        flex-direction: column;
        gap: 0.25rem;
    }
}
