/* ============================================
   PREMIUM EXCHANGE - Ultra-Modern Design System
   Inspired by Stripe, Linear, Vercel, Apple
   ============================================ */

/* === CSS CUSTOM PROPERTIES === */
:root {
    /* Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-elevated: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    --accent-gold: #f59e0b;
    --accent-gold-dark: #d97706;
    --accent-gold-light: #fbbf24;
    --accent-blue: #3b82f6;
    --accent-blue-dark: #2563eb;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;

    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);

    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    /* Shadows - Premium Layered System */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 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-gold: 0 10px 40px -10px rgba(245, 158, 11, 0.3);
    --shadow-blue: 0 10px 40px -10px rgba(59, 130, 246, 0.3);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* Hero Elements */
    --hero-orb-1: #fde68a;
    --hero-orb-2: #bfdbfe;
    --hero-text: #0f172a;
    --hero-subtitle: #475569;

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

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

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

    /* Z-Index */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --bg-elevated: #1e293b;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --text-inverse: #0f172a;

    --border-color: #1e293b;
    --border-light: #0f172a;
    --border-dark: #334155;

    --gradient-hero: linear-gradient(135deg, #0a0e1a 0%, #1e293b 50%, #0f172a 100%);

    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);

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

    /* Hero Elements Dark */
    --hero-orb-1: rgba(245, 158, 11, 0.2);
    --hero-orb-2: rgba(59, 130, 246, 0.2);
    --hero-text: #ffffff;
    --hero-subtitle: rgba(255, 255, 255, 0.7);
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

/* === UTILITY CLASSES === */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.section {
    padding: var(--space-4xl) 0;
}

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

/* === GLASSMORPHISM COMPONENTS === */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
}

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

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px -10px rgba(245, 158, 11, 0.6);
}

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

.btn-secondary:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.hide-mobile {
    display: inline-flex;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* === HEADER - PREMIUM STICKY === */
.premium-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--transition-base);
}

.premium-header.scrolled {
    box-shadow: var(--glass-shadow);
    background: var(--bg-elevated);
    padding: var(--space-xs) 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    max-width: 1280px;
    margin: 0 auto;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-gold);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-gold);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    flex: 1;
    justify-content: center;
}

.mobile-menu-actions {
    display: none;
    /* Hidden on desktop, shown only in mobile media query */
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.25rem 0;
    transition: color var(--transition-base);
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    border-radius: 2px;
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-gold);
}

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

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-button {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.lang-button:hover {
    border-color: var(--accent-gold);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-sm);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all var(--transition-base);
    z-index: 10;
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-button {
    user-select: none;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
}

.lang-option:hover {
    background: var(--bg-secondary);
    color: var(--accent-gold);
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    border-color: var(--accent-gold);
    transform: rotate(180deg);
}

/* Mobile Menu Toggle - premium burger button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    padding: 0;
    transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base);
    position: relative;
}

.mobile-menu-toggle:hover {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.08);
}

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

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2.5px;
    border-radius: 2px;
    background: var(--text-primary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        background 0.2s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.1);
}

/* ===== Desktop: hide mobile-only nav elements ===== */
.mobile-nav-backdrop,
.mobile-menu-topbar,
.mobile-menu-close,
.mobile-menu-footer,
.mobile-menu-cta {
    display: none;
}

/* On desktop, .mobile-menu-links acts as transparent pass-through */
.mobile-menu-links {
    display: contents;
}

/* On desktop the nav-link arrow SVG should be hidden */
.header-nav .nav-link>svg:last-child {
    display: none;
}

/* === HERO SECTION === */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
    background: var(--gradient-hero);
    transition: background var(--transition-slow);
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
    mix-blend-mode: multiply;
}

[data-theme="dark"] .hero-orb {
    mix-blend-mode: screen;
    opacity: 0.4;
}

.hero-orb-1 {
    width: 600px;
    height: 600px;
    background: var(--hero-orb-1);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.hero-orb-2 {
    width: 500px;
    height: 500px;
    background: var(--hero-orb-2);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

.hero-content {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
    align-items: center;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-xl);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-xl);
    color: var(--hero-text);
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--hero-subtitle);
    margin-bottom: var(--space-2xl);
    max-width: 540px;
}

.hero-cta {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-3xl);
}

.hero-trust {
    display: flex;
    gap: var(--space-2xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--glass-border);
}

.trust-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.trust-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--hero-text);
}

.trust-label {
    font-size: 0.875rem;
    color: var(--hero-subtitle);
}

/* Hero Calculator Widget */
.hero-calculator {
    position: relative;
}

.calculator-widget {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-2xl);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.widget-badge {
    padding: var(--space-xs) var(--space-md);
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Calculator Form */
.calc-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.calc-input-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
}

.calc-input-group:focus-within {
    border-color: var(--accent-gold);
    background: var(--bg-tertiary);
}

.calc-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.calc-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    outline: none;
}

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

.calc-currency-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.calc-currency-selector:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-gold);
}

