/* ==========================================================================
   EARNIFY DESIGN SYSTEM
   Trustworthy modern SaaS/rewards visual identity — mobile-first.
   ========================================================================== */

:root {
    /* ---- Design tokens (Section 43) ---- */
    --primary: #1769FF;
    --primary-dark: #0B2148;
    --primary-bright: #2478FF;
    --success: #18B968;
    --success-light: #DDF7E9;
    --soft-blue: #EAF3FF;
    --background: #F7F9FC;
    --surface: #FFFFFF;
    --text: #14213D;
    --text-muted: #64748B;
    --border: #E6EBF2;
    --warning: #F59E0B;
    --danger: #EF4444;
    --accent-purple: #7C5CFC;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px rgba(20, 33, 61, 0.06), 0 1px 1px rgba(20, 33, 61, 0.04);
    --shadow-md: 0 8px 24px rgba(11, 33, 72, 0.08);

    --header-h: 60px;
    --sidebar-w: 256px;
    --bottom-nav-h: 64px;

    /* legacy variable names kept for compatibility with any inline references */
    --light: #FFFFFF;
    --light-2: #F7F9FC;
    --dark: #0B2148;
    --dark-2: #0E2A5C;
    --secondary: #1769FF;
    --action: #F59E0B;
    --error: #EF4444;
    --radius: 14px;
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Fjalla One', 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 700; color: var(--text); line-height: 1.25; margin: 0; }

::selection { background: var(--soft-blue); color: var(--primary-dark); }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- Guest layout (auth screens) ---------- */
.guest-body {
    background: linear-gradient(160deg, var(--primary-dark) 0%, #123170 55%, var(--primary) 130%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.guest-wrap {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 5vw, 40px);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-md);
}
.guest-wrap h1 { font-size: clamp(20px, 5vw, 24px); margin-bottom: 22px !important; }
.guest-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; margin-bottom: 26px; color: var(--primary-dark); }

.brand-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--success));
    display: inline-block;
    flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--text); font-size: 18px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-name, .brand-text { white-space: nowrap; }

/* ---------- Typography helpers ---------- */
.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; } .mb-8 { margin-bottom: 8px; }
.mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; } .mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; } .mb-24 { margin-bottom: 24px; }
.section { margin-bottom: 32px; }

/* ---------- Forms (Section 46) ---------- */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=tel], input[type=url],
input[type=datetime-local], input[type=file], select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=file] { min-height: auto; padding: 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,105,255,0.14); }
textarea { resize: vertical; min-height: 90px; }
.help-text { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.field-error { font-size: 12.5px; color: var(--danger); margin-top: 5px; font-weight: 500; }
.inline-form { display: inline; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; min-height: auto; }

/* ---------- Buttons (Section 34) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    text-align: center;
    transition: transform .1s ease, opacity .15s ease, background-color .15s ease, box-shadow .15s ease;
    line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(23,105,255,0.24); }
.btn-primary:hover { background: var(--primary-bright); }
.btn-action { background: var(--warning); color: #fff; }
.btn-action:hover { opacity: .92; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .92; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .92; }
.btn-outline { background: var(--surface); border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--soft-blue); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 14px; padding: 0; min-height: auto; font-weight: 600; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Alerts / toasts ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-success { background: var(--success-light); color: #0A6B3C; border-color: #BFEFD4; }
.alert-error, .alert-danger { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.alert-info { background: var(--soft-blue); color: var(--primary); border-color: transparent; }

/* ---------- Cards / grid (Section 33) ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.stat-card .stat-value.stat-positive { color: var(--success); }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: clamp(20px, 4vw, 26px); }
.page-header p.page-subtitle { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.page-header-text { flex: 1; min-width: 200px; }

/* ---------- Tables (Section 30) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); -webkit-overflow-scrolling: touch; }

/* Opt-in responsive table: below 700px, rows collapse into labeled cards instead of
   requiring horizontal scroll, so action icons (eye/copy) are never pushed off-screen.
   Add class "responsive-table" to a <table> and data-label="..." to each <td> to use it. */
@media (max-width: 700px) {
    .table-wrap.table-wrap-responsive { overflow-x: visible; border: none; background: transparent; }
    .responsive-table thead { display: none; }
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
    .responsive-table tr {
        background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
        margin-bottom: 12px; padding: 4px 14px;
    }
    .responsive-table td {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 9px 0; border-bottom: 1px solid var(--border); white-space: normal; text-align: right;
    }
    .responsive-table td:last-child { border-bottom: none; }
    .responsive-table td[data-label]::before {
        content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: 11px;
        text-transform: uppercase; letter-spacing: .04em; text-align: left; flex-shrink: 0;
    }
    .responsive-table td[data-label=""]::before,
    .responsive-table td:not([data-label])::before { content: none; }
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--background); }
th { background: var(--background); font-weight: 700; color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }

