:root {
    --auth-ink: #17213b;
    --auth-muted: #69728a;
    --auth-primary: #4169e1;
    --auth-primary-dark: #3154c8;
    --auth-violet: #8b5cf6;
    --auth-border: rgba(255, 255, 255, 0.68);
    --auth-glass: rgba(255, 255, 255, 0.54);
    --auth-shadow: 0 28px 80px rgba(51, 65, 120, 0.2);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
    color: var(--auth-ink);
}

.auth-page {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 16%, rgba(160, 190, 255, 0.88), transparent 31%),
        radial-gradient(circle at 88% 12%, rgba(228, 185, 255, 0.72), transparent 30%),
        radial-gradient(circle at 82% 88%, rgba(159, 234, 222, 0.68), transparent 31%),
        linear-gradient(145deg, #eef3ff 0%, #f8f5ff 48%, #edf9f6 100%);
}

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

.auth-orb {
    position: absolute;
    width: 24rem;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(10px);
    opacity: 0.5;
    animation: flutuar 13s ease-in-out infinite alternate;
}

.auth-orb--one {
    top: -9rem;
    right: 6%;
    background: linear-gradient(135deg, rgba(118, 147, 255, 0.58), rgba(196, 159, 255, 0.5));
}

.auth-orb--two {
    bottom: -11rem;
    left: 4%;
    background: linear-gradient(135deg, rgba(118, 224, 201, 0.48), rgba(111, 155, 255, 0.42));
    animation-delay: -5s;
}

@keyframes flutuar {
    from { transform: translate3d(0, -12px, 0) scale(0.96); }
    to { transform: translate3d(18px, 20px, 0) scale(1.06); }
}

.auth-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.glass-shell {
    width: min(1180px, 100%);
    display: grid;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 34px;
    background: var(--auth-glass);
    box-shadow: var(--auth-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
}

.glass-shell--login {
    width: min(900px, 100%);
    grid-template-columns: 250px minmax(0, 1fr);
}

.glass-shell--register {
    width: min(1180px, 100%);
    grid-template-columns: 230px minmax(0, 1fr);
}

.auth-story {
    position: relative;
    display: flex;
    min-height: 660px;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 4.5rem);
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(50, 81, 189, 0.95), rgba(91, 68, 180, 0.89)),
        linear-gradient(180deg, #496bd8, #6f52c8);
}

.glass-shell--register .auth-story {
    min-height: 100%;
    padding: 2rem;
}

.glass-shell .auth-story--simple {
    min-height: 100%;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-simple-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
    color: #fff;
    text-align: center;
    text-decoration: none;
}

.auth-simple-brand:hover {
    color: #fff;
}

.brand-mark--large {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 22px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 16px 34px rgba(23, 32, 103, 0.18);
}

.brand-mark--large .brand-glyph {
    transform: scale(1.35);
}

.simple-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 740;
    letter-spacing: -0.04em;
}

.auth-story::before,
.auth-story::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-story::before {
    width: 25rem;
    height: 25rem;
    top: -12rem;
    right: -11rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4rem rgba(255, 255, 255, 0.035), 0 0 0 8rem rgba(255, 255, 255, 0.025);
}

.auth-story::after {
    width: 18rem;
    height: 18rem;
    right: -7rem;
    bottom: -8rem;
    background: rgba(116, 235, 214, 0.18);
    filter: blur(4px);
}

