:root {
    --auth-blue: #0D48C7;
    --auth-blue-light: #4ED8FF;
    --auth-red: #D7192A;
    --auth-red-light: #FF4A62;
    --auth-bg: #0A0D18;
    --auth-card: rgba(28, 29, 43, .58);
    --auth-card-dark: rgba(12, 13, 22, .76);
    --auth-text: #FFFFFF;
    --auth-muted: #B9C2D6;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--auth-bg);
}

body {
    overflow: hidden;
}

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(7, 13, 28, .98) 0%, rgba(15, 17, 31, .98) 48%, rgba(6, 8, 15, .98) 100%);
}

.auth-page::before {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(255,255,255,.045), transparent 30%, transparent 72%, rgba(255,255,255,.025)),
        radial-gradient(circle at 50% 45%, rgba(255,255,255,.045), transparent 38%);
    opacity: .85;
}

.auth-page::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black 0%, transparent 72%);
    opacity: .42;
}

.auth-grid {
    position: absolute;
    inset: 0;
    opacity: .08;
    background-image:
        linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at center, black 0%, transparent 74%);
}

.auth-glow,
.auth-glow-blue,
.auth-glow-red {
    display: none !important;
}

.auth-ray {
    position: absolute;
    pointer-events: none;
    width: 360px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(78,216,255,.30), transparent);
    filter: blur(.3px);
    opacity: .22;
    animation: raySlide 4.5s ease-in-out infinite;
}

.auth-ray-one {
    top: 24%;
    left: 8%;
}

.auth-ray-two {
    bottom: 27%;
    right: 7%;
    background: linear-gradient(90deg, transparent, rgba(255,74,98,.24), transparent);
    animation-delay: -2s;
}

.auth-box {
    position: relative;
    z-index: 2;
    width: min(390px, 94vw);
    min-height: 160px;
    padding: 28px;
    border-radius: 8px;
    color: var(--auth-text);
    background:
        linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.028)),
        linear-gradient(180deg, rgba(34,35,49,.62) 0%, rgba(14,15,25,.72) 100%);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow:
        0 30px 80px rgba(0,0,0,.58),
        inset 0 1px 0 rgba(255,255,255,.12),
        inset 0 -1px 0 rgba(255,255,255,.035),
        0 0 36px rgba(78,216,255,.055);
    backdrop-filter: blur(22px) saturate(155%);
    -webkit-backdrop-filter: blur(22px) saturate(155%);
    animation: boxStart 1.05s cubic-bezier(.2,.9,.2,1) both, boxPulse 3.2s ease-in-out 1.15s infinite;
    overflow: hidden;
}

.auth-box::before,
.auth-box::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
}

.auth-box::before {
    background:
        linear-gradient(120deg, rgba(255,255,255,.14), transparent 26%, transparent 63%, rgba(255,255,255,.05)),
        linear-gradient(90deg, transparent 0%, rgba(78,216,255,.55) 35%, transparent 50%, rgba(255,74,98,.48) 72%, transparent 100%);
    opacity: .42;
    filter: blur(16px);
    transform: translateX(-80%);
    animation: borderSweep 4s ease-in-out infinite;
}

.auth-box::after {
    border: 1px solid rgba(255,255,255,.12);
    box-shadow:
        inset 0 0 0 1px rgba(78,216,255,.055),
        inset 0 0 38px rgba(255,255,255,.028),
        inset 0 0 0 2px rgba(215,25,42,.025);
}

.scan-line,
.side-line {
    position: absolute;
    z-index: 4;
    display: block;
    pointer-events: none;
}

.scan-line {
    left: 50%;
    width: 90px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 999px;
    box-shadow: 0 0 13px currentColor;
}

.scan-line-top {
    top: 0;
    color: var(--auth-red-light);
    background: var(--auth-red-light);
    animation: topLight 2.9s ease-in-out infinite;
}

