/* ==========================================================
   xLoyalty Member Area — Modern CSS (PHP 5.6 compatible)
   White-label via CSS variables set in functions.php
   ========================================================== */

/* --- CSS Variables (defaults = xLoyalty branding) --- */
:root {
    --brand-primary: #6B2FA0;
    --brand-primary-light: #8B5FC7;
    --brand-primary-dark: #4A1D73;
    --brand-accent: #F5A623;
    --brand-accent-light: #FFD080;
    --brand-success: #22C55E;
    --brand-danger: #EF4444;
    --brand-surface: #F5F5F7;
    --brand-card: #FFFFFF;
    --brand-text: #1A1A2E;
    --brand-text-muted: #6B7280;
    --brand-text-light: #9CA3AF;
    --brand-border: #E5E7EB;
    --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    --brand-radius: 14px;
    --brand-radius-sm: 10px;
    --brand-radius-lg: 20px;
    --brand-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --brand-shadow-hover: 0 6px 24px rgba(0,0,0,0.12);
    --brand-font: 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --header-bg: #240006;
}

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

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--brand-font);
    background: var(--brand-surface);
    color: var(--brand-text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px; /* space for bottom nav */
}

a { color: var(--brand-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--brand-primary-light); }

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

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }

/* --- Animations --- */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes progressFill {
    from { width: 0; }
}

.animate-in { animation: fadeSlideUp 0.45s ease forwards; }
.animate-in-delay-1 { animation: fadeSlideUp 0.45s ease 0.08s forwards; opacity: 0; }
.animate-in-delay-2 { animation: fadeSlideUp 0.45s ease 0.16s forwards; opacity: 0; }
.animate-in-delay-3 { animation: fadeSlideUp 0.45s ease 0.24s forwards; opacity: 0; }

/* ========================================
   TOP HEADER / NAV BAR
   ======================================== */
.xl-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--brand-border);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.xl-topbar__left,
.xl-topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.xl-topbar__logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.xl-topbar__logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}
.xl-topbar__logo-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-text);
    letter-spacing: -0.3px;
}
.xl-topbar__logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.xl-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--brand-text-muted);
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    position: relative;
}
.xl-btn-icon:hover {
    background: rgba(0,0,0,0.05);
    color: var(--brand-text);
}
.xl-btn-icon .badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-danger);
    border: 2px solid #fff;
}

.xl-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.xl-avatar-sm:hover { opacity: 0.85; }

/* ========================================
   SIDE DRAWER (MOBILE MENU)
   ======================================== */
.xl-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0,0,0,0.4);
    animation: fadeIn 0.2s ease;
    display: none;
}
.xl-drawer-overlay.open { display: block; }

.xl-drawer {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 91;
    background: #fff;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    padding: 20px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.xl-drawer.open { transform: translateX(0); }

.xl-drawer__header {
    background: var(--brand-gradient);
    border-radius: var(--brand-radius);
    padding: 20px 16px;
    color: #fff;
    margin-bottom: 20px;
}
.xl-drawer__name {
    font-size: 17px;
    font-weight: 700;
}
.xl-drawer__points {
    font-size: 13px;
    opacity: 0.75;
    margin-top: 4px;
}

.xl-drawer__nav { list-style: none; }
.xl-drawer__nav li { margin-bottom: 2px; }
.xl-drawer__nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: 12px;
    color: var(--brand-text);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.15s;
    text-decoration: none;
}
.xl-drawer__nav a:hover {
    background: rgba(107,47,160,0.06);
    color: var(--brand-primary);
}
.xl-drawer__nav a.active {
    background: rgba(107,47,160,0.1);
    color: var(--brand-primary);
    font-weight: 700;
}
.xl-drawer__nav a .nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.xl-drawer__nav .nav-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    background: var(--brand-danger);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xl-drawer__divider {
    border: none;
    border-top: 1px solid var(--brand-border);
    margin: 16px 0;
}
.xl-drawer__nav a.logout {
    color: var(--brand-danger);
}

/* ========================================
   BOTTOM TAB BAR
   ======================================== */
