:root {
    --auth-navy: #071d31;
    --auth-navy-light: #0a2944;
    --auth-blue: #0d99ff;
    --auth-blue-dark: #0879c9;
    --auth-cyan: #7dd3fc;
    --auth-bg: #f4f8fb;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #dbe3ef;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--auth-bg);
}

body.auth-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        max(24px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(18px, env(safe-area-inset-left));
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 12%, rgba(125, 211, 252, .42), transparent 28rem),
        radial-gradient(circle at 88% 88%, rgba(13, 153, 255, .15), transparent 25rem),
        linear-gradient(145deg, #eef9ff 0%, var(--auth-bg) 48%, #eaf3f9 100%);
}

body.auth-page::before,
body.auth-page::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    pointer-events: none;
}

body.auth-page::before {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -80px;
    background: linear-gradient(135deg, rgba(13, 153, 255, .2), rgba(125, 211, 252, .05));
}

body.auth-page::after {
    width: 220px;
    height: 220px;
    bottom: -120px;
    left: -70px;
    border: 35px solid rgba(7, 29, 49, .05);
}

.auth-page .login-card {
    width: min(100%, 430px);
    max-width: 430px;
    margin: auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 28px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 24px 70px rgba(7, 29, 49, .14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.auth-page.auth-register .login-card {
    max-width: 480px;
}

.auth-page .login-card::before {
    content: "";
    display: block;
    height: 5px;
    background: linear-gradient(90deg, var(--auth-navy), var(--auth-blue), var(--auth-cyan));
}

.auth-page .login-header {
    position: relative;
    padding: 32px 32px 8px;
}

.auth-page .hero-circle-wrap {
    width: 76px;
    height: 76px;
    margin-bottom: 17px;
    padding: 5px;
    border: 1px solid rgba(13, 153, 255, .22);
    background: #fff;
    box-shadow: 0 12px 30px rgba(13, 153, 255, .18);
}

.auth-page .hero-circle {
    border: 0 !important;
    box-shadow: none;
}

.auth-page .header-title {
    color: var(--auth-navy);
    font-size: clamp(23px, 5vw, 28px);
    letter-spacing: -.8px;
}

.auth-page .header-subtitle {
    margin: 7px 0 0;
    color: var(--auth-muted);
    line-height: 1.55;
}

.auth-page .login-body {
    padding: 20px 32px 34px;
}

.auth-page .input-group {
    margin-bottom: 18px;
}

.auth-page .input-group label {
    margin-bottom: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: none;
}

.auth-page .input-control {
    min-height: 56px;
    border: 1px solid var(--auth-border);
    border-radius: 15px;
    background: rgba(248, 250, 252, .9);
    font-size: 16px;
    font-weight: 500;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.auth-page .input-control:hover {
    border-color: #bfd3e2;
}

.auth-page .input-control:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 4px rgba(13, 153, 255, .12);
}

.auth-page .input-icon {
    color: #8094a7;
}

.auth-page .btn-login {
    min-height: 56px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--auth-blue), #2563eb);
    box-shadow: 0 12px 25px rgba(13, 153, 255, .24);
    letter-spacing: 0;
    touch-action: manipulation;
}

.auth-page a.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(13, 153, 255, .3);
}

.auth-page .btn-login:focus-visible,
.auth-page a:focus-visible {
    outline: 3px solid rgba(13, 153, 255, .3);
    outline-offset: 3px;
}

.auth-page .alert-custom,
.auth-page .alert-success {
    border-radius: 14px;
    line-height: 1.45;
}

.auth-page .alert-success {
    color: #0369a1;
    border-color: #bae6fd;
    background: #f0f9ff;
}

.auth-page .footer-link {
    margin-top: 27px;
    line-height: 1.6;
}

.auth-page .forgot-password {
    margin-bottom: 0;
}

.auth-page .step-indicator {
    align-items: center;
    gap: 0;
}

.auth-page .step-dot {
    position: relative;
    width: 12px;
    height: 12px;
    margin: 0 14px;
}

.auth-page .step-dot:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 12px;
    width: 28px;
    height: 2px;
    background: #dbe3ef;
}

.auth-page .step-dot.done:not(:last-child)::after {
    background: var(--auth-blue);
}

.auth-page .readonly-input {
    opacity: 1;
    background: #eef3f7;
}

.auth-page .password-wrap {
    position: relative;
}

.auth-page .password-toggle {
    position: absolute;
    right: 10px;
    bottom: 8px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    color: var(--auth-muted);
    background: transparent;
    cursor: pointer;
}

.auth-page .password-toggle:hover {
    color: var(--auth-blue-dark);
    background: #eaf6ff;
}

.auth-page .password-wrap .input-control {
    padding-right: 52px;
}

.auth-page .auth-note {
    display: flex;
    gap: 9px;
    margin: -5px 0 18px;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.5;
}

.auth-page .auth-note i {
    margin-top: 2px;
    color: var(--auth-blue);
}

@media (max-width: 520px) {
    body.auth-page {
        align-items: flex-start;
        padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    }

    .auth-page .login-card {
        border-radius: 22px;
    }

    .auth-page .login-header {
        padding: 25px 21px 6px;
    }

    .auth-page .login-body {
        padding: 17px 21px 27px;
    }

    .auth-page .hero-circle-wrap {
        width: 68px;
        height: 68px;
        margin-bottom: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