.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-active, .badge-approved, .badge-completed, .badge-credit, .badge-paid { background: var(--success-light); color: #0A6B3C; }
.badge-pending, .badge-draft, .badge-paused { background: #FEF3E2; color: #92400E; }
.badge-inactive, .badge-rejected, .badge-archived, .badge-banned, .badge-debit, .badge-failed { background: #FEF2F2; color: #991B1B; }
.badge-suspended { background: #FFF1E6; color: #9A3412; }

/* ---------- Task / Plan / Quiz cards ---------- */
.task-card, .plan-card { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.task-card { transition: box-shadow .15s ease, transform .15s ease; }
.task-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.task-card-top { display: flex; align-items: center; gap: 10px; }
.task-card-icon {
    width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--soft-blue); color: var(--primary);
}
.task-card h3 { font-size: 16px; margin: 2px 0 0 !important; }
.task-card .task-desc { font-size: 13.5px; color: var(--text-muted); flex: 1; line-height: 1.5; margin: 0; }
.task-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.reward { font-size: 19px; font-weight: 800; color: var(--success); }
.task-time { font-size: 12.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }

.plan-card { position: relative; border-width: 1px; }
.plan-card.plan-recommended { border: 2px solid var(--primary); box-shadow: 0 10px 30px rgba(23,105,255,0.14); }
.plan-card .plan-badge {
    position: absolute; top: -12px; left: 20px;
    background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
    padding: 4px 12px; border-radius: 999px;
}
.plan-card .price { font-size: 28px; font-weight: 800; color: var(--text); }
.plan-card .price span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.plan-card ul { padding-left: 0; margin: 6px 0 4px; font-size: 13.5px; color: var(--text); list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plan-card ul li { display: flex; align-items: flex-start; gap: 8px; }
.plan-card ul li::before {
    content: ''; flex-shrink: 0; margin-top: 6px; width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
}

.quiz-box { max-width: 560px; margin: 0 auto; }
.quiz-box .quiz-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.quiz-box #question-text { font-size: 19px; line-height: 1.4; margin-bottom: 18px !important; }
.quiz-option {
    display: block; width: 100%; text-align: left; padding: 15px 18px; margin-bottom: 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
    cursor: pointer; font-size: 15px; font-weight: 500; min-height: 44px;
    transition: border-color .12s ease, background-color .12s ease, transform .08s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary); background: var(--soft-blue); }
.quiz-option:active:not(:disabled) { transform: scale(0.99); }
.quiz-option.selected { border-color: var(--primary); background: var(--soft-blue); color: var(--primary); }
.quiz-option.correct { border-color: var(--success); background: var(--success-light); color: #0A6B3C; }
.quiz-option.incorrect { border-color: var(--danger); background: #FEF2F2; color: #991B1B; }
.quiz-option:disabled { cursor: default; }
.quiz-timer { font-weight: 800; font-size: 15px; color: var(--warning); display: inline-flex; align-items: center; gap: 6px; }
.quiz-progress-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.quiz-box .quiz-topbar { gap: 10px; flex-wrap: wrap; }
.quiz-timer-low { color: var(--danger); }

.progress-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-bright)); border-radius: 999px; transition: width .2s ease; }

/* ---------- Quick actions grid (mobile dashboard) ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-action {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 16px 8px; text-align: center; color: var(--text); font-size: 12.5px; font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s ease, transform .15s ease;
}
.quick-action:hover { text-decoration: none; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.quick-action .qa-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--soft-blue); color: var(--primary);
}
.quick-action.qa-green .qa-icon { background: var(--success-light); color: var(--success); }
.quick-action.qa-orange .qa-icon { background: #FEF3E2; color: var(--warning); }
.quick-action.qa-purple .qa-icon { background: #F1EDFF; color: var(--accent-purple); }

/* ---------- Balance / hero card (wallet, dashboard) ---------- */
.balance-card {
    background: linear-gradient(135deg, var(--primary-dark), #123B85 60%, var(--primary));
    color: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-md);
    position: relative; overflow: hidden;
}
.balance-card::after {
    content: ''; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px;
    border-radius: 50%; background: rgba(255,255,255,0.06);
}
.balance-card .balance-label { font-size: 12.5px; font-weight: 600; opacity: .8; text-transform: uppercase; letter-spacing: 0.04em; }
.balance-card .balance-amount { font-size: clamp(30px, 7vw, 38px); font-weight: 800; margin: 8px 0 4px; letter-spacing: -0.01em; }
.balance-card .balance-sub { font-size: 13px; opacity: .8; }
.balance-card .balance-row { display: flex; gap: 24px; margin-top: 18px; flex-wrap: wrap; position: relative; }
.balance-card .balance-row div { font-size: 12.5px; opacity: .85; }
.balance-card .balance-row strong { display: block; font-size: 16px; font-weight: 700; margin-top: 2px; opacity: 1; }
.balance-actions { display: flex; gap: 10px; margin-top: 20px; position: relative; flex-wrap: wrap; }
.balance-actions .btn { flex: 1; min-width: 120px; }

/* ---------- Transaction / notification list items ---------- */
.tx-item, .notif-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 4px; border-bottom: 1px solid var(--border);
}
.tx-item:last-child, .notif-item:last-child { border-bottom: none; }
.tx-icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--soft-blue); color: var(--primary);
}
.tx-icon.tx-positive { background: var(--success-light); color: var(--success); }
.tx-icon.tx-negative { background: #FEF2F2; color: var(--danger); }
.tx-body { flex: 1; min-width: 0; }
.tx-title { font-weight: 600; font-size: 14px; margin: 0 0 2px; }
.tx-sub { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.tx-amount { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.tx-amount.positive { color: var(--success); }
.tx-amount.negative { color: var(--danger); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 18px; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab-link {
    flex-shrink: 0; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); white-space: nowrap;
}
.tab-link:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.tab-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Leaderboard ---------- */
.podium { display: flex; align-items: flex-end; gap: 10px; justify-content: center; margin-bottom: 24px; }
.podium-item { flex: 1; max-width: 140px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 10px; box-shadow: var(--shadow-sm); }
.podium-item.first { order: 2; padding-top: 26px; border: 2px solid var(--warning); }
.podium-item.second { order: 1; }
.podium-item.third { order: 3; }
.podium-avatar {
    width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright)); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
}
.podium-item.first .podium-avatar { width: 62px; height: 62px; font-size: 22px; background: linear-gradient(135deg, var(--warning), #FBBF24); }
.podium-rank { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.podium-name { font-weight: 700; font-size: 13.5px; margin-bottom: 2px; }
.podium-score { font-size: 12.5px; color: var(--text-muted); }
.leaderboard-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.leaderboard-row:last-child { border-bottom: none; }
.lb-rank { width: 24px; font-weight: 700; color: var(--text-muted); font-size: 14px; text-align: center; flex-shrink: 0; }
.lb-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--soft-blue); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.lb-name { flex: 1; font-weight: 600; font-size: 14px; min-width: 0; }
.lb-score { font-weight: 700; font-size: 14px; color: var(--text); flex-shrink: 0; text-align: right; }
@media (max-width: 480px) {
    .lb-score { font-size: 12px; }
    .lb-name { font-size: 13px; }
}

/* ---------- Empty states (Section 37) ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .empty-icon {
    width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--soft-blue); color: var(--primary);
}
.empty-state p { margin: 0 0 16px; font-size: 14px; }

/* ==========================================================================
   App shell — sticky header + sidebar + mobile bottom nav
   ========================================================================== */

.skip-link {
    position: absolute; left: 8px; top: -48px;
    background: var(--primary-dark); color: #fff; padding: 10px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600; z-index: 200; transition: top .15s ease;
}
.skip-link:focus { top: 8px; text-decoration: none; }

.app-shell { min-height: 100vh; }

/* ---- Header ---- */
.app-header {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 14px;
    height: var(--header-h);
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.app-header.admin-header { background: var(--primary-dark); border-color: #10306b; }
.app-header.admin-header .brand,
.app-header.admin-header .icon-btn { color: #fff; }
.app-header.admin-header .brand-name { color: #fff; }

.hamburger-btn {
    display: none;
    align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    cursor: pointer; flex-shrink: 0;
}
.app-header.admin-header .hamburger-btn { border-color: #23407e; background: transparent; color: #fff; }

.app-header .brand { flex-shrink: 0; }
.header-spacer { flex: 1; }

.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    color: var(--text); background: transparent; border: none; cursor: pointer;
}
.icon-btn:hover { background: var(--background); text-decoration: none; }
.app-header.admin-header .icon-btn:hover { background: rgba(255,255,255,0.08); }
.icon-btn .icon-count {
    position: absolute; top: 3px; right: 3px;
    min-width: 16px; height: 16px; padding: 0 3px;
    border-radius: 999px; background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
    border: 2px solid var(--surface);
}
.app-header.admin-header .icon-count { border-color: var(--primary-dark); }

.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 999px; }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--success));
    color: #fff; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.app-header.admin-header .user-name { color: #fff; }
.user-name .role-tag { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.app-header.admin-header .user-name .role-tag { color: #9db3e0; }

/* ---- Body: sidebar + content ---- */
.app-body { display: flex; align-items: stretch; }

.sidebar-overlay {
    display: none;
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 45;
    background: rgba(11, 33, 72, 0.45);
}

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--surface); border-right: 1px solid var(--border);
    position: sticky; top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 18px 14px 24px;
}
.admin-body .sidebar { background: var(--primary-dark); border-color: #10306b; }

.sidebar-group { margin-bottom: 20px; }
.sidebar-group-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-muted); padding: 0 10px; margin-bottom: 8px;
}
.admin-body .sidebar-group-label { color: #7f9ad6; }

.sidebar-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--text);
    white-space: nowrap;
}
.sidebar-nav a:hover { background: var(--background); text-decoration: none; }
.sidebar-nav a .icon { flex-shrink: 0; color: var(--text-muted); }
.sidebar-nav a.active { background: var(--soft-blue); color: var(--primary); font-weight: 700; }
.sidebar-nav a.active .icon { color: var(--primary); }
.sidebar-nav a .nav-badge {
    margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 999px; padding: 1px 6px;
}

.admin-body .sidebar-nav a { color: #cdd9f2; }
.admin-body .sidebar-nav a:hover { background: rgba(255,255,255,0.07); }
.admin-body .sidebar-nav a .icon { color: #7f9ad6; }
.admin-body .sidebar-nav a.active { background: rgba(36,120,255,0.28); color: #fff; }
.admin-body .sidebar-nav a.active .icon { color: #fff; }

.sidebar-divider { height: 1px; background: var(--border); margin: 10px 4px 14px; }
.admin-body .sidebar-divider { background: #1c3d7c; }

.sidebar-cta {
    margin: 6px 6px 0; padding: 16px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--soft-blue), var(--success-light));
    border: 1px solid rgba(23,105,255,0.16);
}
.sidebar-cta p { margin: 0 0 12px; font-size: 12.5px; color: var(--text); line-height: 1.45; }

.app-body .content { flex: 1; min-width: 0; max-width: 1120px; margin: 0 auto; padding: 28px 24px 60px; width: 100%; }

/* ---- Mobile bottom navigation (Section 19) ---- */
.bottom-nav {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(11,33,72,0.06);
}
.bottom-nav-inner { display: flex; align-items: stretch; justify-content: space-around; }
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border-radius: 10px; color: var(--text-muted); font-size: 10.5px; font-weight: 600;
    min-height: 44px; justify-content: center;
}
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a .icon { width: 22px; height: 22px; }

/* ---- Responsive: tablet & mobile off-canvas sidebar + bottom nav ---- */
@media (max-width: 991px) {
    .hamburger-btn { display: inline-flex; }
    .sidebar {
        position: fixed; top: var(--header-h); left: 0; z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.14);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { display: block; }
    body.sidebar-open { overflow: hidden; }
    .app-body .content { padding: 20px 16px 90px; }
    .user-name { display: none; }
}

@media (max-width: 599px) {
    .app-header { padding: 0 14px; gap: 8px; }
    .app-header .brand .brand-text { display: none; }
    .sidebar { width: min(84vw, 300px); }
    .app-body .content { padding: 16px 14px 88px; }
    .topbar-user span { display: none; }
    .bottom-nav { display: block; }
    .balance-actions .btn { min-width: 100px; font-size: 13px; padding: 10px 12px; }
}

/* ==========================================================================
   Landing page
   ========================================================================== */
.landing-header {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 20px;
    padding: 14px 5vw;
    background: rgba(255,255,255,0.94); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.landing-nav { display: flex; gap: 24px; flex: 1; }
.landing-nav a { color: var(--text); font-weight: 500; font-size: 14px; }
.landing-header-actions { display: flex; gap: 10px; align-items: center; }
.landing-menu-btn { display: none; }

.landing-main { background: var(--surface); }
.landing-section { padding: 72px 5vw; }
.landing-inner { max-width: 1140px; margin: 0 auto; }

.trust-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--soft-blue); color: var(--primary); font-size: 12.5px; font-weight: 700;
    padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}

.hero-section { padding: 64px 5vw 60px; background: linear-gradient(180deg, var(--soft-blue) 0%, var(--background) 100%); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 52px; align-items: center; max-width: 1140px; margin: 0 auto; }
.hero-grid h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.1; margin: 0 0 18px !important; max-width: 14ch; letter-spacing: -0.02em; }
.hero-grid p.lead { font-size: 17px; color: var(--text-muted); max-width: 46ch; margin: 0 0 28px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-note { font-size: 13px; color: var(--text-muted); }

.hero-mock {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px; box-shadow: var(--shadow-md); position: relative;
}
.hero-mock-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.hero-mock-title { font-size: 12.5px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; }
.hero-mock-pill { font-size: 11px; font-weight: 700; color: #0A6B3C; background: var(--success-light); padding: 4px 10px; border-radius: 999px; }
.hero-mock-balance { font-size: 32px; font-weight: 800; margin-bottom: 4px; color: var(--primary-dark); }
.hero-mock-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 20px; }
.hero-mock-list { display: flex; flex-direction: column; gap: 10px; }
.hero-mock-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--background);
}
.hero-mock-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.hero-mock-item .amt { margin-left: auto; font-weight: 700; color: var(--success); }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 1140px; margin: 0 auto; }
.stat-block { text-align: center; padding: 20px 10px; }
.stat-block .stat-num { font-size: clamp(24px, 4vw, 32px); font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
.stat-block .stat-label2 { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 12px !important; letter-spacing: -0.01em; }
.section-head p { color: var(--text-muted); font-size: 15.5px; margin: 0; }

.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1140px; margin: 0 auto; }
.step-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.step-card .step-index {
    width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: #fff; background: var(--primary); margin-bottom: 14px;
}
.step-card h3 { font-size: 16px; margin: 0 0 8px !important; }
.step-card p { font-size: 13.5px; color: var(--text-muted); margin: 0; line-height: 1.55; }