.calc-currency-selector.open {
    background: var(--bg-tertiary);
    border-color: var(--accent-gold);
}

.calc-currency-selector.open>svg:last-of-type {
    transform: rotate(180deg);
}

.calc-currency-selector>svg:last-of-type {
    transition: transform var(--transition-base);
}

/* Dropdown menu for currency selector */
.calc-currency-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 4px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.calc-currency-selector.open .calc-currency-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.calc-currency-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.calc-currency-option:hover {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-gold);
}

.calc-currency-option img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.calc-currency-empty {
    padding: 12px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.calc-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.calc-currency-code {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.swap-button {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    background: var(--gradient-gold);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-gold);
    transition: all var(--transition-base);
}

.swap-button:hover {
    transform: rotate(180deg) scale(1.1);
}

.calc-submit {
    width: 100%;
    margin-top: var(--space-md);
}

/* === RATES TICKER === */
.rates-ticker {
    background: var(--bg-secondary);
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.ticker-wrapper {
    display: flex;
    animation: ticker 30s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0 var(--space-2xl);
    white-space: nowrap;
}

.ticker-currency {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.ticker-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.ticker-rate {
    font-weight: 700;
    color: var(--text-primary);
}

.ticker-change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.ticker-change.up {
    color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.ticker-change.down {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* === FEATURES SECTION === */
.features-section {
    background: var(--bg-primary);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-4xl);
}

.section-badge {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-gold);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-2xl);
}

.feature-card {
    padding: var(--space-2xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-gold);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent-gold);
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.feature-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* === HOW IT WORKS === */
.how-it-works-section {
    background: var(--bg-secondary);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
    position: relative;
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 16.67%;
    right: 16.67%;
    height: 2px;
    background: var(--border-color);
}

.step-card {
    text-align: center;
    position: relative;
}

.step-number {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-xl);
    background: var(--gradient-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-gold);
    position: relative;
    z-index: 10;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.step-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* === STATS SECTION === */
.stats-section {
    background: var(--gradient-hero);
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2xl);
    text-align: center;
}

.stat-item {
    padding: var(--space-2xl) var(--space-xl);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* === TESTIMONIALS === */
.testimonials-section {
    background: var(--bg-primary);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-2xl);
}

.testimonial-card {
    padding: var(--space-2xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    transition: all var(--transition-base);
}

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

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

.testimonial-stars svg {
    width: 20px;
    height: 20px;
    fill: var(--accent-gold);
}

.testimonial-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    font-style: italic;
}

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

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.testimonial-name {
    font-weight: 600;
    color: var(--text-primary);
}

.testimonial-role {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* === FAQ SECTION === */
.faq-section {
    background: var(--bg-secondary);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.faq-item:hover {
    border-color: var(--accent-gold);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl);
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--transition-base);
}

.faq-question:hover {
    color: var(--accent-gold);
}

.faq-icon {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-base);
}

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

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

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

.faq-answer-content {
    padding: 0 var(--space-xl) var(--space-xl);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === POLICY PAGES (Privacy Policy / Service Policy) === */
.content-policy {
    max-width: 920px;
    margin: 0 auto;
    padding: 135px 24px 80px;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--text-primary, #1f2937);
    line-height: 1.85;
    font-size: 0.95rem;
}

.content-policy h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--text-primary, #111);
    border-bottom: 3px solid var(--accent-gold, #f59e0b);
    display: inline-block;
    padding-bottom: 8px;
}

.content-policy h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 32px;
    line-height: 1.6;
}

.content-policy h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 12px;
    color: var(--text-primary, #111);
}

.content-policy p {
    margin-bottom: 16px;
    text-align: justify;
    hyphens: auto;
}

.content-policy ol {
    counter-reset: section;
    list-style: none;
    padding-left: 0;
    margin: 24px 0;
}

.content-policy > ol > li {
    counter-increment: section;
    margin-bottom: 32px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary, #111);
}