.xl-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: rgba(255,255,255,0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--brand-border);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 max(10px, env(safe-area-inset-bottom));
    max-width: 600px;
    margin: 0 auto;
}
.xl-bottomnav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    color: var(--brand-text-light);
    text-decoration: none;
    position: relative;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--brand-font);
}
.xl-bottomnav__item:hover,
.xl-bottomnav__item.active {
    color: var(--brand-primary);
}
.xl-bottomnav__item.active::before {
    content: '';
    position: absolute;
    top: -6px;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: var(--brand-primary);
}
.xl-bottomnav__item .nav-icon {
    font-size: 20px;
    line-height: 1;
}
.xl-bottomnav__item .nav-badge-sm {
    position: absolute;
    top: 0;
    right: 2px;
    font-size: 8px;
    font-weight: 700;
    background: var(--brand-danger);
    color: #fff;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xl-bottomnav__item span { font-weight: 500; }
.xl-bottomnav__item.active span { font-weight: 700; }

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.xl-main {
    max-width: 560px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ========================================
   HERO / POINTS CARD
   ======================================== */
.xl-hero {
    background: var(--brand-gradient);
    border-radius: var(--brand-radius-lg);
    padding: 28px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}
.xl-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.xl-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.xl-hero__welcome {
    font-size: 14px;
    opacity: 0.8;
    letter-spacing: 0.3px;
}
.xl-hero__name {
    font-size: 24px;
    font-weight: 700;
    margin: 4px 0 18px;
    position: relative;
    z-index: 1;
}
.xl-hero__stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.xl-hero__points-circle {
    width: 110px;
    height: 110px;
    position: relative;
    flex-shrink: 0;
}
.xl-hero__points-circle svg {
    transform: rotate(-90deg);
}
.xl-hero__points-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.xl-hero__points-number {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}
.xl-hero__points-label {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}
.xl-hero__next-reward {
    flex: 1;
    min-width: 160px;
}
.xl-hero__tier {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 10px;
}
.xl-hero__next-box {
    background: rgba(255,255,255,0.12);
    border-radius: var(--brand-radius-sm);
    padding: 12px 14px;
}
.xl-hero__next-label {
    font-size: 12px;
    opacity: 0.7;
}
.xl-hero__next-title {
    font-size: 15px;
    font-weight: 600;
    margin: 3px 0 8px;
}
.xl-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.15);
    overflow: hidden;
}
.xl-progress-bar__fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand-accent), var(--brand-accent-light));
    animation: progressFill 1.2s cubic-bezier(0.4,0,0.2,1);
    transition: width 0.6s ease;
}
.xl-hero__next-meta {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

/* ========================================
   STAT CARDS GRID
   ======================================== */
.xl-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.xl-card {
    background: var(--brand-card);
    border-radius: var(--brand-radius);
    padding: 18px;
    border: 1px solid var(--brand-border);
    box-shadow: var(--brand-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.xl-card--clickable { cursor: pointer; }
.xl-card--clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--brand-shadow-hover);
}
.xl-card__icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.xl-card__label {
    font-size: 12px;
    color: var(--brand-text-muted);
}
.xl-card__value {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-text);
    margin-top: 2px;
}
.xl-card__value--accent { color: var(--brand-primary); }
.xl-card__value--success { color: var(--brand-success); }
.xl-card__link {
    font-size: 11px;
    color: var(--brand-primary);
    font-weight: 600;
    margin-top: 8px;
    display: block;
}

/* ========================================
   WALLET BUTTONS
   ======================================== */
.xl-wallet-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.xl-wallet-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--brand-font);
    transition: opacity 0.2s;
    text-decoration: none;
}
.xl-wallet-btn:hover { opacity: 0.85; }
.xl-wallet-btn--apple { background: #000; color: #fff; }
.xl-wallet-btn--google { background: #4285F4; color: #fff; }

/* ========================================
   SECTION HEADERS
   ======================================== */
.xl-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.xl-section-header__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-text);
}
.xl-section-header__link {
    font-size: 13px;
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
}

/* ========================================
   PROMOTIONS HORIZONTAL SCROLL
   ======================================== */
.xl-promo-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 24px;
}
.xl-promo-scroll::-webkit-scrollbar { height: 0; }

