/* ─── AppTest — Custom CSS ──────────────────────────────────────────────────
   No frameworks. Pure CSS with CSS variables for theming.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
    --green:        #1D9E75;
    --green-dark:   #157A5A;
    --green-light:  #E1F5EE;
    --amber:        #BA7517;
    --amber-light:  #FAEEDA;
    --red:          #C0392B;
    --red-light:    #FCEBEB;
    --blue:         #185FA5;
    --blue-light:   #E6F1FB;

    --bg:           #FAFAF8;
    --surface:      #FFFFFF;
    --border:       #E8E6DF;
    --border-light: #F1EFE8;

    --text:         #1A1A18;
    --text-muted:   #6B6A66;
    --text-light:   #9B9A96;

    --radius:       10px;
    --radius-sm:    6px;
    --radius-lg:    14px;

    --shadow:       0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
    --shadow-sm:    0 1px 3px rgba(0,0,0,.06);

    --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sidebar-w:    220px;
    --navbar-h:     58px;
}

/* ── Dark Mode Variables ──────────────────────────────────────────────────── */
[data-theme="dark"] {
    --green:        #22C98E;
    --green-dark:   #1AA876;
    --green-light:  #0D3326;
    --amber:        #E09A2B;
    --amber-light:  #3A2A0A;
    --red:          #E05252;
    --red-light:    #3A1212;
    --blue:         #4A9EE0;
    --blue-light:   #0D2A3A;

    --bg:           #0F1117;
    --surface:      #1A1D27;
    --border:       #2E3140;
    --border-light: #252836;

    --text:         #E8E9EF;
    --text-muted:   #9095A8;
    --text-light:   #5C6070;

    --shadow:       0 1px 4px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
}