.scan-line-bottom {
    bottom: 0;
    color: var(--auth-blue-light);
    background: var(--auth-blue-light);
    animation: bottomLight 2.9s ease-in-out infinite;
}

.side-line {
    top: 50%;
    width: 3px;
    height: 82px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: var(--auth-blue-light);
    box-shadow: 0 0 14px rgba(78,216,255,.72);
    animation: sideLight 3.4s ease-in-out infinite;
}

.side-line-left {
    left: 0;
    background: var(--auth-red-light);
    box-shadow: 0 0 14px rgba(255,74,98,.68);
}

.side-line-right {
    right: 0;
}

.auth-brand {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 96px;
    animation: brandLift .9s ease both;
}

.auth-logo-frame {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    box-shadow:
        0 18px 34px rgba(0,0,0,.42),
        0 0 0 7px rgba(255,255,255,.05);
    animation: logoFloat 3.5s ease-in-out infinite;
}

.auth-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.auth-brand-text h1 {
    margin: 0;
    color: #FFFFFF;
    font-size: 22px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.045em;
    text-shadow: 0 0 18px rgba(78,216,255,.15);
}

.auth-brand-text h1 span {
    color: var(--auth-red-light);
    text-shadow: 0 0 18px rgba(255,74,98,.26);
}

.auth-brand-text p {
    margin: 7px 0 0;
    color: rgba(255,255,255,.58);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.auth-divider {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 1px;
    margin: 5px 0 22px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
    animation: fadeIn .75s ease .65s both;
}

.auth-alert {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    padding: 11px 13px;
    border-radius: 13px;
    color: #FFFFFF;
    background: rgba(215,25,42,.22);
    border: 1px solid rgba(255,74,98,.36);
    font-size: 12px;
    font-weight: 700;
    animation: formReveal .6s ease .45s both;
}

.auth-alert ul {
    margin: 0;
    padding-left: 18px;
}

.auth-alert-success {
    color: #eafff5;
    background: rgba(16, 185, 129, .2);
    border-color: rgba(52, 211, 153, .42);
}

.auth-field-error {
    display: block;
    min-height: 0;
    margin: -7px 14px 0;
    color: #ff9bab;
    font-size: 11px;
    font-weight: 600;
}

.auth-field-error:empty {
    display: none;
}

.auth-box-password {
    max-width: 600px;
}

.auth-message-box {
    max-width: 600px;
}

.auth-message-brand {
    margin-bottom: 24px;
}

.auth-password-help {
    position: relative;
    z-index: 5;
    margin: -4px 4px 15px;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.auth-form {
    position: relative;
    z-index: 5;
    display: grid;
    gap: 13px;
    animation: formReveal .75s ease .55s both;
}

.auth-field {
    position: relative;
    min-height: 45px;
    display: flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(11,11,18,.58);
    box-shadow: inset 0 0 18px rgba(0,0,0,.24);
    overflow: hidden;
    transition: .25s ease;
}

.auth-field:focus-within {
    border-color: rgba(78,216,255,.72);
    background: rgba(11,11,18,.72);
    box-shadow:
        0 0 0 4px rgba(78,216,255,.09),
        0 0 24px rgba(78,216,255,.16),
        inset 0 0 18px rgba(0,0,0,.18);
    transform: translateY(-1px);
}

.auth-field i {
    width: 48px;
    flex: 0 0 48px;
    text-align: center;
    color: var(--auth-blue-light);
    font-size: 16px;
}

.auth-field input {
    width: 100%;
    height: 43px;
    border: none;
    outline: none;
    padding: 0 18px 0 0;
    background: transparent !important;
    color: #FFFFFF !important;
    caret-color: #FFFFFF;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.auth-field input::placeholder {
    color: rgba(255,255,255,.50);
    font-weight: 600;
}

.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus,
.auth-field input:-webkit-autofill:active {
    -webkit-text-fill-color: #FFFFFF !important;
    caret-color: #FFFFFF !important;
    transition: background-color 999999s ease-in-out 0s !important;
    box-shadow: 0 0 0 1000px rgba(11,11,18,.86) inset !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(11,11,18,.86) inset !important;
    border: none !important;
}

.auth-field input:-internal-autofill-selected {
    background-color: transparent !important;
    color: #FFFFFF !important;
}

.auth-button {
    position: relative;
    min-height: 45px;
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 999px;
    overflow: hidden;
    color: #07111F;
    background: linear-gradient(135deg, #6AE7FF 0%, #4ED8FF 45%, #FFFFFF 100%);
    box-shadow:
        0 16px 32px rgba(78,216,255,.20),
        0 0 18px rgba(78,216,255,.24);
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: .25s ease;
}

.auth-button::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-110%) skewX(-22deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.60), transparent);
    transition: .6s ease;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 20px 38px rgba(78,216,255,.26),
        0 0 28px rgba(255,74,98,.20);
}