.xl-promo-card {
    min-width: 230px;
    flex-shrink: 0;
    border-radius: var(--brand-radius);
    padding: 16px 18px;
    border: 1px solid var(--brand-border);
    background: var(--brand-card);
    box-shadow: var(--brand-shadow);
}
.xl-promo-card--featured {
    background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-accent-light) 100%);
    border: none;
    color: var(--brand-text);
}
.xl-promo-card__title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}
.xl-promo-card__body {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.4;
    margin-bottom: 8px;
}
.xl-promo-card__date {
    font-size: 11px;
    opacity: 0.6;
}

/* ========================================
   PROMOTIONS LIST (full page)
   ======================================== */
.xl-promo-item {
    background: var(--brand-card);
    border-radius: var(--brand-radius);
    padding: 20px 22px;
    margin-bottom: 14px;
    border: 1px solid var(--brand-border);
    border-left: 4px solid var(--brand-accent);
    box-shadow: var(--brand-shadow);
    position: relative;
}
.xl-promo-item__badge {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 10px;
    font-weight: 700;
    color: var(--brand-success);
    background: rgba(34,197,94,0.1);
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}
.xl-promo-item__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 6px;
    padding-right: 80px;
}
.xl-promo-item__body {
    font-size: 14px;
    color: var(--brand-text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}
.xl-promo-item__image {
    max-width: 100%;
    border-radius: var(--brand-radius-sm);
    margin: 10px 0;
}
.xl-promo-item__date {
    font-size: 12px;
    color: var(--brand-text-light);
}

/* ========================================
   TRANSACTIONS LIST
   ======================================== */
.xl-tx-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--brand-border);
}
.xl-tx-item:last-child { border-bottom: none; }
.xl-tx-item__left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.xl-tx-item__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.xl-tx-item__icon--earn { background: rgba(34,197,94,0.1); color: var(--brand-success); }
.xl-tx-item__icon--redeem { background: rgba(239,68,68,0.1); color: var(--brand-danger); }
.xl-tx-item__icon--bonus { background: rgba(245,166,35,0.1); color: var(--brand-accent); }
.xl-tx-item__note {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-text);
}
.xl-tx-item__date {
    font-size: 12px;
    color: var(--brand-text-muted);
}
.xl-tx-item__points {
    font-size: 15px;
    font-weight: 700;
}
.xl-tx-item__points--positive { color: var(--brand-success); }
.xl-tx-item__points--negative { color: var(--brand-danger); }

/* Full table view */
.xl-table-wrap {
    background: var(--brand-card);
    border-radius: var(--brand-radius);
    border: 1px solid var(--brand-border);
    overflow: hidden;
}
.xl-table-head {
    display: grid;
    grid-template-columns: 1fr auto auto;
    padding: 12px 20px;
    background: var(--brand-surface);
    border-bottom: 1px solid var(--brand-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.xl-table-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    padding: 14px 20px;
    border-bottom: 1px solid var(--brand-border);
    align-items: center;
}
.xl-table-row:last-child { border-bottom: none; }

/* ========================================
   REWARDS LIST
   ======================================== */
.xl-reward-item {
    background: var(--brand-card);
    border-radius: var(--brand-radius);
    padding: 18px 20px;
    margin-bottom: 12px;
    border: 1px solid var(--brand-border);
    box-shadow: var(--brand-shadow);
    transition: all 0.3s;
}
.xl-reward-item--unlocked {
    border-color: var(--brand-success);
    box-shadow: 0 2px 12px rgba(34,197,94,0.12);
}
.xl-reward-item--locked { opacity: 0.7; }
.xl-reward-item__badge {
    float: right;
    font-size: 10px;
    font-weight: 700;
    color: var(--brand-success);
    background: rgba(34,197,94,0.1);
    padding: 3px 10px;
    border-radius: 20px;
}
.xl-reward-item__inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.xl-reward-item__icon {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.xl-reward-item__icon--unlocked { background: rgba(34,197,94,0.1); }
.xl-reward-item__icon--locked { background: rgba(107,47,160,0.08); }
.xl-reward-item__content { flex: 1; min-width: 0; }
.xl-reward-item__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 3px;
}
.xl-reward-item__desc {
    font-size: 13px;
    color: var(--brand-text-muted);
    margin-bottom: 8px;
}
.xl-reward-item__image {
    max-width: 100%;
    border-radius: var(--brand-radius-sm);
    margin-top: 10px;
}
.xl-reward-item__progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.xl-reward-item__bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--brand-border);
    overflow: hidden;
}
.xl-reward-item__fill {
    height: 100%;
    border-radius: 3px;
    animation: progressFill 0.8s ease;
}
.xl-reward-item__fill--unlocked { background: var(--brand-success); }
.xl-reward-item__fill--locked { background: var(--brand-primary); }
.xl-reward-item__pts {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-text-muted);
    flex-shrink: 0;
}
.xl-reward-item__valid {
    font-size: 11px;
    color: var(--brand-text-light);
    margin-top: 4px;
}