.content-policy > ol > li::before {
    content: counter(section) ". ";
    color: var(--accent-gold, #f59e0b);
    font-weight: 800;
}

.content-policy > ol > li > ol {
    counter-reset: subsection;
    margin-top: 12px;
    padding-left: 20px;
}

.content-policy > ol > li > ol > li {
    counter-increment: subsection;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--text-primary, #374151);
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 2px solid var(--border-light, #e5e7eb);
}

.content-policy > ol > li > ol > li::before {
    content: counter(section) "." counter(subsection) " ";
    color: var(--accent-gold, #f59e0b);
    font-weight: 600;
    margin-right: 4px;
}

.content-policy > ol > li > ol > li > ol {
    margin-top: 8px;
    padding-left: 16px;
}

.content-policy > ol > li > ol > li > ol > li {
    border-left: none;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.content-policy ul,
.content-policy .list__,
.content-policy .list-abc,
.content-policy .country_list {
    padding-left: 24px;
    margin: 12px 0;
}

.content-policy ul li,
.content-policy .list__ li {
    font-weight: 400;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-secondary, #4b5563);
    list-style: none;
    padding-left: 16px;
    position: relative;
}

.content-policy ul li::before,
.content-policy .list__ li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent-gold, #f59e0b);
    font-weight: 700;
}

.content-policy .list-abc {
    list-style: lower-alpha;
}

.content-policy .list-abc li::before {
    display: none;
}

.content-policy .country_list {
    columns: 2;
    column-gap: 32px;
}

.content-policy .country_list li {
    break-inside: avoid;
    padding: 4px 0 4px 16px;
    font-size: 0.88rem;
}

/* Policy page back link */
.policy-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-gold, #f59e0b);
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s;
}
.policy-back-link:hover { color: var(--text-primary, #111); }
.policy-back-link svg { width: 16px; height: 16px; }

/* Support button on policy pages */
.policy-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 12px 28px;
    background: var(--accent-gold, #f59e0b);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.policy-support-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,158,11,0.4);
}
.policy-support-btn svg { width: 18px; height: 18px; fill: #fff; }

@media (max-width: 640px) {
    .content-policy { padding: 100px 16px 48px; }
    .content-policy h1 { font-size: 1.35rem; }
    .content-policy .country_list { columns: 1; }
}

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

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

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.footer-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
}

.footer-socials {
    display: flex;
    gap: var(--space-md);
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-3px);
}

.social-link svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: fill var(--transition-base);
}

.social-link:hover svg {
    fill: white;
}

.footer-column h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

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

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-link:hover {
    color: var(--accent-gold);
}

.footer-bottom {
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* === ANIMATIONS === */
.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

/* When JS loads, it adds .fade-init to enable the animation */
.fade-in.fade-init {
    opacity: 0;
    transform: translateY(30px);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 1;
    transform: translateX(0);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.slide-in-left.fade-init {
    opacity: 0;
    transform: translateX(-50px);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 1;
    transform: translateX(0);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.slide-in-right.fade-init {
    opacity: 0;
    transform: translateX(50px);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* === EXCHANGE MODAL === */
.exchange-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.exchange-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--accent-gold);
    border-radius: var(--radius-2xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    animation: modalOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

@keyframes modalOpen {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
    }

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

.modal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.modal-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-brand-icon svg {
    width: 18px;
    height: 18px;
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    color: var(--accent-gold);
    z-index: 100;
}

.modal-close:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-elevated);
    transform: rotate(90deg);
}

.modal-topbar .modal-close {
    position: static;
    top: auto;
    right: auto;
}

.modal-header {
    padding: var(--space-2xl) var(--space-2xl) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.modal-body {
    padding: var(--space-2xl);
}

.modal-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

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

.summary-row .label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.summary-row .value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.125rem;
}

.summary-row.highlight .value {
    color: var(--accent-gold);
    font-size: 1.5rem;
}

.summary-arrow {
    display: flex;
    justify-content: center;
    padding: var(--space-sm) 0;
    color: var(--accent-gold);
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-md) 0;
}

/* === POPUP CALCULATOR === */
.popup-calc {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.pop-row {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
}

.pop-input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.pop-input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pop-input {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-primary);
    transition: all var(--transition-base);
    width: 100%;
}

.pop-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.pop-input.readonly {
    background: var(--bg-primary);
    color: var(--accent-gold);
    cursor: default;
}

.pop-select {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.pop-select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.pop-swap-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-xs) 0;
    color: var(--accent-gold);
}

.pop-swap-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--accent-gold);
    cursor: pointer;
    padding: 0;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.pop-swap-btn:hover {
    transform: rotate(180deg);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.pop-swap-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.pop-rate-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    font-weight: 500;
}

.success-msg {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.success-msg h4 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-success);
    margin-bottom: var(--space-md);
}

.success-msg p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.6;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

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

.modal-footer {
    padding: var(--space-xl) var(--space-2xl);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

.success-message {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.success-message svg {
    margin-bottom: var(--space-xl);
}

.success-message h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-success);
    margin-bottom: var(--space-md);
}

.success-message p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.6;
}

