:root {
    --brand-primary: #FF1E2D;
    --brand-primary-dark: #cf0f1b;
    --brand-secondary: #000000;

    --login-card-max: 400px;
    --login-pad: clamp(24px, 6vw, 40px);
    --login-input-h: 50px;
    --login-radius: 14px;
}

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

html,
body {
    height: 100%;
}

body.login-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--brand-secondary);
    color: #111;
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------------------
   Animated background (ambient CSS color glows)
--------------------------------------------------------------------------- */

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg-base {
    position: absolute;
    inset: 0;
    background: linear-gradient(170deg, #000000 0%, #060002 55%, #120006 100%);
}

.login-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
}

.login-glow--1 {
    top: -14%;
    left: -10%;
    width: 58vmax;
    max-width: 780px;
    height: 58vmax;
    max-height: 780px;
    background: radial-gradient(circle, rgba(255, 30, 45, 0.5) 0%, rgba(255, 30, 45, 0) 62%);
    filter: blur(80px);
    animation: ambientGlow1 18s ease-in-out infinite alternate;
}

.login-glow--2 {
    right: -8%;
    bottom: -10%;
    width: 42vmax;
    max-width: 560px;
    height: 42vmax;
    max-height: 560px;
    background: radial-gradient(circle, rgba(255, 30, 45, 0.42) 0%, rgba(255, 30, 45, 0) 60%);
    filter: blur(70px);
    animation: ambientGlow2 14s ease-in-out infinite alternate;
}

.login-glow--3 {
    top: 50%;
    left: 50%;
    width: 62vmax;
    max-width: 860px;
    height: 48vmax;
    max-height: 660px;
    background: radial-gradient(ellipse at center, rgba(110, 8, 18, 0.4) 0%, rgba(110, 8, 18, 0) 65%);
    filter: blur(60px);
    animation: ambientGlow3 24s ease-in-out infinite alternate;
}

.login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 90% at 50% 38%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
}

@keyframes ambientGlow1 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.55;
    }
    50% {
        transform: translate3d(3%, 4%, 0) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translate3d(-2%, -3%, 0) scale(0.95);
        opacity: 0.5;
    }
}

@keyframes ambientGlow2 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate3d(-4%, -3%, 0) scale(0.92);
        opacity: 0.72;
    }
    100% {
        transform: translate3d(2%, 2%, 0) scale(1.06);
        opacity: 0.45;
    }
}

@keyframes ambientGlow3 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate3d(-2%, 2%, 0) scale(1.12);
        opacity: 0.85;
    }
    100% {
        transform: translate3d(2%, -1%, 0) scale(0.96);
        opacity: 0.55;
    }
}

/* ---------------------------------------------------------------------------
   Login shell + card
--------------------------------------------------------------------------- */

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px) 16px;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: var(--login-card-max);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: var(--login-pad) var(--login-pad) calc(var(--login-pad) - 4px);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6), 0 10px 26px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), #ff5a64 45%, var(--brand-secondary));
}

.sm-login-logo {
    display: block;
    width: 88px;
    height: 88px;
    margin: 0 auto 22px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.login-heading {
    text-align: center;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: #6b7078;
    margin-bottom: 24px;
}

/* ---------------------------------------------------------------------------
   Error / validation alert
--------------------------------------------------------------------------- */

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff1f2;
    border: 1px solid #ffd5d8;
    border-left: 3px solid var(--brand-primary);
    color: #a30f1b;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.45;
}

.login-alert svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--brand-primary);
}

/* ---------------------------------------------------------------------------
   Form
--------------------------------------------------------------------------- */

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

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1b1f24;
    margin-bottom: 8px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9aa0a8;
    pointer-events: none;
    transition: color 0.16s ease;
}

.input-control {
    width: 100%;
    min-height: var(--login-input-h);
    padding: 12px 14px;
    padding-left: 46px;
    font-size: 16px;
    color: #111;
    background: #fbfcfd;
    border: 1.5px solid #e2e5ea;
    border-radius: var(--login-radius);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
    appearance: none;
    -webkit-appearance: none;
}

.input-control.has-suffix {
    padding-right: 52px;
}

.input-control::placeholder {
    color: #a8adb5;
}

.input-control:hover {
    border-color: #cfd3da;
}

.input-group:focus-within .input-control {
    border-color: var(--brand-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 30, 45, 0.14);
}

.input-group:focus-within .input-icon {
    color: var(--brand-primary);
}

.input-suffix {
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 42px;
    min-height: 42px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    color: #7d828a;
    transition: color 0.16s ease, background 0.16s ease;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.password-toggle:hover {
    color: #2b2f36;
    background: rgba(0, 0, 0, 0.05);
}

.password-toggle:focus-visible {
    outline: none;
    color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(255, 30, 45, 0.4);
}

.password-toggle .icon-eye-open {
    display: block;
}

.password-toggle .icon-eye-closed {
    display: none;
}

.password-toggle.is-visible .icon-eye-open {
    display: none;
}

.password-toggle.is-visible .icon-eye-closed {
    display: block;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border: none;
    border-radius: var(--login-radius);
    cursor: pointer;
    box-shadow: 0 10px 20px -6px rgba(255, 30, 45, 0.5);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-login:hover {
    background: linear-gradient(135deg, #e80f1d, #b8000d);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -6px rgba(255, 30, 45, 0.55);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px -6px rgba(255, 30, 45, 0.5);
}

.btn-login:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(255, 30, 45, 0.7);
}

.login-footer {
    text-align: center;
    margin-top: 16px;
    padding: 0 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.66);
}

/* ---------------------------------------------------------------------------
   Small screens
--------------------------------------------------------------------------- */

@media (max-width: 480px) {
    .sm-login-logo {
        width: 76px;
        height: 76px;
    }

    .login-glow--1 {
        filter: blur(60px);
    }

    .login-glow--2 {
        filter: blur(50px);
    }

    .login-glow--3 {
        filter: blur(45px);
    }
}

/* ---------------------------------------------------------------------------
   Reduced motion
--------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .login-glow--1,
    .login-glow--2,
    .login-glow--3 {
        animation: none;
    }

    .login-card,
    .btn-login,
    .input-control,
    .password-toggle,
    .input-icon {
        transition: none;
    }
}