/* ========================================
   INBOX / MESSAGES
   ======================================== */
.xl-msg-item {
    background: var(--brand-card);
    border-radius: var(--brand-radius);
    padding: 18px 20px;
    margin-bottom: 12px;
    border: 1px solid var(--brand-border);
    position: relative;
}
.xl-msg-item--unread {
    border-color: var(--brand-primary);
    box-shadow: 0 2px 12px rgba(107,47,160,0.12);
}
.xl-msg-item--unread::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-primary);
}
.xl-msg-item__text {
    font-size: 14px;
    color: var(--brand-text);
    line-height: 1.5;
    margin-bottom: 8px;
}
.xl-msg-item--unread .xl-msg-item__text { font-weight: 600; }
.xl-msg-item__date {
    font-size: 12px;
    color: var(--brand-text-light);
}
.xl-msg-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--brand-text-muted);
}
.xl-msg-empty__icon { font-size: 44px; margin-bottom: 12px; }

/* ========================================
   PROFILE / FORMS
   ======================================== */
.xl-profile-card {
    background: var(--brand-card);
    border-radius: var(--brand-radius);
    padding: 24px;
    border: 1px solid var(--brand-border);
    box-shadow: var(--brand-shadow);
}
.xl-profile-avatar {
    text-align: center;
    margin-bottom: 24px;
}
.xl-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    font-weight: 700;
}
.xl-profile-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-text);
}
.xl-profile-since {
    font-size: 13px;
    color: var(--brand-text-muted);
    margin-top: 4px;
}

.xl-form-group {
    margin-bottom: 18px;
}
.xl-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.xl-form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--brand-radius-sm);
    font-size: 14px;
    border: 1px solid var(--brand-border);
    background: #fff;
    color: var(--brand-text);
    outline: none;
    font-family: var(--brand-font);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.xl-form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(107,47,160,0.1);
}
.xl-form-input:disabled,
.xl-form-input[readonly] {
    background: var(--brand-surface);
    color: var(--brand-text-muted);
    cursor: not-allowed;
}
.xl-form-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--brand-radius-sm);
    font-size: 14px;
    border: 1px solid var(--brand-border);
    background: #fff;
    color: var(--brand-text);
    font-family: var(--brand-font);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.xl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--brand-font);
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
}
.xl-btn:hover { opacity: 0.9; }
.xl-btn:active { transform: scale(0.98); }
.xl-btn--primary {
    background: var(--brand-gradient);
    color: #fff;
    width: 100%;
}
.xl-btn--outline {
    background: transparent;
    border: 2px solid var(--brand-border);
    color: var(--brand-text-muted);
}
.xl-btn--outline.active {
    border-color: var(--brand-primary);
    background: rgba(107,47,160,0.08);
    color: var(--brand-primary);
}

/* ========================================
   LOGIN / REGISTER PAGES
   ======================================== */
.xl-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--brand-surface);
}
.xl-auth-logo {
    margin-bottom: 32px;
    text-align: center;
}
.xl-auth-logo img {
    max-height: 80px;
    width: auto;
}
.xl-auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--brand-card);
    border-radius: var(--brand-radius-lg);
    padding: 32px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid var(--brand-border);
}
.xl-auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-text);
    text-align: center;
    margin-bottom: 24px;
}
.xl-auth-subtitle {
    font-size: 14px;
    color: var(--brand-text-muted);
    text-align: center;
    margin-bottom: 24px;
}
.xl-auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--brand-text-muted);
}
.xl-auth-footer a {
    font-weight: 600;
}

