:root {
    /* =========================================================
       BRAND
    ========================================================= */

    --navy: #07111f;
    --navy-2: #0d1b2e;

    --blue: #1769ff;
    --blue-dark: #0d55d9;

    /* =========================================================
       STATUS
    ========================================================= */

    --green: #16a36a;
    --red: #dc3545;
    --orange: #f59e0b;
    --purple: #6d4aff;

    /* =========================================================
       LIGHT THEME — SURFACES
    ========================================================= */

    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f4f8;

    /* =========================================================
       LIGHT THEME — TEXT
    ========================================================= */

    --text: #101828;
    --text-secondary: #344054;
    --muted: #667085;
    --placeholder: #98a2b3;

    /* =========================================================
       BORDERS
    ========================================================= */

    --border: #e6eaf0;
    --border-strong: #d5dce6;

    /* =========================================================
       INPUTS
    ========================================================= */

    --input-bg: #ffffff;

    /* =========================================================
       SOFT BRAND / STATUS SURFACES
    ========================================================= */

    --blue-soft: #eef4ff;
    --green-soft: #ecfaf4;
    --orange-soft: #fff7e7;
    --red-soft: #fff1f1;
    --gray-soft: #f2f4f7;
    --purple-soft: #f0ecff;

    /* =========================================================
       STATUS TEXT
    ========================================================= */

    --green-text: #08784b;
    --orange-text: #9a6800;
    --red-text: #c0392b;
    --gray-text: #667085;
    --purple-text: #6d4aff;

    /* =========================================================
       INFO
    ========================================================= */

    --info-bg: #eef5ff;
    --info-text: #23416c;

    /* =========================================================
       DARK / BRANDED SURFACES
    ========================================================= */

    --on-dark: #f4f7fb;
    --on-dark-muted: rgba(244, 247, 251, 0.68);

    --dark-overlay: rgba(7, 17, 31, 0.88);

    /* =========================================================
       EFFECTS
    ========================================================= */

    --shadow: 0 8px 30px rgba(7, 17, 31, 0.07);
    --shadow-sm: 0 3px 14px rgba(7, 17, 31, 0.04);

    /* =========================================================
       SHAPE
    ========================================================= */

    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    background: var(--bg);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

a {
    color: inherit;
    text-decoration: none;
}

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


/* =========================================================
   PASSENGER APP
========================================================= */

.passenger-app {
    width: 100%;
    min-height: 100vh;
    padding-bottom: 100px;
}


/* =========================================================
   PAGE
========================================================= */

.page {
    width: 100%;
    max-width: 760px;

    margin: 0 auto;
    padding: 18px;
}


/* =========================================================
   TOP BAR
========================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;
    max-width: 760px;
    height: 64px;

    margin: 0 auto;
    padding: 10px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: color-mix(in srgb, var(--surface) 97%, transparent);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.topbar .brand {
    display: flex;
    align-items: center;

    gap: 10px;

    flex: 0 0 auto;
}

.brand {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 10px;
}

.brand-name {
    margin: 0;

    font-size: 18px;
    line-height: 1;
    font-weight: 800;

    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    margin-left: auto;

    flex: 0 0 auto;
}


/* =========================================================
   BRAND MARK
========================================================= */

.profile-mark {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    border-radius: 13px;

    display: grid;
    place-items: center;

    background: var(--navy);
    color: var(--on-dark);

    font-size: 14px;
    font-weight: 800;
}


/* =========================================================
   ICON / BACK BUTTON
========================================================= */

.icon-button {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    margin: 0;
    padding: 0;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface);
    color: var(--text);

    display: grid;
    place-items: center;

    font-size: 22px;
    line-height: 1;

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.15s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.icon-button:hover {
    border-color: var(--border-strong);
}

.icon-button:active {
    transform: scale(0.94);
}

.topbar .menu-button,
.topbar-actions .icon-button {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
}


/* =========================================================
   TOPBAR TITLE
========================================================= */

.topbar-title {
    min-width: 0;
    flex: 1;

    display: flex;
    align-items: center;
}

.topbar-title h1 {
    margin: 0;

    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;

    letter-spacing: -0.3px;

    color: var(--text);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   GREETING
========================================================= */

.greeting {
    margin-top: 20px;
    margin-bottom: 20px;
}

.greeting small {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);

    font-size: 13px;
}

.greeting h1 {
    font-size: 26px;
    line-height: 1.15;

    letter-spacing: -0.6px;

    font-weight: 800;
}


/* =========================================================
   BALANCE CARD
========================================================= */

.balance-card {
    position: relative;
    overflow: hidden;

    padding: 24px;
    margin-bottom: 18px;

    border-radius: var(--radius-lg);

    background: var(--navy);
    color: var(--on-dark);

    box-shadow: var(--shadow);
}

.balance-card::after {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -70px;
    top: -80px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.06);
}

.balance-label {
    position: relative;
    z-index: 1;

    margin-bottom: 7px;

    color: var(--on-dark-muted);

    font-size: 13px;
}