.request-id {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-lg);
    color: var(--accent-success);
    font-weight: 700;
    font-size: 1.25rem;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-3xl);
    }

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

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-trust {
        justify-content: center;
    }

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

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

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

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

    .section {
        padding: var(--space-3xl) 0;
    }

    /* Header Mobile Refinement */
    .header-container {
        padding: var(--space-md) var(--space-lg);
    }

    .header-actions .lang-switcher,
    .header-actions .theme-toggle,
    .header-actions .btn {
        display: none !important;
    }

    /* When mobile menu is open, remove backdrop-filter from the header so
       that the fixed-positioned drawer is not trapped inside the header's
       containing block (backdrop-filter creates a new containing block for
       position:fixed descendants, clipping the drawer to header height). */
    body.menu-open .premium-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .header-logo span {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo-icon svg {
        width: 18px;
        height: 18px;
    }

    .header-nav {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(340px, 88vw);
        background: var(--bg-elevated);
        border-left: 1px solid var(--border-color);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.18);
        padding: 0;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        z-index: var(--z-sticky);
        overflow-y: auto;
        opacity: 0;
        transform: translateX(100%);
        pointer-events: none;
        transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header-nav::before {
        content: '';
        display: block;
        height: 4px;
        background: linear-gradient(90deg, #f59e0b 0%, #d97706 50%, #fbbf24 100%);
        flex-shrink: 0;
    }

    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.52);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: calc(var(--z-sticky) - 1);
        opacity: 0;
        transition: opacity 0.35s ease;
    }

    .mobile-nav-backdrop.active {
        display: block;
        opacity: 1;
    }

    .mobile-menu-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.1rem 1.25rem;
        border-bottom: 1px solid var(--border-light);
        flex-shrink: 0;
    }

    .mobile-menu-brand {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--text-primary);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-menu-brand span {
        color: var(--accent-gold);
    }

    .mobile-menu-close {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text-secondary);
        transition: all 0.2s;
        flex-shrink: 0;
    }

    .mobile-menu-close:hover {
        background: rgba(245, 158, 11, 0.12);
        color: var(--accent-gold);
        border-color: var(--accent-gold);
    }

    .mobile-menu-links {
        flex: 1;
        padding: 0.4rem 0;
        overflow-y: auto;
    }

    /* Re-enable .mobile-menu-links as a block container on mobile */
    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow-y: auto;
    }

    /* Show arrow SVGs on mobile nav links */
    .header-nav .nav-link>svg:last-child {
        display: block;
        color: var(--text-tertiary);
        flex-shrink: 0;
    }

    .mobile-menu-actions {
        display: none;
    }

    .mobile-menu-actions .lang-switcher {
        display: block;
        position: relative;
    }

    .mobile-menu-actions .lang-dropdown {
        left: 50%;
        transform: translateX(-50%);
        top: 100%;
        margin-top: 10px;
    }

    .header-nav.active {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-link {
        font-size: 1.05rem;
        font-weight: 500;
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-light);
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: var(--text-primary);
        transition: background 0.2s, color 0.2s, padding-left 0.2s;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link:hover {
        background: rgba(245, 158, 11, 0.07);
        color: var(--accent-gold);
        padding-left: 1.9rem;
    }

    .mobile-menu-footer {
        padding: 1rem 1.25rem 1.5rem;
        border-top: 1px solid var(--border-light);
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        flex-shrink: 0;
    }

    .mobile-menu-footer-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .mobile-menu-footer .lang-switcher {
        position: relative;
    }

    .mobile-menu-footer .lang-button {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .mobile-menu-footer .lang-dropdown {
        bottom: calc(100% + 8px);
        top: auto;
        left: 0;
        right: auto;
        transform: translateY(10px);
    }

    .mobile-menu-footer .lang-switcher:hover .lang-dropdown,
    .mobile-menu-footer .lang-switcher.open .lang-dropdown {
        transform: translateY(0);
    }

    /* Flip chevron when open */
    .lang-switcher.open .lang-button>svg:last-child {
        transform: rotate(180deg);
        transition: transform var(--transition-base);
    }

    .lang-button>svg:last-child {
        transition: transform var(--transition-base);
    }

    .mobile-menu-cta {
        display: block;
        width: 100%;
        padding: 0.875rem;
        background: var(--gradient-gold);
        color: #fff;
        font-weight: 700;
        font-size: 1rem;
        text-align: center;
        border-radius: var(--radius-lg);
        text-decoration: none;
        box-shadow: var(--shadow-gold);
        transition: opacity 0.2s, transform 0.2s;
    }

    .mobile-menu-cta:hover {
        opacity: 0.9;
        transform: translateY(-1px);
    }

    .mobile-menu-toggle {
        display: flex;
        z-index: calc(var(--z-sticky) + 1);
        position: relative;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
        background: var(--accent-gold);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
        background: var(--accent-gold);
    }

    /* Hero Section Mobile */
    .hero-section {
        padding-top: 80px;
        padding-bottom: var(--space-2xl);
        min-height: auto;
    }

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

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: var(--space-xl);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 320px;
    }

    .hero-trust {
        display: none !important;
    }

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

    /* Calculator Widget Mobile */
    .calculator-widget {
        padding: var(--space-xl);
    }

    .calc-input {
        font-size: 1.5rem;
    }

    .calc-input-group {
        padding: var(--space-md);
    }

    /* Features Mobile */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .feature-card {
        padding: var(--space-xl);
    }

    /* Steps Mobile */
    .steps-container {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .steps-container::before {
        display: none;
    }

    .step-number {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    /* Stats Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .stat-value {
        font-size: 2.5rem;
    }

    /* Testimonials Mobile */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .testimonial-card {
        padding: var(--space-xl);
    }

    /* Footer Mobile */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .footer-brand {
        max-width: 100%;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-socials {
        justify-content: center;
    }

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

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    /* Modal Mobile - Bottom Sheet Style */
    .exchange-modal-overlay {
        padding: 0;
        align-items: flex-end;
        justify-content: stretch;
    }

    .exchange-modal {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        height: auto;
        border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
        margin: 0;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }

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

    .modal-topbar {
        padding: var(--space-md) var(--space-lg);
        position: sticky;
        top: 0;
        background: var(--bg-elevated);
        z-index: 10;
    }

    .modal-brand {
        font-size: 1.1rem;
    }

    .modal-brand-icon {
        width: 28px;
        height: 28px;
    }

    .modal-brand-icon svg {
        width: 16px;
        height: 16px;
    }

    .modal-header {
        padding: var(--space-xl) var(--space-lg);
    }

    .modal-header h3 {
        font-size: 1.5rem;
    }

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

    .modal-summary {
        padding: var(--space-lg);
    }

    .summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .summary-row.highlight .value {
        font-size: 1.25rem;
    }

    .modal-form {
        gap: var(--space-md);
    }

    .form-group input,
    .form-group textarea {
        padding: var(--space-md);
        font-size: 16px;
        /* Prevents iOS zoom */
    }

    .modal-footer {
        flex-direction: column-reverse;
        padding: var(--space-lg);
        gap: var(--space-md);
        position: sticky;
        bottom: 0;
        background: var(--bg-elevated);
        border-top: 1px solid var(--border-color);
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-close {
        width: 34px;
        height: 34px;
    }

    /* Popup Form Mobile */
    .pop-row {
        gap: var(--space-sm);
    }

    .pop-input {
        font-size: 1rem;
        padding: var(--space-sm) var(--space-md);
    }

    .pop-select {
        font-size: 0.875rem;
        padding: var(--space-sm) var(--space-md);
        padding-right: 32px;
    }

    .success-msg h4 {
        font-size: 1.25rem;
    }

    .success-msg p {
        font-size: 1rem;
    }
}

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

    .section {
        padding: var(--space-xl) 0;
    }

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

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-trust {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .trust-item {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: var(--space-md);
        width: 100%;
    }

    .trust-item:last-child {
        border-bottom: none;
    }

    /* Calculator widget refinement */
    .calc-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }

    .calc-input {
        font-size: 1.25rem;
        text-align: center;
    }

    .calc-currency-selector {
        justify-content: center;
    }

    /* On narrow screens: dropdown spans full width of selector, anchor left */
    .calc-currency-menu {
        left: 0;
        right: 0;
        min-width: 0;
    }

    /* Footer bottom mobile */
    .footer-bottom {
        padding: var(--space-lg) 0;
    }

    .footer-bottom p {
        font-size: 0.8rem;
    }
}

/* === PRINT STYLES === */
@media print {

    .premium-header,
    .rates-ticker,
    .hero-calculator,
    .exchange-modal-overlay {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}


/* ============================================
   RATES PAGE (/rates)
   ============================================ */
.rates-page {
    padding: var(--space-3xl) 0 var(--space-4xl);
    background: var(--bg-secondary);
    min-height: 70vh;
}

.rates-page .container,
.rates-page .wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Header */
.rates-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
}

.rates-header-left {
    flex: 1 1 auto;
    min-width: 240px;
}

.rates-page-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
    letter-spacing: -0.02em;
}

.rates-page-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.rates-page-subtitle #globalUpdateTime {
    color: var(--accent-success);
    font-weight: 600;
}

.rates-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.rates-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 var(--space-md);
    min-width: 240px;
    transition: all var(--transition-base);
}