/* ========================================
   PAGE TITLE
   ======================================== */
.xl-page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 8px;
}
.xl-page-subtitle {
    font-size: 14px;
    color: var(--brand-text-muted);
    margin-bottom: 24px;
}

/* ========================================
   STAT PILLS (summary boxes)
   ======================================== */
.xl-stat-pills {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.xl-stat-pill {
    flex: 1;
    min-width: 130px;
    border-radius: var(--brand-radius);
    padding: 16px 18px;
}
.xl-stat-pill--success { background: rgba(34,197,94,0.08); }
.xl-stat-pill--primary { background: rgba(107,47,160,0.06); }
.xl-stat-pill__label {
    font-size: 11px;
    color: var(--brand-text-muted);
}
.xl-stat-pill__value {
    font-size: 24px;
    font-weight: 800;
    margin-top: 4px;
}
.xl-stat-pill__value--success { color: var(--brand-success); }
.xl-stat-pill__value--primary { color: var(--brand-primary); }

/* ========================================
   ALERT / INFO BOXES
   ======================================== */
.xl-alert {
    padding: 14px 18px;
    border-radius: var(--brand-radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}
.xl-alert--success {
    background: rgba(34,197,94,0.1);
    color: #166534;
    border: 1px solid rgba(34,197,94,0.2);
}
.xl-alert--danger {
    background: rgba(239,68,68,0.1);
    color: #991B1B;
    border: 1px solid rgba(239,68,68,0.2);
}
.xl-alert--warning {
    background: rgba(245,166,35,0.1);
    color: #92400E;
    border: 1px solid rgba(245,166,35,0.2);
}
.xl-alert--info {
    background: rgba(107,47,160,0.08);
    color: var(--brand-primary-dark);
    border: 1px solid rgba(107,47,160,0.15);
}

/* ========================================
   FOOTER
   ======================================== */
.xl-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--brand-text-light);
}
.xl-footer a { color: var(--brand-primary); font-weight: 600; }

/* ========================================
   QR CODE
   ======================================== */
.xl-qr-wrap {
    text-align: center;
    padding: 16px;
}
.xl-qr-wrap canvas,
.xl-qr-wrap img { margin: 0 auto; }

/* ========================================
   GIFTCARD STYLES
   ======================================== */
.xl-giftcard {
    background: var(--brand-card);
    border-radius: var(--brand-radius);
    padding: 22px;
    margin-bottom: 16px;
    border: 1px solid var(--brand-border);
    box-shadow: var(--brand-shadow);
}
.xl-giftcard__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.xl-giftcard__type {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-primary);
    background: rgba(107,47,160,0.08);
    padding: 4px 12px;
    border-radius: 20px;
}
.xl-giftcard__code {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-text);
}
.xl-giftcard__detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--brand-border);
}
.xl-giftcard__detail:last-child { border-bottom: none; }
.xl-giftcard__detail-label { color: var(--brand-text-muted); }
.xl-giftcard__detail-value { font-weight: 600; color: var(--brand-text); }
.xl-giftcard__balance {
    text-align: center;
    margin-top: 16px;
    padding: 14px;
    background: rgba(34,197,94,0.08);
    border-radius: var(--brand-radius-sm);
}
.xl-giftcard__balance-label {
    font-size: 12px;
    color: var(--brand-text-muted);
}
.xl-giftcard__balance-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-success);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 400px) {
    .xl-hero__stats { flex-direction: column; align-items: stretch; }
    .xl-hero__points-circle { margin: 0 auto; }
    .xl-grid-2 { grid-template-columns: 1fr; }
    .xl-stat-pills { flex-direction: column; }
}

@media (min-width: 768px) {
    .xl-main { padding: 28px 24px 40px; }
    .xl-bottomnav { display: none; }
    body { padding-bottom: 0; }
}
