/* ========================================
   MALO Co., LTD - Vietnamese Membership Platform
   Red & Yellow Color Scheme
======================================== */

/* ── Design tokens shared by both themes ── */
:root {
    /* Brand / accent — identical in both themes */
    --color-primary: #DA251D;
    --color-primary-dark: #B91C1C;
    --color-primary-light: #EF4444;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    --gradient-gold: linear-gradient(135deg, #FFCD00, #FFA500);

    /* Typography */
    --font-main: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;

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

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ── Light theme (default / [data-theme="light"]) ── */
:root,
[data-theme="light"] {
    --color-secondary: #B87A00;          /* amber darkened for contrast on light bg */
    --color-secondary-dark: #9A6500;
    --color-secondary-light: #D4920A;

    --color-bg: #F8F9FB;
    --color-bg-elevated: #FFFFFF;
    --color-bg-subtle: #EEF1F6;
    --color-bg-card: #FFFFFF;

    --color-text: #0B1220;
    --color-text-muted: #455470;
    --color-text-subtle: #8A9BBE;

    --color-border: rgba(0, 0, 0, 0.10);
    --color-border-subtle: rgba(0, 0, 0, 0.06);

    /* Navbar / overlay backgrounds — also used by .mobile-nav */
    --color-nav-bg: rgba(248, 249, 251, 0.95);
    --color-overlay-bg: rgba(248, 249, 251, 0.98);

    /* Help-widget surface tokens */
    --hw-bg: var(--color-bg-elevated);
    --hw-card: var(--color-bg-subtle);
    --hw-card-hover: #E8ECF4;
    --hw-text: var(--color-text);
    --hw-text-muted: var(--color-text-muted);
    --hw-border: var(--color-border);
    --hw-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.07);
}

/* ── Dark theme ([data-theme="dark"]) ── */
[data-theme="dark"] {
    --color-secondary: #FFCD00;
    --color-secondary-dark: #EAB308;
    --color-secondary-light: #FDE047;

    --color-bg: #0B1220;
    --color-bg-elevated: #152035;
    --color-bg-subtle: #1A2840;
    --color-bg-card: #111B2E;

    --color-text: #FFFFFF;
    --color-text-muted: #8A9BBE;
    --color-text-subtle: #5A6A8A;

    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-subtle: rgba(255, 255, 255, 0.05);

    --color-nav-bg: rgba(11, 18, 32, 0.95);
    --color-overlay-bg: rgba(11, 18, 32, 0.98);

    /* Help-widget surface tokens */
    --hw-bg: var(--color-bg-elevated);
    --hw-card: var(--color-bg-subtle);
    --hw-card-hover: var(--color-bg-card);
    --hw-text: var(--color-text);
    --hw-text-muted: var(--color-text-muted);
    --hw-border: var(--color-border);
    --hw-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent horizontal overflow on all devices */
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
    max-width: 100%;
    /* Enable momentum scrolling on iOS */
    -webkit-overflow-scrolling: touch;
    /* Landscape-mode side padding: keeps content clear of the notch on iPhones rotated to landscape */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    /* Smooth theme transition — colour only, so layout never shifts */
    transition: background-color 220ms ease, color 220ms ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
    /* Remove blue tap flash on iOS */
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    /* Remove tap flash and 300ms delay on iOS */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

input, textarea, select {
    font-family: inherit;
    /* 16px minimum prevents iOS Safari from auto-zooming on focus */
    font-size: 1rem;
}

/* Remove default iOS styling on inputs/select so we control appearance.
   border-radius: 0 prevents iOS from applying its own rounding; our component
   styles (form-group) re-apply the design system radius afterwards. */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea {
    -webkit-appearance: none;
    border-radius: 0;
}

/* iOS Safari renders <select> with a native system style by default.
   Removing it lets our custom arrow and border styles show through. */
select {
    -webkit-appearance: none;
}

/* ========================================
   Layout
======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ========================================
   Navigation
======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* env(safe-area-inset-top) adds padding behind the iOS notch/Dynamic Island */
    padding: var(--space-sm) 0;
    padding-top: max(var(--space-sm), calc(var(--space-sm) + env(safe-area-inset-top)));
    background: var(--color-nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-base), padding var(--transition-base), background-color 220ms ease;
}