.rates-search-box:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.rates-search-box svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.rates-search-box input {
    border: 0;
    outline: 0;
    background: transparent;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    font-family: inherit;
}

/* Search suggestions dropdown */
.rates-search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 50;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.rates-search-suggestions[hidden] {
    display: none;
}

.rates-search-suggestion {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.12s ease;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.rates-search-suggestion:hover,
.rates-search-suggestion.active {
    background: var(--bg-elevated);
}

.rates-search-suggestion .rss-code {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.rates-search-suggestion .rss-sep {
    color: var(--text-tertiary);
    font-weight: 400;
}

.rates-search-suggestion .rss-code-secondary {
    color: var(--text-secondary);
    font-weight: 500;
}

.rates-search-suggestion .rss-country {
    margin-left: 8px;
    color: var(--text-tertiary);
    font-size: 0.82rem;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rates-search-suggestion .rss-arrow {
    margin-left: auto;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    opacity: 0.7;
}

.rates-type-tabs {
    display: none;
    /* временно скрыто — переключатель типов (Все / Готівка / API) */
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 2px;
}

.rates-type-btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.rates-type-btn:hover {
    color: var(--text-primary);
}

.rates-type-btn.active {
    background: var(--gradient-gold);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* Table */
.rates-table-wrapper {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.rates-table-header,
.rate-card {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr 1fr;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
}

.rates-table-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rate-card {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.rate-card:last-child {
    border-bottom: 0;
}

.rate-card:hover {
    background: var(--bg-secondary);
}

.rates-empty {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

/* Pair */
.rate-pair-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.rate-flag-circle {
    position: relative;
    width: 48px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs), 0 1px 3px rgba(0,0,0,0.12);
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.rate-flag-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rate-pair-text {
    min-width: 0;
}

.rate-pair-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.rate-pair-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Buy / Sell */
.rate-buy,
.rate-sell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rate-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.rate-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
}

.rate-change.up {
    color: var(--accent-success);
}

.rate-change.down {
    color: var(--accent-danger);
}

.rate-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--accent-success);
    font-weight: 500;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.rate-trend {
    display: flex;
    align-items: center;
}

.trend-sparkline svg {
    display: block;
}

/* Action button */
.rate-action {
    display: flex;
    justify-content: flex-end;
}

.btn-exchange {
    background: var(--gradient-gold);
    color: #fff;
    border: 0;
    border-radius: var(--radius-md);
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
    font-family: inherit;
    white-space: nowrap;
}

.btn-exchange:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
}

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

/* Info grid */
.rates-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.info-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.info-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-sm) 0 var(--space-md);
}

.info-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.info-row strong {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.05rem;
}

.info-note {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin: 0 0 var(--space-sm);
    line-height: 1.55;
}

.info-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-md) 0;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 var(--space-md);
}

