/* BrilliantPay – Color palette inspired by Brilliant Driving School logo
   Red (header): #C41E3A
   Deep Navy:    #0B2545
   Road Yellow:  #F5C518
   Clean White / Light Gray backgrounds
*/

:root {
    --bds-red: #C41E3A;
    --bds-navy: #0B2545;
    --bds-navy-light: #163A5F;
    --bds-yellow: #F5C518;
    --bds-yellow-dark: #D4A017;
    --bds-white: #FFFFFF;
    --bds-light: #F4F7FA;
    --bds-gray: #6C7A89;
    --sidebar-width: 260px;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bds-light);
    color: #1a1a1a;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bds-navy) 0%, #071a30 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.25s ease;
    box-shadow: 3px 0 15px rgba(0,0,0,0.15);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-left: 1rem;
    padding-right: 1rem;
}

.logo-img {
    max-width: 90px;
    height: auto;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.nav-section-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    padding: 0.4rem 1rem 0.2rem;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    margin-bottom: 2px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar .nav-link.active {
    background: var(--bds-red);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.35);
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Page content offset */
#page-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ---------- Cards & UI ---------- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(11, 37, 69, 0.07);
}

.card-header {
    background: white;
    border-bottom: 1px solid #edf0f5;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

.stat-card {
    border-left: 4px solid var(--bds-red);
    transition: transform 0.15s;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-card.bank {
    border-left-color: var(--bds-navy);
}
.stat-card.mobile {
    border-left-color: var(--bds-yellow-dark);
}

.btn-primary {
    background-color: var(--bds-red);
    border-color: var(--bds-red);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #a01830;
    border-color: #a01830;
}

.btn-navy {
    background-color: var(--bds-navy);
    border-color: var(--bds-navy);
    color: white;
}
.btn-navy:hover {
    background-color: var(--bds-navy-light);
    color: white;
}

.btn-outline-yellow {
    border-color: var(--bds-yellow);
    color: var(--bds-navy);
}
.btn-outline-yellow:hover {
    background: var(--bds-yellow);
    color: var(--bds-navy);
}

.text-primary-dark {
    color: var(--bds-navy) !important;
}

.badge-bank {
    background-color: var(--bds-navy);
}
.badge-mobile {
    background-color: var(--bds-yellow-dark);
    color: #1a1a1a;
}

/* ---------- Auth pages ---------- */
.auth-wrapper {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bds-navy) 0%, #0a1f3a 50%, var(--bds-red) 150%);
    padding: 1.5rem;
    position: relative;
    isolation: isolate;
}

.auth-wrapper *,
.auth-wrapper *::before,
.auth-wrapper *::after {
    box-sizing: border-box;
}

.auth-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(135deg, rgba(11, 37, 69, 0.28), rgba(7, 26, 48, 0.48)),
        var(--auth-background-image);
    background-position: center;
    background-size: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.auth-wrapper.has-background-image::before {
    opacity: 0.55;
}

.auth-background-control {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    background: rgba(11, 37, 69, 0.6);
    color: white;
    font-size: 1.4rem;
    transform: translateY(-50%);
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.auth-background-control:hover:not(:disabled),
.auth-background-control:focus-visible {
    background: var(--bds-red);
}

.auth-background-control:disabled {
    cursor: default;
    opacity: 0.4;
}

.auth-background-previous {
    left: 1.5rem;
}

.auth-background-next {
    right: 1.5rem;
}

.auth-card {
    width: min(100%, 420px);
    max-width: 420px;
    position: relative;
    z-index: 1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

.auth-header {
    background: var(--bds-red);
    padding: 1.5rem;
    text-align: center;
    color: white;
}

.auth-header img {
    display: block;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 10px;
    padding: 6px;
    margin: 0 auto 0.75rem;
    object-fit: contain;
}

.auth-header .auth-brand-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
}

.auth-header .auth-brand-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    opacity: 0.85;
}

.auth-body {
    background: white;
    padding: 1.75rem;
}

.auth-body .auth-title {
    margin: 0 0 1.25rem;
    color: var(--bds-navy);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.auth-form {
    margin: 0;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.375rem;
    color: #263445;
    font-size: 0.925rem;
    font-weight: 500;
}

.auth-input-group {
    display: flex;
    width: 100%;
    min-height: 44px;
}

.auth-input-icon {
    display: flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid #ced4da;
    border-right: 0;
    border-radius: 6px 0 0 6px;
    background: #f8f9fa;
    color: var(--bds-navy);
}

.auth-input {
    display: block;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    min-height: 44px;
    padding: 0.625rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0 6px 6px 0;
    background: white;
    color: #212529;
    font: inherit;
    line-height: 1.5;
}

.auth-input::placeholder {
    color: #6c757d;
    opacity: 1;
}

.auth-input:focus {
    position: relative;
    z-index: 1;
    border-color: var(--bds-red);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(196, 30, 58, 0.2);
}

.auth-submit-wrap {
    display: grid;
    margin: 1.25rem 0 1rem;
}

.auth-submit {
    min-height: 46px;
    padding: 0.625rem 1rem;
    border: 1px solid var(--bds-red);
    border-radius: 7px;
    background: var(--bds-red);
    color: white;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-submit:hover,
.auth-submit:focus-visible {
    border-color: #a01830;
    background: #a01830;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
}

.auth-links a {
    color: #0d6efd;
    text-decoration: none;
}

.auth-links a:hover,
.auth-links a:focus-visible {
    text-decoration: underline;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bds-red);
    box-shadow: 0 0 0 0.2rem rgba(196, 30, 58, 0.2);
}

.temp-password-box {
    background: #fff8e1;
    border: 2px dashed var(--bds-yellow-dark);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--bds-navy);
    letter-spacing: 1px;
}

/* Table */
.table thead th {
    background: var(--bds-navy);
    color: white;
    font-weight: 500;
    border: none;
    white-space: nowrap;
}
.table-hover tbody tr:hover {
    background-color: rgba(196, 30, 58, 0.04);
}

/* Receipt thumbnail */
.receipt-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: transform 0.15s;
}
.receipt-thumb:hover {
    transform: scale(1.8);
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.welcome-panel {
    color: var(--bds-navy);
    padding: 0.5rem 0;
}

.welcome-date {
    color: var(--bds-red);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.welcome-panel h2 {
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    margin: 0.25rem 0;
}

.welcome-role {
    color: var(--bds-navy-light);
    font-size: 0.85rem;
}

.welcome-attention {
    border-top: 2px dashed rgba(11, 37, 69, 0.15);
    margin-top: 1rem;
    padding-top: 0.85rem;
}

.welcome-attention h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.welcome-attention-card {
    align-items: center;
    background: white;
    border: 1px solid rgba(11, 37, 69, 0.16);
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    min-height: 4rem;
    padding: 1rem 1.15rem;
}

.login-loading-overlay {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 2000;
}

.login-loading-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.login-loading-content {
    color: var(--bds-navy);
    max-width: 20rem;
    padding: 1.5rem;
    text-align: center;
    width: 80%;
}

.login-loading-content img {
    display: block;
    height: 4rem;
    margin: 0 auto 0.75rem;
    object-fit: contain;
}

.login-loading-track {
    background: rgba(11, 37, 69, 0.12);
    border-radius: 999px;
    height: 0.5rem;
    margin-top: 1rem;
    overflow: hidden;
}

.login-loading-progress {
    animation: login-progress 1.25s ease-in-out infinite;
    background: linear-gradient(90deg, var(--bds-red), var(--bds-yellow), var(--bds-navy));
    border-radius: inherit;
    height: 100%;
    transform-origin: left;
    width: 100%;
}

@keyframes login-progress {
    0% { transform: scaleX(0); }
    55% { transform: scaleX(0.72); }
    100% { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
    .login-loading-progress {
        animation: none;
    }
}

.background-music-control {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
}

/* Mobile responsive */
@media (max-width: 767.98px) {
    .auth-wrapper {
        padding: 3.5rem 1rem 1rem;
    }
    .auth-background-previous {
        top: 0.75rem;
        left: 0.75rem;
    }
    .auth-background-next {
        top: 0.75rem;
        right: 0.75rem;
    }
    .auth-background-previous,
    .auth-background-next {
        transform: none;
    }
    .auth-background-control {
        width: 2.5rem;
        height: 2.5rem;
    }
    .auth-body {
        padding: 1.25rem;
    }
    .auth-header {
        padding: 1.25rem;
    }
    .auth-input,
    .auth-input-group {
        min-height: 42px;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    #page-content {
        margin-left: 0;
    }
}