.balance-amount {
    position: relative;
    z-index: 1;

    font-size: 34px;
    font-weight: 800;

    letter-spacing: -1px;
}

.balance-footer {
    position: relative;
    z-index: 1;

    margin-top: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.balance-action {
    border: 0;

    padding: 11px 16px;

    border-radius: var(--radius-sm);

    background: #ffffff;
    color: var(--navy);

    font-weight: 700;

    transition: transform 0.15s ease;
}

.balance-action:active {
    transform: scale(0.96);
}


/* =========================================================
   NUBCOR PASS CARD
========================================================= */

.nubcor-card {
    position: relative;
    min-height: 205px;

    overflow: hidden;

    padding: 24px;
    margin-bottom: 24px;

    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            135deg,
            #10233b,
            #07111f
        );

    color: var(--on-dark);

    box-shadow: var(--shadow);
}

.nubcor-card::before {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    right: -80px;
    bottom: -100px;

    border: 35px solid rgba(255, 255, 255, 0.05);

    border-radius: 50%;
}

.card-brand {
    position: relative;
    z-index: 1;

    font-size: 14px;
    font-weight: 800;

    letter-spacing: 1px;
}

.card-chip {
    position: relative;
    z-index: 1;

    width: 43px;
    height: 31px;

    margin-top: 34px;

    border-radius: 7px;

    background: #d8b96a;
}

.card-number {
    position: relative;
    z-index: 1;

    margin-top: 20px;

    font-size: 15px;

    letter-spacing: 2px;
}

.card-status {
    position: absolute;

    top: 20px;
    right: 20px;

    padding: 6px 9px;

    border-radius: 20px;

    background: rgba(22, 163, 106, 0.18);
    color: #5ce0a3;

    font-size: 11px;
    font-weight: 800;
}


/* =========================================================
   SECTIONS
========================================================= */

.section {
    margin-top: 26px;
}

.section-header,
.section-heading {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 12px;
}

.section-title,
.section-heading h2 {
    font-size: 17px;
    font-weight: 800;
}

.section-link {
    color: var(--blue);

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   QUICK ACTIONS
========================================================= */

.quick-actions {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;
}

.quick-action {
    width: 100%;
    min-height: 88px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 8px;

    color: var(--text);

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.15s ease,
        border-color 0.2s ease;
}

.quick-action:hover {
    border-color: var(--border-strong);
}

.quick-action:active {
    transform: scale(0.97);
}

.quick-icon {
    font-size: 22px;
    line-height: 1;
}

.quick-label {
    font-size: 11px;
    font-weight: 700;

    text-align: center;
}


/* =========================================================
   BUS CARD
========================================================= */

.bus-card {
    padding: 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);

    box-shadow: var(--shadow-sm);
}

.bus-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.bus-name {
    font-weight: 800;
}

.bus-status {
    color: var(--green);

    font-size: 12px;
    font-weight: 800;
}

.bus-route {
    margin-top: 6px;

    color: var(--muted);

    font-size: 13px;
}

.bus-meta {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-top: 16px;
    padding-top: 13px;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   TRANSACTIONS
========================================================= */

.transaction-list {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);
}

.transaction {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 15px;

    border-bottom: 1px solid var(--border);
}

.transaction:last-child {
    border-bottom: 0;
}

.transaction-icon {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    border-radius: 13px;

    display: grid;
    place-items: center;

    background: var(--blue-soft);
    color: var(--blue);
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-title {
    font-size: 13px;
    font-weight: 700;
}

.transaction-date {
    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}

.transaction-amount {
    font-size: 13px;
    font-weight: 800;

    white-space: nowrap;
}


/* =========================================================
   BOTTOM NAVIGATION
========================================================= */

.bottom-nav {
    position: fixed;
    z-index: 1000;

    left: 50%;
    bottom: 12px;

    transform: translateX(-50%);

    width: calc(100% - 24px);
    max-width: 600px;

    padding: 9px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 6px;

    background: color-mix(in srgb, var(--surface) 97%, transparent);

    border: 1px solid var(--border);
    border-radius: 20px;

    box-shadow:
        0 12px 40px rgba(7, 17, 31, 0.13);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}


/* =========================================================
   NAVIGATION ITEM
========================================================= */

.nav-item {
    width: 100%;
    min-height: 55px;

    border: 0;
    border-radius: 14px;

    background: transparent;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 4px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 700;

    text-align: center;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.nav-item:hover {
    color: var(--blue);
}

.nav-item.active {
    color: var(--blue);
    background: var(--blue-soft);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    display: block;

    font-size: 19px;
    line-height: 1;
}


/* =========================================================
   FORMS
========================================================= */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 13px;
    font-weight: 700;
}

.form-input {
    width: 100%;
    height: 50px;

    padding: 0 14px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--input-bg);
    color: var(--text);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-input::placeholder {
    color: var(--placeholder);
}

.form-input:focus {
    border-color: var(--blue);

    box-shadow:
        0 0 0 3px rgba(23, 105, 255, 0.12);
}

select.form-input {
    appearance: auto;
}

textarea.form-input {
    min-height: 120px;
    height: auto;

    padding-top: 13px;
    padding-bottom: 13px;

    resize: vertical;
}


/* =========================================================
   PRIMARY BUTTON
========================================================= */

.primary-button {
    width: 100%;
    min-height: 50px;

    border: 0;
    border-radius: 13px;

    background: var(--blue);
    color: var(--on-dark);

    font-weight: 800;

    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

.primary-button:hover {
    background: var(--blue-dark);
}

.primary-button:active {
    transform: scale(0.98);
}


/* =========================================================
   SECONDARY BUTTON
========================================================= */

.secondary-button {
    width: 100%;
    min-height: 50px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface);
    color: var(--text);

    font-weight: 800;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.secondary-button:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}


/* =========================================================
   NOTIFICATION BADGE
========================================================= */

#notificationButton {
    position: relative;
}