.landing-section.alt { background: var(--background); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1140px; margin: 0 auto; }
.feature-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.feature-card .feature-icon {
    width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--soft-blue); color: var(--primary);
}
.feature-card h3 { font-size: 15.5px; margin: 0 0 8px !important; }
.feature-card p { font-size: 13.5px; color: var(--text-muted); margin: 0; line-height: 1.55; }

.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1140px; margin: 0 auto; }
.trust-card { padding: 22px; border-left: 3px solid var(--primary); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; box-shadow: var(--shadow-sm); }
.trust-card h3 { font-size: 14.5px; margin: 0 0 8px !important; }
.trust-card p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.55; }

.cta-band {
    max-width: 1140px; margin: 0 auto; padding: 44px 44px;
    border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--primary-dark), var(--primary));
    color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { font-size: 24px; margin: 0 0 6px !important; }
.cta-band p { margin: 0; color: #cfe0ff; font-size: 14px; }

.landing-footer { border-top: 1px solid var(--border); padding: 40px 5vw 28px; background: var(--surface); }
.landing-footer-inner { max-width: 1140px; margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 13px; }
.footer-note { font-size: 12px; color: var(--text-muted); max-width: 640px; line-height: 1.65; margin-top: 14px; }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-grid h1 { max-width: none; }
    .steps-row { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .trust-row { grid-template-columns: 1fr; }
    .landing-nav { display: none; }
    .landing-menu-btn { display: inline-flex; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 901px) {
    .landing-menu-btn { display: none !important; }
    #landingSidebarOverlay, .landing-sidebar { display: none !important; }
}
@media (max-width: 560px) {
    .steps-row { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .landing-section { padding: 48px 5vw; }
    .hero-section { padding: 40px 5vw 36px; }
    .cta-band { flex-direction: column; align-items: flex-start; padding: 28px; }
    .quick-actions { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   Typography — Fjalla One
   ========================================================================== */
.fjalla-one-regular {
    font-family: "Fjalla One", sans-serif;
    font-weight: 400;
    font-style: normal;
}

/* ==========================================================================
   Site-wide motion — smooth, subtle animation on interactive and entering
   elements. Respects prefers-reduced-motion for accessibility.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

    @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(14px); }
        to { opacity: 1; transform: translateY(0); }
    }
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    @keyframes popIn {
        from { opacity: 0; transform: scale(0.92) translateY(8px); }
        to { opacity: 1; transform: scale(1) translateY(0); }
    }
    @keyframes popOut {
        from { opacity: 1; transform: scale(1) translateY(0); }
        to { opacity: 0; transform: scale(0.94) translateY(6px); }
    }
    @keyframes overlayIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    @keyframes spinGrow {
        from { transform: scale(0.85); opacity: 0.4; }
        to { transform: scale(1); opacity: 1; }
    }
    @keyframes slideDownFade {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Page content fades/slides in on every navigation. */
    .content > *,
    .landing-main > *,
    .guest-wrap > * {
        animation: fadeInUp 0.42s cubic-bezier(.2,.7,.3,1) both;
    }
    /* Stagger the first several children slightly so lists/grids feel alive rather than flashing at once. */
    .content > *:nth-child(2),  .landing-main > *:nth-child(2)  { animation-delay: .03s; }
    .content > *:nth-child(3),  .landing-main > *:nth-child(3)  { animation-delay: .06s; }
    .content > *:nth-child(4),  .landing-main > *:nth-child(4)  { animation-delay: .09s; }
    .content > *:nth-child(5),  .landing-main > *:nth-child(5)  { animation-delay: .12s; }
    .content > *:nth-child(6),  .landing-main > *:nth-child(6)  { animation-delay: .15s; }

    .grid > *, .steps-row > *, .feature-grid > *, .trust-row > *, .stats-row > * {
        animation: fadeInUp 0.45s cubic-bezier(.2,.7,.3,1) both;
    }
    .grid > *:nth-child(2) { animation-delay: .04s; }
    .grid > *:nth-child(3) { animation-delay: .08s; }
    .grid > *:nth-child(4) { animation-delay: .12s; }
    .grid > *:nth-child(5) { animation-delay: .16s; }
    .grid > *:nth-child(6) { animation-delay: .2s; }

    .app-header, .landing-header { animation: slideDownFade 0.35s ease both; }
    .sidebar { animation: fadeIn 0.4s ease both; }
    .alert { animation: slideDownFade 0.3s ease both; }
    .balance-card { animation: fadeInUp 0.5s cubic-bezier(.2,.7,.3,1) both; }

    /* Smooth, consistent hover/focus transitions across every interactive element. */
    a, button, .btn, .card, .task-card, .plan-card, input, select, textarea,
    .sidebar-nav a, .bottom-nav a, .icon-btn, .tab-link, .stat-card,
    .step-card, .feature-card, .trust-card, table tr, .empty-icon {
        transition: background-color .18s ease, border-color .18s ease, color .18s ease,
                    box-shadow .22s ease, transform .18s cubic-bezier(.2,.7,.3,1), opacity .18s ease;
    }

    .btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(11,33,72,0.14); }
    .btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }

    .card:hover, .task-card:hover, .plan-card:hover, .step-card:hover,
    .feature-card:hover, .trust-card:hover, .stat-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

    .sidebar-nav a:hover { transform: translateX(3px); }
    .icon-btn:hover { transform: translateY(-1px) scale(1.05); }
    .bottom-nav a:hover, .bottom-nav a.active { transform: translateY(-2px); }
    table tbody tr:hover { background: var(--background); }

    input:focus, select:focus, textarea:focus {
        transform: translateY(-1px);
        box-shadow: 0 0 0 3px var(--soft-blue);
    }

    .hamburger-btn { transition: transform .25s ease; }
    body.sidebar-open .hamburger-btn { transform: rotate(90deg); }
}

/* ==========================================================================
   Confirmation / information popup modal — used site-wide for deposits,
   membership purchases, withdrawals, login welcome messages, and every
   other flashed success/error notice.
   ========================================================================== */
.popup-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(11, 33, 72, 0.5);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
@media (prefers-reduced-motion: no-preference) {
    .popup-overlay { animation: overlayIn .2s ease both; }
    .popup-overlay.closing { animation: fadeIn .18s ease reverse both; }
    .popup-modal { animation: popIn .28s cubic-bezier(.2,.8,.3,1.1) both; }
    .popup-overlay.closing .popup-modal { animation: popOut .18s ease both; }
}
.popup-modal {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(11,33,72,0.28);
    max-width: 400px; width: 100%;
    padding: 28px 26px 22px;
    text-align: center;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
.popup-icon {
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 26px; font-weight: 800;
}
.popup-icon.type-success { background: var(--success-light); color: #0A6B3C; }
.popup-icon.type-info { background: var(--soft-blue); color: var(--primary); }
.popup-icon.type-error { background: #FEF2F2; color: #991B1B; }
.popup-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.popup-message { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin: 0 0 22px; }
.popup-ok-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; padding: 12px 20px; border: none; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff; font-size: 14.5px; font-weight: 700;
    cursor: pointer;
}
.popup-ok-btn:hover { background: var(--primary-bright); }

/* ==========================================================================
   Row-detail modal (deposit/withdrawal history eye icon, admin device
   warnings, etc) — reuses the popup-modal shell but left-aligned and wider,
   with a simple label/value list.
   ========================================================================== */
.detail-modal { max-width: 460px; text-align: left; }
.detail-list { margin: 4px 0 18px; border-top: 1px solid var(--border); }
.detail-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding: 9px 0; border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}
.detail-label { color: var(--text-muted); flex-shrink: 0; }
.detail-value { color: var(--text); font-weight: 600; text-align: right; word-break: break-word; }
.detail-proof-img {
    display: block; max-width: 100%; border-radius: var(--radius-sm);
    border: 1px solid var(--border); margin: 0 0 18px;
}
.icon-btn-sm {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; min-width: 30px; border-radius: var(--radius-sm);
    color: var(--text-muted); background: var(--background); border: 1px solid var(--border); cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.icon-btn-sm:hover { background: var(--soft-blue); color: var(--primary); }
.icon-btn-sm svg { width: 16px; height: 16px; pointer-events: none; }

/* Small copy-to-clipboard control used next to TrxIDs, account details, etc (admin panel). */
.copy-field {
    display: inline-flex; align-items: center; gap: 8px; max-width: 280px;
    background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 8px;
}
.copy-field-wide { max-width: 320px; }
.copy-field-text {
    font-size: 13px; white-space: normal; word-break: break-all; color: var(--text);
}
.copy-field-btn {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted); cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.copy-field-btn svg { width: 14px; height: 14px; pointer-events: none; }
.copy-field-btn:hover { background: var(--soft-blue); color: var(--primary); }
.copy-field-btn.copied { background: var(--success-light); color: #0A6B3C; border-color: transparent; }

@media (max-width: 599px) {
    .popup-modal { padding: 22px 18px 18px; border-radius: var(--radius-md); max-height: calc(100vh - 24px); }
    .popup-overlay { padding: 12px; }
    .detail-row { font-size: 13px; gap: 10px; }
    .icon-btn-sm { width: 34px; height: 34px; min-width: 34px; }
    .icon-btn-sm svg { width: 17px; height: 17px; }
    .copy-field, .copy-field-wide { max-width: 100%; }
    .copy-field-btn { width: 34px; height: 34px; }
    .copy-field-btn svg { width: 16px; height: 16px; }
}

/* Simple tab strip re-used by the history page (mirrors #wallet-tabs pattern). */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 4px;
    border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.history-item:last-child { border-bottom: none; }
.history-item-method {
    font-weight: 600; font-size: 14px; color: var(--text);
    flex: 1 1 100px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-item-amount { font-weight: 700; font-size: 14.5px; color: var(--text); flex-shrink: 0; }
.history-item-eye { flex-shrink: 0; margin-left: auto; }
@media (max-width: 420px) {
    .history-item { gap: 8px; }
    .history-item-method { flex-basis: 70px; font-size: 13px; }
    .history-item-amount { font-size: 13px; }
}

.device-hash-chip {
    font-family: monospace; font-size: 12px; background: var(--background);
    padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
}

/* ==========================================================================
   Landing page — admin-controlled animations (Admin > Landing Page > Animations)
   Everything below only applies when <html data-anim="on"> is set, and is
   switched off for visitors who prefer reduced motion.
   ========================================================================== */
.hero-grid-single { grid-template-columns: 1fr; text-align: center; }
.hero-grid-single h1, .hero-grid-single p.lead { margin-left: auto; margin-right: auto; max-width: 28ch; }
.hero-grid-single p.lead { max-width: 60ch; }
.hero-grid-single .hero-actions { justify-content: center; }
.cta-band .cta-btn { background: #fff; color: var(--primary-dark); box-shadow: none; }
.cta-band .cta-btn:hover { background: #f1f6ff; }
.landing-header.is-scrolled { box-shadow: 0 6px 24px rgba(11,33,72,.08); }
.landing-nav a { position: relative; }
.landing-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px; background: var(--primary); transition: right .25s ease; }
.landing-nav a:hover { text-decoration: none; }
.landing-nav a:hover::after { right: 0; }

html[data-anim="on"] { --anim-dur: .7s; }
html[data-anim="on"][data-anim-speed="fast"] { --anim-dur: .45s; }
html[data-anim="on"][data-anim-speed="slow"] { --anim-dur: 1.1s; }

@media (prefers-reduced-motion: no-preference) {
    /* smooth anchor scrolling + page fade */
    html[data-anim-transition="1"] { scroll-behavior: smooth; scroll-padding-top: 76px; }
    html[data-anim-transition="1"] body { animation: lpPageIn .5s ease both; }
    html[data-anim-transition="1"] body.page-leaving { opacity: 0; transition: opacity .18s ease; }

    /* scroll reveal (class js-anim is added by an inline script, so no-JS visitors see everything) */
    html.js-anim [data-reveal] {
        opacity: 0;
        transition: opacity var(--anim-dur, .7s) ease, transform var(--anim-dur, .7s) cubic-bezier(.2,.7,.2,1);
        transition-delay: var(--reveal-delay, 0ms);
        will-change: opacity, transform;
    }
    html.js-anim [data-reveal="fade-up"] { transform: translateY(32px); }
    html.js-anim [data-reveal="zoom-in"] { transform: scale(.92); }
    html.js-anim [data-reveal="slide-left"] { transform: translateX(-40px); }
    html.js-anim [data-reveal="slide-right"] { transform: translateX(40px); }
    html.js-anim [data-reveal].is-visible { opacity: 1; transform: none; will-change: auto; }

    /* hero entrance */
    html[data-anim="on"] .hero-anim { animation: lpHeroIn var(--anim-dur, .7s) cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 110ms + 60ms); }
    html[data-anim="on"][data-anim-float="1"] .hero-anim-mock {
        animation: lpHeroIn var(--anim-dur, .7s) cubic-bezier(.2,.7,.2,1) both, lpFloat 6s ease-in-out 1.2s infinite;
        animation-delay: calc(var(--i, 0) * 110ms + 60ms), 1.2s;
    }
    html[data-anim="on"] .hero-mock-item { animation: lpHeroIn .6s ease both; animation-delay: calc(.55s + var(--n, 0) * 140ms); }
    html[data-anim="on"] .hero-mock-pill { animation: lpPulse 2.6s ease-in-out 1.5s infinite; }

    /* hover polish (only on the animated landing) */
    html[data-anim="on"] .step-card, html[data-anim="on"] .feature-card, html[data-anim="on"] .trust-card, html[data-anim="on"] .stat-block {
        transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, opacity var(--anim-dur, .7s) ease;
    }
    html[data-anim="on"] .step-card:hover, html[data-anim="on"] .feature-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(11,33,72,.12); border-color: var(--primary); }
    html[data-anim="on"] .trust-card:hover { transform: translateX(4px); box-shadow: 0 12px 28px rgba(11,33,72,.10); }
    html[data-anim="on"] .feature-card:hover .feature-icon { transform: scale(1.1) rotate(-4deg); }
    html[data-anim="on"] .feature-icon { transition: transform .28s ease; }
    html[data-anim="on"] .btn { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
    html[data-anim="on"] .landing-body .btn:hover { transform: translateY(-2px); }
    html[data-anim="on"] .cta-band { background-size: 200% 200%; animation: lpGradient 9s ease-in-out infinite; }
}
@keyframes lpPageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lpHeroIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes lpFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes lpPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(10,107,60,.0); } 50% { box-shadow: 0 0 0 6px rgba(10,107,60,.14); } }
@keyframes lpGradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) {
    html[data-anim] [data-reveal], html[data-anim] .hero-anim, html[data-anim] .hero-mock-item { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
}

/* ---------- Admin: landing editor repeaters ---------- */
.lp-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.lp-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--background); }
.lp-row-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 26px; }
.lp-row-fields { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.lp-row-fields .form-group { margin-bottom: 8px; }
.lp-check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }

/* Admin quiz manager: pagination */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin-top: 16px; }