.info-notice {
    display: flex;
    gap: var(--space-sm);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.info-notice p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.info-notice a {
    color: var(--accent-gold-dark);
    font-weight: 600;
    text-decoration: none;
}

.info-notice a:hover {
    text-decoration: underline;
}

/* === RATES PAGE === */
.rates-page {
    padding-top: 120px;
    padding-bottom: var(--space-4xl);
    min-height: 80vh;
}

/* === CALCULATOR PAGE === */
.calculator-page {
    padding-top: 120px;
    padding-bottom: var(--space-4xl);
    min-height: 80vh;
    background: var(--bg-primary);
}

.calculator-page .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.calculator-page-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.calculator-page-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}

.calculator-page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.calculator-page-widget {
    max-width: 700px;
    margin: 0 auto;
}

/* ============ Calculator stats strip ============ */
.calc-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    max-width: 960px;
    margin: 0 auto var(--space-2xl);
}

.calc-stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    overflow: hidden;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.calc-stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.calc-stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: var(--shadow-md);
}

.calc-stat-card:hover::before {
    opacity: 1;
}

.calc-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.calc-stat-icon svg {
    width: 22px;
    height: 22px;
}

.calc-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.calc-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .calc-stats-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
        margin-bottom: var(--space-xl);
    }

    .calc-stat-card {
        padding: var(--space-md) var(--space-sm);
    }

    .calc-stat-value {
        font-size: 1.5rem;
    }

    .calc-stat-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 520px) {
    .calculator-page {
        padding-top: 100px;
    }
}

.rates-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-2xl);
    gap: var(--space-xl);
}

.rates-page-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.rates-page-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.rates-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.rates-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 16px;
    width: 300px;
    transition: all var(--transition-base);
}