.navbar.scrolled {
    border-bottom-color: var(--color-border);
    padding: 0.75rem 0;
    padding-top: max(0.75rem, calc(0.75rem + env(safe-area-inset-top)));
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    /* In landscape, env(safe-area-inset-left/right) keeps content clear of the notch.
       In portrait the insets are 0, so this is identical to the original padding. */
    padding-left: calc(var(--space-md) + env(safe-area-inset-left));
    padding-right: calc(var(--space-md) + env(safe-area-inset-right));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.logo-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    background: var(--color-secondary);
    color: #000;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--color-text);
}

.nav-cta {
    padding: 0.65rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-text) !important;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--color-primary-light) !important;
    transform: translateY(-1px);
}

.lang-toggle {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    background: var(--color-bg-card);
    transition: all var(--transition-fast);
    /* iOS HIG: minimum 44px tap target */
    min-height: 44px;
}

.lang-toggle:hover {
    border-color: var(--color-secondary);
    color: var(--color-text);
}

/* User avatar & dropdown */
.nav-user {
    position: relative;
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    /* Expand tap zone to iOS HIG minimum without changing visual size */
    padding: 4px;
    box-sizing: content-box;
}

.user-avatar-btn:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 160px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 1100;
}

.user-dropdown.open {
    display: block;
}

.user-dropdown a,
.user-dropdown button {
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--color-bg-subtle);
    color: var(--color-primary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    /* iOS HIG minimum tap target */
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 200ms ease, opacity 150ms ease;
    display: block;
}

/* Hamburger → X animation when menu is open */
.mobile-menu-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-btn.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ========================================
   Mobile Navigation Overlay
   Lives outside <nav> so it is NOT a child of the backdrop-filter
   element. On iOS Safari, backdrop-filter creates a new stacking
   context that confines position:fixed children to the parent's
   bounds — keeping this as a direct body child avoids that bug.
======================================== */
.mobile-nav {
    display: none;
    position: fixed;
    top: calc(60px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-overlay-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    flex-direction: column;
    /* Horizontal insets guard the notch in landscape */
    padding: 1.25rem calc(1.5rem + env(safe-area-inset-right)) 1.25rem calc(1.5rem + env(safe-area-inset-left));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    gap: 0.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.open {
    display: flex;
}

/* All links and buttons inside the overlay */
.mobile-nav a,
.mobile-nav button {
    display: flex;
    align-items: center;
    /* iOS HIG minimum tap target */
    min-height: 48px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    width: 100%;
    transition: background var(--transition-fast), color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-nav a:hover,
.mobile-nav a:active,
.mobile-nav button:hover,
.mobile-nav button:active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
}

/* Auth links wrapper inside mobile nav (children share parent styles) */
#mobileNavUser {
    display: contents;
}

/* Primary CTA button in the mobile nav */
.mobile-nav-cta {
    background: var(--color-primary) !important;
    color: var(--color-text) !important;
    justify-content: center;
    border-radius: var(--radius-full) !important;
    font-weight: 600 !important;
    margin-top: 0.5rem;
}

.mobile-nav-cta:hover,
.mobile-nav-cta:active {
    background: var(--color-primary-light) !important;
}

/* Thin rule separating section links from auth links */
.mobile-nav-divider {
    height: 1px;
    background: var(--color-border);
    border: none;
    margin: 0.5rem 0;
}

/* Language toggle inside the mobile nav */
.mobile-nav-lang {
    width: auto !important;
    align-self: flex-start;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-full) !important;
    padding: 0.5rem 1rem !important;
    color: var(--color-text-muted) !important;
    min-height: 44px;
    margin-top: 0.25rem;
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    cursor: pointer;
    /* iOS HIG: minimum 44px tap target */
    min-height: 44px;
}

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

.btn-primary:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(218, 37, 29, 0.3);
}

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

.btn-secondary:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.btn-full {
    width: 100%;
}

