:root {
    color-scheme: dark;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #050816;
    color: #e2e8f0;
}
* {
    box-sizing: border-box;
}
body,
html {
    margin: 0;
    min-height: 100%;
}
body {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.15), transparent 24%),
                radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 30%),
                linear-gradient(180deg, #020617 0%, #090f1e 100%);
    color: #e2e8f0;
}
body::before {
    content: "";
    position: fixed;
    left: 50%;
    top: 10%;
    transform: translateX(-50%);
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 42%);
    pointer-events: none;
    opacity: 0.85;
    z-index: 0;
}
.login-background {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}
.login-card,
.welcome-card {
    position: relative;
    width: min(100%, 560px);
    padding: 44px;
    border-radius: 34px;
    background: rgba(10, 18, 35, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: 0 50px 120px rgba(2, 10, 25, 0.55);
    backdrop-filter: blur(18px);
    overflow: visible;
    z-index: 1;
}
.login-card::before,
.welcome-card::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -70px;
    width: 240px;
    height: 240px;
    background: rgba(59, 130, 246, 0.18);
    border-radius: 50%;
    filter: blur(24px);
    z-index: -1;
    pointer-events: none;
}
.login-card::after,
.welcome-card::after {
    content: "";
    position: absolute;
    bottom: -70px;
    left: -70px;
    width: 220px;
    height: 220px;
    background: rgba(16, 185, 129, 0.16);
    border-radius: 50%;
    filter: blur(22px);
    z-index: -1;
    pointer-events: none;
}
.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    color: #f8fafc;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.brand-dot {
    width: 14px;
    height: 14px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.26);
}
.login-card h1,
.welcome-card h1 {
    margin: 0 0 10px;
    font-size: clamp(2.6rem, 4vw, 3.2rem);
    letter-spacing: -0.05em;
    line-height: 1.02;
}
.login-card p,
.welcome-card p {
    margin: 0 0 28px;
    color: #cbd5e1;
    opacity: 0.88;
    line-height: 1.85;
    font-size: 1rem;
}
.button-grid {
    display: grid;
    gap: 16px;
}
.button,
.button-secondary,
.button-accent {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 54px;
    padding: 0 22px;
    border-radius: 16px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}
.button {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    box-shadow: 0 18px 35px rgba(16, 185, 129, 0.24);
}
.button:hover,
.button-secondary:hover,
.button-accent:hover {
    transform: translateY(-2px);
}
.button-secondary {
    color: #fff;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.26);
}
.button:disabled,
.button-secondary:disabled,
.button-accent:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.button-accent {
    color: #fff;
    background: #0ea5e9;
}
.form-field {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}
.form-field label {
    font-size: 0.95rem;
    color: #94a3b8;
}
.form-field input {
    width: 100%;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(9, 16, 33, 0.88);
    color: #f8fafc;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.form-field input::placeholder {
    color: rgba(203, 213, 225, 0.65);
}
.form-field input:focus {
    border-color: rgba(59, 130, 246, 0.72);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    transform: translateY(-1px);
}
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    width: fit-content;
    animation: role-badge-in 0.18s ease;
}
.role-badge--admin {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.role-badge--cashier {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
@keyframes role-badge-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
/* The class rules above (and .forgot-disabled / .login-footer a below) each
   set an explicit `display`, which outranks the UA stylesheet's `[hidden] {
   display: none }` rule on specificity alone — so the hidden attribute was
   silently losing. These ID-scoped overrides win instead. */
#role-badge[hidden],
#forgot-link[hidden],
#cashier-note[hidden] {
    display: none;
}
.password-field {
    position: relative;
}
.password-field input {
    padding-right: 50px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.toggle-password {
    position: absolute;
    right: 18px;
    top: 38px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.1rem;
    transition: color 0.3s ease, transform 0.2s ease;
}
.toggle-password:hover {
    color: #3b82f6;
    transform: scale(1.1);
}
.toggle-password:active {
    transform: scale(0.95);
}
.checkbox-field {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: #cbd5e1;
}
.checkbox-field input {
    accent-color: #3b82f6;
}
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.small-link {
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.95rem;
}
.small-link:hover {
    text-decoration: underline;
}
.forgot-link {
    color: #fbbf24;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}
.forgot-link:hover {
    text-decoration: underline;
    color: #fcd34d;
}
.status-message,
.error-message {
    margin-bottom: 22px;
    padding: 16px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
}
.status-message {
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.22);
}
.error-message {
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.22);
}
.field-error {
    color: #fecaca;
    font-size: 0.9rem;
}
.login-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: #94a3b8;
    font-size: 0.95rem;
    position: relative;
    z-index: 10;
}
.login-footer a {
    color: #93c5fd;
    text-decoration: none;
    position: relative;
    z-index: 10;
    cursor: pointer;
    display: inline-block;
    padding: 4px 0;
}
.login-footer a:hover {
    text-decoration: underline;
}
.login-footer a:active {
    opacity: 0.7;
}
@media (max-width: 680px) {
    .login-card,
    .welcome-card {
        padding: 32px 26px;
    }

    .login-card h1,
    .welcome-card h1 {
        font-size: 2.3rem;
    }

    .login-footer {
        flex-direction: column;
        align-items: stretch;
    }
}