.rates-search-box:focus-within {
    border-color: var(--accent-gold);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

.rates-search-box svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .rates-table-header {
        display: none;
    }

    .rate-card {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "pair pair"
            "buy sell"
            "trend action";
        gap: var(--space-sm) var(--space-md);
        padding: var(--space-md);
    }

    .rate-pair-info {
        grid-area: pair;
    }

    .rate-buy {
        grid-area: buy;
    }

    .rate-buy::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        color: var(--text-tertiary);
        text-transform: uppercase;
        margin-bottom: 2px;
    }

    .rate-sell {
        grid-area: sell;
    }

    .rate-sell::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        color: var(--text-tertiary);
        text-transform: uppercase;
        margin-bottom: 2px;
    }

    .rate-trend {
        grid-area: trend;
    }

    .rate-action {
        grid-area: action;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .rates-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .rates-page {
        padding-top: 100px;
    }

    .rates-search-box {
        width: 100%;
    }

    .rates-type-tabs {
        width: 100%;
        justify-content: center;
    }

    .rates-type-btn {
        flex: 1;
        text-align: center;
    }

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

/* Dark theme adjustments */
[data-theme="dark"] .rates-search-box,
[data-theme="dark"] .rates-type-tabs,
[data-theme="dark"] .rates-table-wrapper,
[data-theme="dark"] .info-card {
    background: var(--bg-elevated);
    border-color: var(--border-dark);
}

[data-theme="dark"] .rate-card:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Rates Page Mobile Refinement */
@media (max-width: 992px) {
    .rates-table-header {
        display: none;
    }

    .rate-card {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "pair action"
            "buy sell"
            "trend trend";
        gap: var(--space-md);
        padding: var(--space-lg);
    }

    .rate-pair-info {
        grid-area: pair;
    }

    .rate-action {
        grid-area: action;
    }

    .rate-buy {
        grid-area: buy;
        border: 1px solid var(--border-light);
        padding: 10px;
        border-radius: 8px;
    }

    .rate-sell {
        grid-area: sell;
        border: 1px solid var(--border-light);
        padding: 10px;
        border-radius: 8px;
    }

    .rate-trend {
        grid-area: trend;
        justify-content: center;
        opacity: 0.6;
    }

    .rate-buy::before,
    .rate-sell::before {
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
        color: var(--text-tertiary);
        margin-bottom: 2px;
    }
}

/* View Toggle */
.rates-view-toggle {
    display: inline-flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 2px;
}

.rates-view-btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rates-view-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.rates-view-btn.active {
    background: var(--gradient-gold);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* Admin-style Table View */
.rates-table-view-wrapper {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.rates-table-view-header {
    text-align: center;
    padding: var(--space-xl) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.rates-table-view-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
}

.rates-table-view-time {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.rates-table-view-time span {
    font-weight: 600;
}

.rates-table-view-scroll {
    overflow-x: auto;
}

.rates-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.rates-admin-table thead {
    background: var(--bg-secondary);
}

.rates-admin-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.rates-admin-table th:nth-child(2),
.rates-admin-table th:nth-child(3),
.rates-admin-table th:nth-child(4),
.rates-admin-table th:nth-child(5) {
    text-align: center;
}

/* Align body cells to match headers */
.rates-admin-table td.admin-cell-currency,
.rates-admin-table td.admin-cell-qty,
.rates-admin-table td.admin-cell-buy,
.rates-admin-table td.admin-cell-sell {
    text-align: center;
}

.rates-admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.rates-admin-row:hover {
    background: var(--bg-secondary);
}

.admin-cell-country {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.admin-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--border-light);
}

.admin-currency-code {
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-country-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.admin-cell-currency {
    text-align: left;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Featured rows (USD, EUR) — visually emphasised like in the reference */
.rates-admin-row.featured {
    background: #faf6eb;
}

.rates-admin-row.featured:hover {
    background: #f5eecf;
}

.rates-admin-row.featured .admin-country-name,
.rates-admin-row.featured .admin-cell-currency,
.rates-admin-row.featured .admin-cell-buy,
.rates-admin-row.featured .admin-cell-sell {
    font-weight: 800;
    color: #0f172a;
}

[data-theme="dark"] .rates-admin-row.featured {
    background: rgba(212, 160, 23, 0.14);
}

[data-theme="dark"] .rates-admin-row.featured:hover {
    background: rgba(212, 160, 23, 0.22);
}

[data-theme="dark"] .rates-admin-row.featured .admin-country-name,
[data-theme="dark"] .rates-admin-row.featured .admin-cell-currency,
[data-theme="dark"] .rates-admin-row.featured .admin-cell-buy,
[data-theme="dark"] .rates-admin-row.featured .admin-cell-sell {
    color: #fef3c7;
}

.admin-cell-qty {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-cell-buy,
.admin-cell-sell {
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

/* Dark theme adjustments for table view */
[data-theme="dark"] .rates-table-view-wrapper,
[data-theme="dark"] .rates-view-toggle {
    background: var(--bg-elevated);
    border-color: var(--border-dark);
}

[data-theme="dark"] .rates-admin-table thead {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .rates-admin-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Mobile responsive for table view */
@media (max-width: 768px) {

    .rates-admin-table th,
    .rates-admin-table td {
        padding: 8px 10px;
    }

    .admin-cell-country {
        gap: 6px;
    }

    .admin-flag {
        width: 20px;
        height: 15px;
    }

    .admin-currency-code {
        font-size: 0.85rem;
    }

    .rates-table-view-title {
        font-size: 1.25rem;
    }

    .rates-table-view-time {
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    .rates-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .rates-search-box,
    .rates-type-tabs,
    .rates-view-toggle {
        width: 100%;
        min-width: 0;
    }

    .rates-view-toggle {
        justify-content: center;
    }

    .rates-view-btn {
        flex: 1;
    }
}

/* ============================================================
   FLAG WAVE — 3D waving effect inspired by CodePen XWJooNQ
   Uses perspective + rotateY wave, fabric shine overlay,
   and staggered timing so each flag feels alive.
   ============================================================ */

/* -- Container: enable 3D space for the wave -- */
.rate-flag-circle,
.calc-flag,
.ticker-flag {
    perspective: 200px;
    transform-style: preserve-3d;
}

/* -- The flag image: 3D wave animation -- */
.calc-flag,
.ticker-flag,
.admin-flag,
.rate-flag-circle img,
.lang-btn img,
.lang-flag {
    animation: flag-wave-3d 3s infinite ease-in-out alternate;
    transform-origin: 0% 50%;            /* left edge = flagpole */
    will-change: transform;
    backface-visibility: hidden;
    transition: transform 0.4s cubic-bezier(.4,0,.2,1),
                filter   0.4s cubic-bezier(.4,0,.2,1),
                opacity  0.3s ease;
}

.calc-flag:hover,
.ticker-flag:hover,
.admin-flag:hover,
.rate-flag-circle:hover img {
    animation-play-state: paused;
    filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.35)) brightness(1.08);
    transform: perspective(200px) rotateY(0deg) scale(1.1);
}

/* State for switching flags in JS */
.flag-switching {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
}

/* -- Core 3D wave: rotateY oscillation like fabric on a pole --
   Mimics the CodePen technique where each "slice" rotates on Y,
   but here we animate the whole image with multi-step keyframes
   to simulate the wave propagation across the flag surface.    */
@keyframes flag-wave-3d {
    0%   {
        transform: perspective(200px) rotateY(0deg)    rotateZ(0deg)    skewY(0deg)    scaleX(1);
        filter:    brightness(1)    drop-shadow(0 2px 3px rgba(0,0,0,0.10));
    }
    12%  {
        transform: perspective(200px) rotateY(6deg)    rotateZ(0.4deg)  skewY(0.6deg)  scaleX(0.99);
        filter:    brightness(1.03) drop-shadow(1px 2px 4px rgba(0,0,0,0.12));
    }
    28%  {
        transform: perspective(200px) rotateY(12deg)   rotateZ(0.8deg)  skewY(1.2deg)  scaleX(0.975);
        filter:    brightness(1.06) drop-shadow(2px 3px 5px rgba(0,0,0,0.15));
    }
    42%  {
        transform: perspective(200px) rotateY(8deg)    rotateZ(0.5deg)  skewY(0.7deg)  scaleX(0.985);
        filter:    brightness(1.02) drop-shadow(1px 2px 4px rgba(0,0,0,0.12));
    }
    58%  {
        transform: perspective(200px) rotateY(-4deg)   rotateZ(-0.3deg) skewY(-0.5deg) scaleX(1.005);
        filter:    brightness(0.97) drop-shadow(-1px 2px 3px rgba(0,0,0,0.10));
    }
    75%  {
        transform: perspective(200px) rotateY(-10deg)  rotateZ(-0.7deg) skewY(-1deg)   scaleX(1.015);
        filter:    brightness(0.94) drop-shadow(-2px 3px 5px rgba(0,0,0,0.16));
    }
    88%  {
        transform: perspective(200px) rotateY(-5deg)   rotateZ(-0.3deg) skewY(-0.4deg) scaleX(1.005);
        filter:    brightness(0.98) drop-shadow(-1px 2px 3px rgba(0,0,0,0.11));
    }
    100% {
        transform: perspective(200px) rotateY(0deg)    rotateZ(0deg)    skewY(0deg)    scaleX(1);
        filter:    brightness(1)    drop-shadow(0 2px 3px rgba(0,0,0,0.10));
    }
}

/* -- Fabric shine: a light streak that travels across the flag -- */
.rate-flag-circle::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,255,255,0.25) 45%,
        rgba(255,255,255,0.08) 50%,
        transparent 65%
    );
    background-size: 250% 100%;
    animation: flag-shine 3s infinite ease-in-out alternate;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

@keyframes flag-shine {
    0%   { background-position: 150% 0; opacity: 0.5; }
    30%  { background-position:  80% 0; opacity: 0.8; }
    50%  { background-position:  50% 0; opacity: 1;   }
    70%  { background-position:  20% 0; opacity: 0.8; }
    100% { background-position: -50% 0; opacity: 0.5; }
}

/* -- Stagger: each flag gets a unique delay so they wave independently -- */
.rate-card:nth-child(2n)   .rate-flag-circle img  { animation-delay: -0.4s;  }
.rate-card:nth-child(3n)   .rate-flag-circle img  { animation-delay: -1.1s;  }
.rate-card:nth-child(4n+1) .rate-flag-circle img  { animation-delay: -1.8s;  }
.rate-card:nth-child(5n+2) .rate-flag-circle img  { animation-delay: -2.5s;  }
.rate-card:nth-child(7n+3) .rate-flag-circle img  { animation-delay: -0.7s;  }
.rate-card:nth-child(11n+5) .rate-flag-circle img { animation-delay: -2.1s;  }

/* Stagger the shine overlay too */
.rate-card:nth-child(2n)   .rate-flag-circle::after { animation-delay: -0.5s;  }
.rate-card:nth-child(3n)   .rate-flag-circle::after { animation-delay: -1.3s;  }
.rate-card:nth-child(4n+1) .rate-flag-circle::after { animation-delay: -2.0s;  }
.rate-card:nth-child(5n+2) .rate-flag-circle::after { animation-delay: -0.9s;  }

.rate-flag-circle img {
    /* Slightly oversize to prevent gaps during 3D rotation */
    width: 108%;
    height: 108%;
    margin-left: -4%;
    margin-top: -4%;
}