:root {
    --brand: #e62e04;
    --brand-light: #fff5f3;
    --green: #22c55e;
    --yellow: #f59e0b;
    --blue: #3b82f6;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    background: #f4f5f7;
}

/* ── PAGE LAYOUT ── */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── TOP BAR ── */
.login-topbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}

.login-topbar-logo {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -.3px;
    line-height: 1.1;
}

.login-topbar-logo span {
    color: #60a5fa;
}

.login-topbar-logo .sub {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, .4);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.login-topbar-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
    background: rgba(96, 165, 250, .15);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, .25);
}

/* ── MAIN AREA ── */
.login-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #f4f5f7 50%, #fff0ee 100%);
    position: relative;
    overflow: hidden;
}

/* Decorative background shapes */
.login-body::before,
.login-body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(230, 46, 4, .06) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.login-body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, .06) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
}

/* ── LOGIN CARD ── */
.login-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .10), 0 1px 4px rgba(0, 0, 0, .06);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: cardIn .35s ease;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── CARD HEADER ── */
.login-card-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    padding: 28px 32px 24px;
    text-align: center;
}

.login-card-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: rgba(96, 165, 250, .18);
    border: 2px solid rgba(96, 165, 250, .3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 14px;
}

.login-card-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.login-card-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, .5);
    font-weight: 500;
}

/* ── CARD BODY ── */
.login-card-body {
    padding: 28px 32px 24px;
}

/* ── SECURITY BADGE ── */
.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 22px;
    font-size: 12px;
    color: #15803d;
    font-weight: 600;
}

.security-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }
}

/* ── FORM ── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
    color: #9ca3af;
}

.form-control {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    padding: 11px 14px 11px 40px;
    font-size: 14px;
    color: #1a1a1a;
    background: #f9fafb;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}

.form-control:focus {
    border-color: #e62e04;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230, 46, 4, .08);
}

.form-control::placeholder {
    color: #c4c9d4;
}

/* Password toggle */
.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #9ca3af;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .15s;
    line-height: 1;
}

.pw-toggle:hover {
    color: #555;
}

/* Options row */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.remember-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.remember-wrap input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #e62e04;
    cursor: pointer;
}

.remember-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.forgot-link {
    font-size: 12px;
    font-weight: 700;
    color: #e62e04;
    text-decoration: none;
    transition: opacity .15s;
}

.forgot-link:hover {
    opacity: .75;
}

/* ── SUBMIT BUTTON ── */
.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #e62e04 0%, #c72503 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: .02em;
    transition: all .18s;
    box-shadow: 0 4px 14px rgba(230, 46, 4, .3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #c72503 0%, #a81f02 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(230, 46, 4, .35);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login.loading {
    opacity: .75;
    pointer-events: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-login.loading .spinner {
    display: block;
}

.btn-login.loading .btn-text {
    display: none;
}

/* ── DIVIDER ── */
.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #f0f0f0;
}

.divider-text {
    font-size: 11px;
    font-weight: 600;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── 2FA / BACKUP ── */
.alt-action {
    text-align: center;
    font-size: 12px;
    color: #888;
}

.alt-action a {
    color: #e62e04;
    font-weight: 700;
    text-decoration: none;
}

.alt-action a:hover {
    text-decoration: underline;
}

/* ── CARD FOOTER ── */
.login-card-footer {
    border-top: 1px solid #f5f5f5;
    padding: 14px 32px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-meta {
    font-size: 11px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-meta strong {
    color: #777;
}

.footer-links {
    display: flex;
    gap: 12px;
}

.footer-links a {
    font-size: 11px;
    color: #aaa;
    text-decoration: none;
    font-weight: 600;
    transition: color .15s;
}

.footer-links a:hover {
    color: #555;
}

/* ── ERROR STATE ── */
.error-msg {
    display: none;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #b91c1c;
    margin-bottom: 16px;
    align-items: center;
    gap: 8px;
}

.error-msg.show {
    display: flex;
}

/* ── BOTTOM NOTICE ── */
.login-notice {
    text-align: center;
    margin-top: 20px;
    font-size: 11px;
    color: #aaa;
    position: relative;
    z-index: 1;
}

/* ── TOAST ── */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .22);
    min-width: 200px;
    max-width: 340px;
    cursor: pointer;
    animation: slideInToast .25s ease;
}

@keyframes slideInToast {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

.toast.info {
    background: #2563eb;
}

.toast.warning {
    background: #d97706;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .login-card-body {
        padding: 22px 20px 18px;
    }

    .login-card-footer {
        padding: 12px 20px;
    }

    .login-card-header {
        padding: 22px 20px 18px;
    }

    .login-topbar {
        padding: 12px 16px;
    }
}