/* ── Dark Mode Toggle Button ─────────────────────────────────────────────── */
.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: none; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-muted); transition: all .18s ease;
    flex-shrink: 0;
}
.theme-toggle:hover { background: var(--border-light); color: var(--text); border-color: var(--green); }
.theme-toggle svg { width: 16px; height: 16px; transition: transform .3s ease; }
.theme-toggle:hover svg { transform: rotate(20deg); }
.theme-icon-sun  { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun  { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Typography ───────────────────────────────────────────────────────────── */
h1 { font-size: 2rem;   font-weight: 600; letter-spacing: -.5px; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.3px; }
h3 { font-size: 1.1rem; font-weight: 500; }
h4 { font-size: .95rem; font-weight: 500; }
p  { color: var(--text-muted); }
small { font-size: .8rem; color: var(--text-light); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 500; font-family: var(--font);
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text); cursor: pointer; transition: all .18s ease;
    text-decoration: none; line-height: 1;
}
.btn:hover { background: var(--border-light); text-decoration: none; }
.btn-primary  { background: var(--green);  color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-danger   { background: var(--red);   color: #fff; border-color: var(--red); }
.btn-danger:hover { opacity: .88; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .82rem; font-weight: 500; color: var(--text-muted); margin-bottom: 5px; }
.form-control {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .9rem; font-family: var(--font); color: var(--text);
    background: var(--surface); transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,158,117,.12); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }
.form-error { font-size: .8rem; color: var(--red); margin-top: 4px; }
.form-hint  { font-size: .8rem; color: var(--text-light); margin-top: 4px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}
.card-title { font-size: 1rem; font-weight: 600; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: .73rem; font-weight: 500; letter-spacing: .2px;
}
.badge-green  { background: var(--green-light);  color: #0A5C42; }
.badge-amber  { background: var(--amber-light);  color: #7A4E0B; }
.badge-red    { background: var(--red-light);    color: #891F1F; }
.badge-blue   { background: var(--blue-light);   color: #0D4A88; }
.badge-gray   { background: var(--border-light); color: var(--text-muted); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 16px; }
.alert-success { background: var(--green-light); color: #0A5C42; border-left: 4px solid var(--green); }
.alert-error   { background: var(--red-light);   color: #891F1F; border-left: 4px solid var(--red); }
.alert-warning { background: var(--amber-light);  color: #7A4E0B; border-left: 4px solid var(--amber); }
.alert-info    { background: var(--blue-light);   color: #0D4A88; border-left: 4px solid var(--blue); }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--navbar-h); background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

/* LEFT — brand */
.navbar-brand {
    font-size: 1.2rem; font-weight: 700; letter-spacing: -.4px;
    color: var(--text);
    display: flex; align-items: center;
    white-space: nowrap;
    text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-brand span { color: var(--green); }

/* CENTER — nav links */
.navbar-links {
    display: flex; align-items: center; justify-content: center;
    gap: 4px;
}
.navbar-links a {
    font-size: .875rem; color: var(--text-muted); font-weight: 500;
    padding: 6px 12px; border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.navbar-links a:hover { color: var(--green); background: var(--green-light); text-decoration: none; }
.navbar-links a.active {
    color: var(--green);
    background: var(--green-light);
    font-weight: 600;
}

/* RIGHT — actions */
.navbar-right {
    display: flex; align-items: center; gap: 8px;
    justify-content: flex-end;
}

/* User section */
.navbar-user {
    display: flex; align-items: center; gap: 8px;
}
.navbar-username {
    font-size: .875rem; font-weight: 500;
    max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Avatar */
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--green); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 600;
    flex-shrink: 0;
}

/* Divider between user info and action buttons */
.navbar-user-divider {
    width: 1px; height: 22px;
    background: var(--border);
    flex-shrink: 0;
}

/* ── Navbar Bell ──────────────────────────────────────────────────────────── */
.navbar-bell {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: none;
    color: var(--text-muted);
    text-decoration: none;
    transition: all .18s ease;
    flex-shrink: 0;
}
.navbar-bell:hover { background: var(--border-light); color: var(--green); border-color: var(--green); text-decoration: none; }
.navbar-bell-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    background: var(--red);
    color: #fff;
    font-size: .65rem; font-weight: 700;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--surface);
    line-height: 1;
    pointer-events: none;
}

/* ── Hamburger button ─────────────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column; justify-content: center; align-items: center;
    gap: 5px; width: 38px; height: 38px;
    background: none; border: none; cursor: pointer;
    padding: 4px; border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.hamburger:hover { background: var(--border-light); }
.hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
    transform-origin: center;
}
/* Animated X when active */
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sidebar overlay (mobile) ─────────────────────────────────────────────── */
.sidebar-overlay {
    position: fixed; inset: 0; z-index: 149;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Sidebar profile bar (visible only on mobile) ────────────────────────── */
.sidebar-profile-bar {
    display: none;
    align-items: center; gap: 12px;
    padding: 16px 20px 12px;
}
.sidebar-profile-info { flex: 1; min-width: 0; }
.sidebar-profile-name { font-size: .9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile-email { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile-actions {
    display: none;
    gap: 8px; padding: 0 16px 12px;
}
.sidebar-profile-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--radius-sm);
    font-size: .82rem; font-weight: 500; font-family: var(--font);
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text); cursor: pointer; text-decoration: none;
    transition: all .15s ease; white-space: nowrap;
}
.sidebar-profile-btn:hover { background: var(--border-light); text-decoration: none; }
.sidebar-logout-btn { color: var(--red); border-color: var(--red-light); background: var(--red-light); }
.sidebar-logout-btn:hover { background: var(--red); color: #fff; }
.sidebar-profile-divider { border: none; border-top: 1px solid var(--border-light); margin: 0 0 8px; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.layout { display: flex; padding-top: var(--navbar-h); min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--surface); border-right: 1px solid var(--border);
    position: fixed; top: var(--navbar-h); left: 0; bottom: 0;
    overflow-y: auto; padding: 16px 0;
}
.sidebar-section { padding: 8px 16px; font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .6px; color: var(--text-light); margin-top: 8px; }
.sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px; font-size: .875rem; color: var(--text-muted);
    cursor: pointer; transition: all .15s; text-decoration: none;
    border-left: 3px solid transparent;
}
.sidebar-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.sidebar-item.active { background: var(--green-light); color: var(--green-dark);
    border-left-color: var(--green); font-weight: 500; }
.sidebar-icon { width: 18px; text-align: center; font-size: .95rem; }

/* ── Main content area ────────────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; padding: 28px; min-height: calc(100vh - var(--navbar-h)); }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.4rem; }
.page-header p  { font-size: .88rem; color: var(--text-muted); margin-top: 4px; }

/* ── Stats grid ───────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -.5px; color: var(--text); }
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.stat-card.green { border-left: 4px solid var(--green); }
.stat-card.amber { border-left: 4px solid var(--amber); }
.stat-card.blue  { border-left: 4px solid var(--blue); }
.stat-card.red   { border-left: 4px solid var(--red); }

/* ── Table ────────────────────────────────────────────────────────────────── */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.table-card-header { display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid var(--border-light); }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 11px 16px; text-align: left; font-size: .77rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted);
    background: var(--bg); border-bottom: 1px solid var(--border); }
tbody td { padding: 13px 16px; font-size: .875rem; border-bottom: 1px solid var(--border-light); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress { background: var(--border-light); border-radius: 20px; height: 7px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--green); border-radius: 20px; transition: width .4s ease; }
.progress-bar.amber { background: var(--amber); }

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--green-light) 0%, var(--bg) 60%); }
.auth-card { background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 36px 40px; width: 100%; max-width: 440px;
    box-shadow: var(--shadow); }
.auth-logo { font-size: 1.4rem; font-weight: 700; letter-spacing: -.4px;
    color: var(--text); margin-bottom: 24px; text-align: center; }
.auth-logo span { color: var(--green); }
.auth-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }
.auth-subtitle { font-size: .88rem; color: var(--text-muted); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-muted); }

/* ── Payment box ──────────────────────────────────────────────────────────── */
.payment-summary { background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; margin-top: 20px; }
.payment-row { display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; font-size: .9rem; }
.payment-row.total { border-top: 1px solid var(--border); margin-top: 8px;
    padding-top: 12px; font-weight: 600; font-size: 1rem; }
.razorpay-badge { display: flex; align-items: center; gap: 6px;
    font-size: .78rem; color: var(--text-light); justify-content: center; margin-top: 10px; }

/* ── Star rating ──────────────────────────────────────────────────────────── */
.star-rating { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.star-rating input { display: none; }
.star-rating label { font-size: 1.5rem; color: var(--border); cursor: pointer; transition: color .15s; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: #F5A623; }

/* ── App card (tester available apps) ────────────────────────────────────── */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.app-card { background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; transition: box-shadow .2s; }
.app-card:hover { box-shadow: var(--shadow); }
.app-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.app-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--green-light);
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.app-name { font-weight: 600; font-size: .95rem; }
.app-category { font-size: .78rem; color: var(--text-muted); }
.app-earn { font-size: .85rem; font-weight: 600; color: var(--green); }
.spots-left { font-size: .78rem; color: var(--text-muted); }

/* ── Wallet ───────────────────────────────────────────────────────────────── */
.wallet-hero { background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    border-radius: var(--radius-lg); padding: 28px; color: #fff; margin-bottom: 20px; }
.wallet-balance-label { font-size: .85rem; opacity: .8; margin-bottom: 4px; }
.wallet-balance-amount { font-size: 2.5rem; font-weight: 700; letter-spacing: -1px; }
.wallet-total { font-size: .82rem; opacity: .75; margin-top: 4px; }

/* ── Landing page ─────────────────────────────────────────────────────────── */
.landing-hero { padding: 80px 24px 60px; text-align: center; max-width: 640px; margin: 0 auto; }
.landing-hero h1 { font-size: 2.6rem; margin-bottom: 16px; }
.landing-hero p  { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 28px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.section { padding: 48px 24px; max-width: 1100px; margin: 0 auto; }
.section-label { font-size: .82rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .7px; color: var(--green); margin-bottom: 8px; }
.section-title { font-size: 1.7rem; font-weight: 700; margin-bottom: 8px; }
.section-subtitle { font-size: 1rem; color: var(--text-muted); margin-bottom: 36px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.feature-card { background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px; }
.feature-icon { font-size: 1.8rem; margin-bottom: 12px; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; }
.how-step { text-align: center; padding: 20px; position: relative; }
.step-circle { width: 44px; height: 44px; border-radius: 50%; background: var(--green);
    color: #fff; font-weight: 700; font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.how-step:not(:last-child)::after { content: '→'; position: absolute; right: -8px; top: 30px;
    font-size: 1.2rem; color: var(--border); }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 6px; }  .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }.mb-2 { margin-bottom: 12px; }.mb-3 { margin-bottom: 20px; }
.gap-2 { gap: 8px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Navbar: collapse to flex on mobile */
    .navbar {
        display: flex;
        justify-content: space-between;
        padding: 0 16px;
        gap: 8px;
    }

    /* Show hamburger */
    .hamburger { display: flex; }

    /* Hide desktop nav links — remove from layout flow */
    .navbar-links { display: none; }

    /* Hide username text on mobile to save space */
    .navbar-username { display: none; }

    /* Hide divider on mobile */
    .navbar-user-divider { display: none; }

    /* Hide Profile/Logout buttons — keep avatar + name visible */
    .navbar-desktop-only { display: none !important; }

    /* Ensure theme toggle stays visible on mobile */
    .theme-toggle { display: flex; flex-shrink: 0; }

    /* Sidebar: hidden off-screen by default, slides in */
    .sidebar {
        display: flex !important;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        z-index: 150;
        box-shadow: 4px 0 24px rgba(0,0,0,.12);
        width: 280px;
    }
    .sidebar.sidebar-open { transform: translateX(0); }

    /* Show profile bar & actions inside sidebar on mobile */
    .sidebar-profile-bar { display: flex; }
    .sidebar-profile-actions { display: flex; }

    /* Main content full width */
    .main { margin-left: 0; padding: 16px; }

    /* Other responsive tweaks */
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .landing-hero h1 { font-size: 1.8rem; }
    .auth-card { padding: 24px 20px; margin: 16px; }
    table { font-size: .8rem; }
    thead th, tbody td { padding: 10px 10px; }
    .how-step:not(:last-child)::after { display: none; }
}