.auth-brand,
.auth-story-content,
.auth-story-footer {
    position: relative;
    z-index: 1;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    width: fit-content;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.auth-brand:hover {
    color: #fff;
}

.brand-mark {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
}

.brand-glyph {
    position: relative;
    width: 1.2rem;
    height: 1.2rem;
}

.brand-glyph::before,
.brand-glyph::after {
    content: "";
    position: absolute;
    width: 0.72rem;
    height: 0.72rem;
    border: 2px solid #fff;
    border-radius: 5px;
}

.brand-glyph::before {
    top: 0;
    left: 0;
}

.brand-glyph::after {
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
}

.story-kicker,
.form-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.15rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.story-kicker {
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.story-title {
    max-width: 10ch;
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4.9rem);
    font-weight: 720;
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.glass-shell--register .story-title {
    font-size: clamp(2.4rem, 4vw, 4rem);
}

.story-copy {
    max-width: 34rem;
    margin: 1.5rem 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.02rem;
    line-height: 1.72;
}

.story-points {
    display: grid;
    gap: 0.8rem;
    margin-top: 2rem;
}

.story-point {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.92rem;
}

.story-point span {
    display: grid;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.72rem;
    font-weight: 800;
}

.auth-story-footer {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #7df2c9;
    box-shadow: 0 0 0 5px rgba(125, 242, 201, 0.14);
}

.auth-form-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 0.65rem;
    background: rgba(255, 255, 255, 0.28);
}

.panel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.3rem;
    padding: 0 0.55rem;
    color: rgba(23, 33, 59, 0.55);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel-dots {
    display: flex;
    gap: 0.34rem;
}

.panel-dots span {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: rgba(73, 86, 126, 0.2);
}

.auth-frame {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.auth-frame--login {
    min-height: 440px;
}

.auth-frame--register {
    min-height: 665px;
}

.auth-form-body {
    min-height: 100vh;
    margin: 0;
    background: transparent;
}

.form-wrap {
    width: 100%;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.form-wrap--login {
    max-width: 34rem;
    margin: 0 auto;
}

.form-wrap--register {
    padding: 1.15rem 1.35rem;
}

.form-header {
    margin-bottom: 1.15rem;
}

.form-kicker {
    margin-bottom: 0.75rem;
    color: var(--auth-primary);
}

.form-title {
    margin: 0;
    color: var(--auth-ink);
    font-size: clamp(1.65rem, 3vw, 2.1rem);
    font-weight: 740;
    letter-spacing: -0.045em;
}

.form-copy {
    margin: 0.4rem 0 0;
    color: var(--auth-muted);
    line-height: 1.65;
}

.form-label {
    margin-bottom: 0.3rem;
    color: #35405d;
    font-size: 0.78rem;
    font-weight: 700;
}

.form-control {
    min-height: 2.75rem;
    padding: 0.62rem 0.85rem;
    border: 1px solid rgba(112, 125, 161, 0.22);
    border-radius: 15px;
    color: var(--auth-ink);
    background: rgba(255, 255, 255, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 4px 14px rgba(63, 76, 119, 0.035);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-control::placeholder {
    color: #9ca4b8;
}

.form-control:focus {
    border-color: rgba(65, 105, 225, 0.55);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(65, 105, 225, 0.11), 0 10px 26px rgba(65, 105, 225, 0.08);
}

.btn-glass-primary {
    min-height: 2.85rem;
    padding: 0.65rem 1.15rem;
    border: 0;
    border-radius: 16px;
    color: #fff;
    font-weight: 750;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-violet));
    box-shadow: 0 14px 28px rgba(65, 105, 225, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn-glass-primary:hover,
.btn-glass-primary:focus-visible {
    color: #fff;
    filter: saturate(112%);
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(65, 105, 225, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.account-link {
    color: var(--auth-primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.account-link:hover {
    color: var(--auth-violet);
    text-decoration: underline;
    text-underline-offset: 0.22rem;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 1.5rem;
    color: #858da1;
    font-size: 0.78rem;
}

.security-note::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #56c9a2;
    box-shadow: 0 0 0 4px rgba(86, 201, 162, 0.12);
}

.section-card {
    margin: 0 0 0.7rem;
    padding: 0.9rem 1rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.48);
    box-shadow: 0 12px 34px rgba(55, 68, 108, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.7rem;
}

.section-number {
    display: grid;
    flex: 0 0 auto;
    width: 1.85rem;
    height: 1.85rem;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-violet));
    box-shadow: 0 7px 16px rgba(65, 105, 225, 0.2);
}

.section-title {
    margin: 0;
    color: var(--auth-ink);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.section-copy {
    margin: 0.16rem 0 0;
    color: var(--auth-muted);
    font-size: 0.78rem;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0.15rem 0;
}

.alert {
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(55, 68, 108, 0.08);
}

@media (max-width: 991.98px) {
    .auth-stage {
        align-items: flex-start;
        padding: 1rem;
    }

    .glass-shell--login,
    .glass-shell--register {
        grid-template-columns: 1fr;
    }

    .auth-story,
    .glass-shell--register .auth-story {
        min-height: auto;
        padding: 2rem;
    }

    .auth-story-content {
        margin-top: 3.5rem;
    }

    .story-title,
    .glass-shell--register .story-title {
        max-width: 13ch;
        font-size: clamp(2.25rem, 9vw, 3.6rem);
    }

    .auth-story-footer {
        margin-top: 2.5rem;
    }

    .auth-form-panel {
        padding: 0.7rem;
    }
}

@media (max-width: 575.98px) {
    .auth-stage {
        padding: 0;
    }

    .glass-shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-story,
    .glass-shell--register .auth-story {
        padding: 1.4rem;
    }

    .auth-story-content {
        margin-top: 2.5rem;
    }

    .story-copy {
        font-size: 0.94rem;
    }

    .story-points {
        display: none;
    }

    .auth-form-panel {
        padding: 0;
        background: rgba(255, 255, 255, 0.55);
    }

    .panel-bar {
        padding: 0 1.25rem;
    }

    .auth-frame {
        border-radius: 0;
    }

    .form-wrap {
        padding: 1.45rem;
    }

    .section-card {
        padding: 1.1rem;
        border-radius: 18px;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