.notification-badge {
    position: absolute;

    top: -4px;
    right: -4px;

    min-width: 18px;
    height: 18px;

    padding: 0 5px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    background: var(--red);
    color: var(--on-dark);

    font-size: 10px;
    font-weight: 700;
    line-height: 1;

    border: 2px solid var(--navy);

    pointer-events: none;
}


/* =========================================================
   FOCUS
========================================================= */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(23, 105, 255, 0.25);
    outline-offset: 2px;
}


/* =========================================================
   DARK THEME
========================================================= */

html[data-theme="dark"] {
    --bg: #0b1220;

    --surface: #111a2a;
    --surface-2: #172235;
    --surface-3: #1d2a3d;

    --text: #e8edf5;
    --text-secondary: #c2cad6;
    --muted: #94a0b3;
    --placeholder: #6f7d91;

    --border: #263247;
    --border-strong: #34425a;

    --input-bg: #141f30;

    --blue-soft: #17284a;
    --green-soft: #123326;
    --orange-soft: #392c13;
    --red-soft: #351b1d;
    --gray-soft: #1c2533;
    --purple-soft: #29213f;

    --green-text: #5ce0a3;
    --orange-text: #f2c66d;
    --red-text: #ff8d86;
    --gray-text: #aab4c3;
    --purple-text: #b9a8ff;

    --info-bg: #142744;
    --info-text: #9fc1ff;

    --navy: #050b15;
    --navy-2: #0b1525;

    --shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 3px 14px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   SYSTEM DARK THEME
========================================================= */

@media (prefers-color-scheme: dark) {

    html[data-theme="system"] {
        --bg: #0b1220;

        --surface: #111a2a;
        --surface-2: #172235;
        --surface-3: #1d2a3d;

        --text: #e8edf5;
        --text-secondary: #c2cad6;
        --muted: #94a0b3;
        --placeholder: #6f7d91;

        --border: #263247;
        --border-strong: #34425a;

        --input-bg: #141f30;

        --blue-soft: #17284a;
        --green-soft: #123326;
        --orange-soft: #392c13;
        --red-soft: #351b1d;
        --gray-soft: #1c2533;
        --purple-soft: #29213f;

        --green-text: #5ce0a3;
        --orange-text: #f2c66d;
        --red-text: #ff8d86;
        --gray-text: #aab4c3;
        --purple-text: #b9a8ff;

        --info-bg: #142744;
        --info-text: #9fc1ff;

        --navy: #050b15;
        --navy-2: #0b1525;

        --shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
        --shadow-sm: 0 3px 14px rgba(0, 0, 0, 0.18);
    }
}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 430px) {

    .page {
        padding: 15px;
    }

    .topbar {
        height: 60px;
        padding: 9px 15px;
    }

    .topbar .menu-button,
    .topbar-actions .icon-button {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .topbar-title h1 {
        font-size: 19px;
    }

    .topbar .brand-name {
        font-size: 17px;
    }

    .icon-button {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        font-size: 21px;
    }

    .greeting {
        margin-top: 18px;
    }

    .greeting h1 {
        font-size: 24px;
    }

    .quick-actions {
        gap: 7px;
    }

    .quick-action {
        min-height: 82px;
        border-radius: 14px;
    }

    .quick-icon {
        font-size: 20px;
    }

    .quick-label {
        font-size: 10px;
    }

    .balance-card {
        padding: 21px;
    }

    .balance-amount {
        font-size: 30px;
    }

    .nubcor-card {
        min-height: 195px;
        padding: 21px;
    }

    .bottom-nav {
        bottom: 8px;

        width: calc(100% - 16px);

        padding: 8px;
        gap: 4px;

        border-radius: 18px;
    }

    .nav-item {
        min-height: 53px;

        border-radius: 13px;

        font-size: 10px;
    }

    .nav-icon {
        font-size: 18px;
    }
}


/* =========================================================
   TABLETS / DESKTOP
========================================================= */

@media (min-width: 768px) {

    .page {
        padding-top: 28px;
    }

    .topbar {
        height: 70px;
        padding: 12px 28px;
    }

    .topbar-title h1 {
        font-size: 21px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