/* ========================================
   Hero Section
======================================== */
.hero {
    position: relative;
    /* 100vh iOS Safari bug fix — three-value stack:
       1) 100vh        : browsers without svh/fill-available support
       2) -webkit-fill-available : iOS Safari < 15.4 (fills visible viewport, not incl. chrome)
       3) 100svh       : modern browsers incl. iOS 15.4+ (Small Viewport Height) */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Account for the fixed navbar height (≈60px) + safe area inset */
    padding: calc(var(--space-3xl) + env(safe-area-inset-top)) var(--space-md) var(--space-3xl);
    overflow: hidden;
}

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

.hero-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(218, 37, 29, 0.35), transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(255, 205, 0, 0.15), transparent 50%),
        radial-gradient(ellipse 40% 30% at 20% 80%, rgba(218, 37, 29, 0.2), transparent 50%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255, 205, 0, 0.1) 1px, transparent 0);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    animation: fadeUp 1s ease forwards;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.5rem 1.25rem;
    background: rgba(218, 37, 29, 0.1);
    border: 1px solid rgba(218, 37, 29, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: var(--space-lg);
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.badge-icon {
    font-size: 1.1rem;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

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

.title-italic {
    font-style: italic;
    color: var(--color-secondary);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 650px;
    margin: 0 auto var(--space-xl);
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.hero-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-trust {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.trust-icon {
    color: var(--color-secondary);
    font-weight: bold;
}

.hero-scroll {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
    color: var(--color-text-subtle);
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.7s;
    opacity: 0;
}

.scroll-indicator {
    width: 24px;
    height: 40px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 2px;
    animation: scroll 1.5s ease infinite;
}

@keyframes scroll {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ========================================
   Section Styles
======================================== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.section-desc {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Benefits Section
======================================== */
.benefits {
    padding: var(--space-3xl) 0;
    background: var(--color-bg);
}

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

.benefit-card {
    padding: var(--space-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-slow);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.benefit-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(218, 37, 29, 0.1);
}

.benefit-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--space-lg);
    row-gap: var(--space-sm);
    align-items: start;
    background: linear-gradient(135deg, rgba(218, 37, 29, 0.1), rgba(255, 205, 0, 0.05));
    border-color: rgba(218, 37, 29, 0.3);
}

.benefit-featured .benefit-icon {
    grid-row: 1 / span 2;
}

.benefit-featured h3,
.benefit-featured p {
    grid-column: 2;
}

.benefit-featured .benefit-list {
    grid-column: 1 / -1;
    margin-top: var(--space-sm);
}

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

.benefit-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.benefit-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.benefit-list {
    list-style: none;
}

.benefit-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.benefit-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-secondary);
}

/* ========================================
   Promotions Section
======================================== */
.promotions {
    padding: var(--space-3xl) 0;
    background: var(--color-bg-elevated);
}

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

.promo-card {
    padding: var(--space-xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.promo-card:hover {
    border-color: var(--color-secondary);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 205, 0, 0.15);
}

.promo-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.6rem;
    background: var(--color-primary);
    color: var(--color-text);
    border-radius: var(--radius-sm);
}

.promo-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.promo-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.promo-card p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.promo-highlight {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    padding: var(--space-xl);
    background: linear-gradient(135deg, rgba(255, 205, 0, 0.15), rgba(255, 205, 0, 0.05));
    border: 2px solid rgba(255, 205, 0, 0.3);
    border-radius: var(--radius-xl);
    align-items: center;
}

.highlight-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.4rem 0.8rem;
    background: var(--color-secondary);
    color: #000;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.highlight-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.highlight-content p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.highlight-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.highlight-features span {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
}

.highlight-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.visual-decoration {
    width: 200px;
    height: 200px;
    background: var(--gradient-gold);
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(40px);
}

/* ========================================
   Compliance Section
======================================== */
.compliance {
    padding: var(--space-3xl) 0;
    background: var(--color-bg);
}

.compliance-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.compliance-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.compliance-text {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
    line-height: 1.8;
}

.compliance-text strong {
    color: var(--color-primary);
}

.compliance-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.compliance-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.item-icon {
    font-size: 1.5rem;
}

.item-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.item-content p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.compliance-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.shield-container {
    position: relative;
}

.shield {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
    z-index: 1;
}

.shield-glow {
    position: absolute;
    inset: -30px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(40px);
    z-index: 0;
}

/* ========================================
   About Section
======================================== */
.about {
    padding: var(--space-3xl) 0;
    background: var(--color-bg-elevated);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
}

.about-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.about-text {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: var(--space-xl);
}

.about-stats {
    display: flex;
    gap: var(--space-xl);
    /* Wrap stats on very narrow screens before the 768px breakpoint */
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

.value-card {
    padding: var(--space-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.value-card:hover {
    border-color: var(--color-secondary);
}

.value-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
}

.value-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ========================================
   Membership Plans Section
======================================== */
.membership {
    padding: var(--space-3xl) 0;
    background: var(--color-bg);
}

/* ── Introductory offer callout ── */
.membership-promo {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
    padding: 1.25rem 1.5rem 1.25rem 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(218, 37, 29, 0.20);
    background: linear-gradient(135deg, rgba(218, 37, 29, 0.05) 0%, rgba(255, 205, 0, 0.04) 100%);
    position: relative;
    overflow: hidden;
}

/* Brand accent bar on the left edge */
.membership-promo::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.membership-promo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.membership-promo-icon svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
}

.membership-promo-body {
    flex: 1;
    min-width: 200px;
}

.membership-promo-badge {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.membership-promo-text {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin: 0;
}

.membership-promo-text strong {
    color: var(--color-text);
    font-weight: 700;
}

.membership-promo-pill {
    flex-shrink: 0;
    padding: 0.45rem 1.1rem;
    background: rgba(255, 205, 0, 0.10);
    border: 1px solid rgba(255, 205, 0, 0.30);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-secondary);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

[data-theme="light"] .membership-promo-pill {
    background: rgba(184, 122, 0, 0.10);
    border-color: rgba(184, 122, 0, 0.30);
}

/* Per-card promo note under the price */
.price-promo-note {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-secondary);
    letter-spacing: 0.02em;
}

[data-theme="light"] .price-promo-note {
    color: var(--color-secondary);   /* uses the darker amber already set in light mode */
}

/* Footnote below the pricing grid */
.plans-footnote {
    margin-top: var(--space-md);
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-subtle);
    line-height: 1.6;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    align-items: start;
}

.plan-card {
    padding: var(--space-xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    position: relative;
    transition: all var(--transition-slow);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.plan-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(218, 37, 29, 0.1);
}

.plan-featured {
    border-color: var(--color-primary);
    background: linear-gradient(180deg, rgba(218, 37, 29, 0.1) 0%, var(--color-bg-card) 100%);
    transform: scale(1.05);
}

.plan-featured:hover {
    transform: scale(1.05) translateY(-4px);
}

.plan-ribbon {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-text);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.plan-header {
    text-align: center;
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.plan-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-period {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.plan-features {
    list-style: none;
    margin-bottom: var(--space-md);
}

.plan-features li {
    padding: 0.6rem 0;
    padding-left: 1.75rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border-subtle);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-secondary);
    font-weight: bold;
}

/* Draw entry list item — same row style as other features but number stands out */
.plan-feature-draw {
    font-weight: 600;
    color: var(--color-text) !important;
}

/* Make the leading number pop with the brand gradient */
.plan-feature-draw::before {
    content: '✦' !important;
    color: var(--color-secondary) !important;
}

/* ── Accumulation note below the grid ── */
.plans-draw-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: var(--space-md);
    padding: 0.85rem 1.25rem;
    background: var(--color-bg-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
}

.plans-draw-note svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 0.15rem;
    stroke: var(--color-secondary);
    fill: none;
}

.plans-draw-note p {
    font-size: 0.84rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   Contact Section
======================================== */
.contact {
    padding: var(--space-3xl) 0;
    background: var(--color-bg-elevated);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
}

.contact-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.contact-text {
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.contact-link:hover {
    border-color: var(--color-primary);
}

.link-icon {
    font-size: 1.5rem;
}

.link-details {
    display: flex;
    flex-direction: column;
}

.link-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.link-value {
    font-size: 0.95rem;
    font-weight: 500;
}

.contact-person {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(218, 37, 29, 0.1), rgba(255, 205, 0, 0.05));
    border: 1px solid rgba(218, 37, 29, 0.3);
    border-radius: var(--radius-md);
}

.person-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.person-info {
    display: flex;
    flex-direction: column;
}

.person-name {
    font-weight: 700;
}

.person-role {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

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

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

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

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.9rem 1rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    /* Explicit 16px prevents iOS Safari from auto-zooming on focus */
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

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

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235C5C5C' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.form-group select option {
    background: var(--color-bg-elevated);
    color: var(--color-text);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========================================
   Footer
======================================== */
.footer {
    padding: var(--space-2xl) 0 calc(var(--space-lg) + env(safe-area-inset-bottom));
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

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

.footer-brand .logo {
    display: inline-flex;
    margin-bottom: var(--space-sm);
}

.footer-brand p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
    max-width: 280px;
}

.footer-badges {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.footer-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text-muted);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-column h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.footer-column a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-column a:hover {
    color: var(--color-secondary);
}

.footer-bottom {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

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

.footer-disclaimer {
    margin-top: var(--space-sm);
    font-size: 0.8rem !important;
    color: var(--color-text-subtle);
}

/* ========================================
   Responsive Design
======================================== */

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
    .benefits-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .benefit-featured {
        grid-template-columns: 1fr;
    }
    
    .promo-grid {
        grid-template-columns: 1fr;
    }
    
    .promo-highlight {
        grid-template-columns: 1fr;
    }
    
    .highlight-visual {
        display: none;
    }
    
    .compliance-grid,
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .compliance-visual {
        order: -1;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .membership-promo {
        gap: 0.9rem;
    }

    .membership-promo-pill {
        /* Full-width at the bottom on mobile so it reads as a footer note */
        width: 100%;
        text-align: center;
    }

    .plan-featured {
        transform: none;
    }
    
    .plan-featured:hover {
        transform: translateY(-4px);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
    /* Hide desktop nav links; hamburger reveals them as overlay */
    .nav-links {
        display: none;
    }

    /* Mobile nav overlay — slides over the viewport below the navbar */
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: fixed;
        /* Sits directly below the navbar (navbar is ~60px + safe area) */
        top: calc(60px + env(safe-area-inset-top));
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-overlay-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        /* Horizontal insets guard against the notch in landscape */
        padding: 1.25rem calc(1.5rem + env(safe-area-inset-right)) 1.25rem calc(1.5rem + env(safe-area-inset-left));
        /* Reserve space for iOS home indicator at the bottom */
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
        gap: 0.25rem;
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure all touch targets inside the mobile menu are ≥44px (iOS HIG) */
    .nav-links.active a,
    .nav-links.active button {
        min-height: 48px;
        padding: 0.75rem 1rem;
        border-radius: var(--radius-md);
        font-size: 1rem;
        display: flex;
        align-items: center;
    }

    .nav-links.active .nav-cta {
        justify-content: center;
        margin-top: 0.5rem;
    }

    /* Keep the nav-user (avatar dropdown) accessible in mobile menu */
    .nav-links.active .nav-user {
        display: flex;
        align-items: center;
    }

    .mobile-menu-btn {
        display: flex;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-trust {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        flex-wrap: wrap;
        gap: var(--space-lg);
    }
    
    .compliance-list {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        grid-template-columns: 1fr 1fr;
    }

    /* Reduce large section vertical padding on mobile */
    .benefits,
    .promotions,
    .compliance,
    .about,
    .membership,
    .contact {
        padding: var(--space-2xl) 0;
    }

    /* Prevent plan cards overflowing on narrow screens */
    .plans-grid {
        max-width: 100%;
    }
}

/* ── Small mobile (≤480px) — iPhone SE, standard iPhones ── */
@media (max-width: 480px) {
    /* Reduce hero padding on small phones */
    .hero {
        padding: calc(var(--space-2xl) + env(safe-area-inset-top)) var(--space-sm) var(--space-2xl);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
    }

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

    /* Reduce inner card padding on small screens */
    .benefit-card,
    .promo-card {
        padding: var(--space-md);
    }

    .plan-card {
        padding: var(--space-md);
    }

    .contact-form-wrapper {
        padding: var(--space-md);
    }

    /* Auth pages: reduce padding so form isn't crushed */
    .auth-page {
        padding: 1rem;
        align-items: flex-start;
        /* Push content below the fixed navbar */
        padding-top: calc(80px + env(safe-area-inset-top));
    }

    .auth-card {
        padding: var(--space-md);
    }
    
    .footer-links {
        grid-template-columns: 1fr;
    }
}

/* ── iPhone Plus / Pro Max (414px) ── */
@media (max-width: 414px) {
    /* Slightly tighten plan card padding to prevent horizontal overflow */
    .plan-card {
        padding: var(--space-md) var(--space-sm);
    }

    /* Reduce promo highlight inner padding */
    .promo-highlight {
        padding: var(--space-md);
    }
}

/* ── iPhone 14 / SE 3 / 13 mini range (390px) ── */
@media (max-width: 390px) {
    /* Slightly smaller buttons to fit side-by-side when needed */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Prevent hero badge from overflowing */
    .hero-badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    /* Tighten section header margin */
    .section-header {
        margin-bottom: var(--space-lg);
    }
}

/* ── iPhone SE 2nd gen / 6/7/8 (375px) ── */
@media (max-width: 375px) {
    /* Reduce container horizontal padding slightly to reclaim content width */
    .container {
        padding: 0 1rem;
    }

    /* Reduce hero padding further */
    .hero {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Compliance items: ensure icon + text don't overflow */
    .compliance-item {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ── iPhone 5 / SE 1st gen (320px) ── */
@media (max-width: 320px) {
    /* Reduce all section headings to prevent overflow */
    .section-title {
        font-size: 1.5rem;
    }

    /* Shrink hero badge to one line */
    .hero-badge {
        font-size: 0.72rem;
        padding: 0.35rem 0.75rem;
    }

    /* Reduce button text size on the narrowest screens */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }

    /* Auth card needs minimal padding at 320px */
    .auth-card {
        padding: 1rem;
    }

    /* Reduce contact form wrapper padding */
    .contact-form-wrapper {
        padding: 1rem;
    }
}

/* ========================================
   Animations & Utility Classes
======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Selection */
::selection {
    background: var(--color-primary);
    color: var(--color-text);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

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

/* ========================================
   Auth Pages
======================================== */
.auth-page {
    /* 100vh iOS Safari bug fix — same three-value stack as .hero */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    text-align: center;
}

.auth-card p.auth-subtitle {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: var(--space-lg);
}

.auth-form .form-group {
    margin-bottom: var(--space-md);
}

.auth-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.auth-form .form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--color-text);
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.auth-form .btn {
    width: 100%;
    margin-top: var(--space-sm);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: 500;
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #B91C1C;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.account-page {
    padding: var(--space-3xl) var(--space-md);
    min-height: 100vh;
}

.account-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.account-card h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
}

.plan-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--gradient-primary);
    color: var(--color-text);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-md);
}

/* ========================================
   Theme Toggle Button
======================================== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Visually 36px circle, tap zone expanded by padding to meet 44px HIG */
    width: 36px;
    height: 36px;
    padding: 4px;
    box-sizing: content-box;
    border-radius: 50%;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-secondary);
    color: var(--color-text);
}

.theme-icon-sun,
.theme-icon-moon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* In dark mode → show sun (click = switch to light) */
[data-theme="dark"]  .theme-icon-sun  { display: block; }
[data-theme="dark"]  .theme-icon-moon { display: none;  }
/* In light mode → show moon (click = switch to dark) */
[data-theme="light"] .theme-icon-moon { display: block; }
[data-theme="light"] .theme-icon-sun  { display: none;  }

/* ========================================
   Light-mode specific overrides
======================================== */

/* Tone down the hero background glow so it doesn't wash out on a light canvas */
[data-theme="light"] .hero-gradient {
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(218, 37, 29, 0.18), transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(218, 37, 29, 0.08), transparent 50%),
        radial-gradient(ellipse 40% 30% at 20% 80%, rgba(218, 37, 29, 0.10), transparent 50%);
}

[data-theme="light"] .hero-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(218, 37, 29, 0.07) 1px, transparent 0);
}

/* Cards and sections pick up theming automatically via CSS vars.
   Box-shadows use rgba(0,0,0,…) which work fine in both themes. */