.auth-button:hover::before {
    transform: translateX(110%) skewX(-22deg);
}

.auth-button span,
.auth-button i {
    position: relative;
    z-index: 2;
}

.auth-button-link {
    position: relative;
    z-index: 5;
    width: 100%;
    text-decoration: none;
}

@keyframes boxStart {
    0% {
        width: 210px;
        min-height: 78px;
        padding: 20px 24px;
        opacity: 0;
        transform: translateY(28px) scale(.88);
        filter: blur(5px);
    }

    45% {
        width: 250px;
        min-height: 86px;
        padding: 22px 26px;
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }

    100% {
        width: min(390px, 94vw);
        min-height: 382px;
        padding: 28px;
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes brandLift {
    0%, 42% {
        transform: scale(.84);
        min-height: 36px;
    }

    100% {
        transform: scale(1);
        min-height: 96px;
    }
}

@keyframes formReveal {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes boxPulse {
    0%, 100% {
        box-shadow:
            0 30px 80px rgba(0,0,0,.58),
            0 0 26px rgba(78,216,255,.045),
            inset 0 1px 0 rgba(255,255,255,.12),
            inset 0 0 34px rgba(255,255,255,.026);
    }

    50% {
        box-shadow:
            0 34px 88px rgba(0,0,0,.62),
            0 0 34px rgba(78,216,255,.075),
            0 0 24px rgba(255,74,98,.04),
            inset 0 1px 0 rgba(255,255,255,.14),
            inset 0 0 42px rgba(255,255,255,.034);
    }
}

@keyframes borderSweep {
    0%, 100% {
        transform: translateX(-78%);
    }

    50% {
        transform: translateX(78%);
    }
}

@keyframes topLight {
    0%, 100% {
        width: 78px;
        opacity: .68;
    }

    50% {
        width: 145px;
        opacity: .95;
    }
}

@keyframes bottomLight {
    0%, 100% {
        width: 120px;
        opacity: .78;
    }

    50% {
        width: 64px;
        opacity: .58;
    }
}

@keyframes sideLight {
    0%, 100% {
        height: 72px;
        opacity: .62;
    }

    50% {
        height: 116px;
        opacity: .92;
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes raySlide {
    0%, 100% {
        transform: translateX(-20px);
        opacity: .16;
    }

    50% {
        transform: translateX(20px);
        opacity: .30;
    }
}

@media (max-width: 540px) {
    .auth-page {
        padding: 18px;
    }

    .auth-box {
        width: 100%;
        padding: 24px 18px;
        border-radius: 14px;
    }

    .auth-brand {
        gap: 12px;
    }

    .auth-logo-frame {
        width: 66px;
        height: 66px;
        border-radius: 18px;
    }

    .auth-logo {
        width: 46px;
        height: 46px;
    }

    .auth-brand-text h1 {
        font-size: 19px;
    }

    .auth-brand-text p {
        font-size: 8px;
    }
}
