:root {
    --auth-bg: #090716;
    --auth-bg-soft: #100d25;
    --auth-surface: rgba(18, 17, 42, .88);
    --auth-surface-strong: #151331;
    --auth-line: rgba(255, 255, 255, .11);
    --auth-text: #f8f7ff;
    --auth-muted: #a8a4c2;
    --auth-primary: #7767ff;
    --auth-primary-strong: #5f4ff2;
    --auth-accent: #49c6ff;
    --auth-danger: #ff7d92;
    --auth-success: #55d69e;
    --auth-warning: #ffc369;
    --auth-radius: 1.35rem;
    --auth-shadow: 0 30px 80px rgba(0, 0, 0, .34);
}

.auth-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 12%, rgba(100, 82, 255, .18), transparent 28rem),
        radial-gradient(circle at 88% 82%, rgba(28, 177, 235, .11), transparent 28rem),
        var(--auth-bg);
    color: var(--auth-text);
}

.auth-site-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.auth-header {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid var(--auth-line);
    background: rgba(9, 7, 22, .78);
    backdrop-filter: blur(20px);
}

.auth-header-inner {
    width: min(calc(100% - 2rem), 1220px);
    min-height: 78px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    color: var(--auth-text);
    text-decoration: none;
}

.auth-brand img {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    filter: drop-shadow(0 12px 22px rgba(103, 83, 255, .35));
}

.auth-brand-copy,
.auth-brand-copy strong,
.auth-brand-copy small {
    display: block;
}

.auth-brand-copy strong {
    font-size: 1.12rem;
    line-height: 1.05;
    letter-spacing: -.035em;
}

.auth-brand-copy small {
    margin-top: .22rem;
    color: var(--auth-muted);
    font-size: .72rem;
    line-height: 1.2;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.auth-nav form {
    margin: 0;
}

.auth-nav a,
.auth-nav button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .65rem .9rem;
    border: 0;
    border-radius: .75rem;
    background: transparent;
    color: #d8d5eb;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.auth-nav a:hover,
.auth-nav button:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.auth-nav .auth-nav-cta {
    padding-inline: 1.05rem;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-strong));
    color: #fff;
    box-shadow: 0 10px 25px rgba(98, 77, 244, .26);
}

.auth-main {
    width: min(calc(100% - 2rem), 1220px);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 5rem) 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .8fr);
    align-items: center;
    gap: clamp(2.5rem, 7vw, 7rem);
}

.auth-showcase {
    position: relative;
    min-height: 590px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
}

.auth-showcase-content {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: .36rem .8rem;
    border: 1px solid rgba(119, 103, 255, .34);
    border-radius: 999px;
    background: rgba(119, 103, 255, .12);
    color: #c9c2ff;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.auth-showcase h1 {
    max-width: 680px;
    margin: 1.25rem 0 1rem;
    color: #fff;
    font-size: clamp(2.8rem, 6vw, 5.8rem);
    line-height: .98;
    letter-spacing: -.065em;
}

.auth-showcase > .auth-showcase-content > p {
    max-width: 560px;
    margin: 0;
    color: #b5b0ca;
    font-size: clamp(1rem, 1.7vw, 1.15rem);
    line-height: 1.75;
}

.auth-feature-list {
    margin-top: 2.25rem;
    display: grid;
    gap: .85rem;
}

.auth-feature {
    max-width: 520px;
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: .85rem;
    padding: .8rem .9rem;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .035);
}

.auth-feature-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: .85rem;
    background: linear-gradient(145deg, rgba(119, 103, 255, .2), rgba(73, 198, 255, .1));
    color: #bcb4ff;
}

.auth-feature-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-feature > span:last-child,
.auth-feature strong,
.auth-feature small {
    display: block;
}

.auth-feature strong {
    color: #f9f8ff;
    font-size: .92rem;
}

.auth-feature small {
    margin-top: .08rem;
    color: var(--auth-muted);
    font-size: .78rem;
}

.auth-showcase-glow {
    position: absolute;
    z-index: -1;
    border-radius: 999px;
    filter: blur(10px);
    pointer-events: none;
}

.auth-showcase-glow--one {
    width: 340px;
    height: 340px;
    top: 4%;
    left: -14%;
    background: rgba(104, 82, 255, .16);
}

.auth-showcase-glow--two {
    width: 280px;
    height: 280px;
    right: 6%;
    bottom: 4%;
    background: rgba(57, 190, 255, .09);
}

.auth-wave {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 112px;
    display: flex;
    align-items: end;
    gap: 9px;
    opacity: .25;
    pointer-events: none;
}

.auth-wave span {
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(to top, var(--auth-primary), var(--auth-accent));
    animation: auth-wave 2.2s ease-in-out infinite alternate;
}

.auth-wave span:nth-child(1) { height: 22%; animation-delay: -.2s; }
.auth-wave span:nth-child(2) { height: 58%; animation-delay: -.7s; }
.auth-wave span:nth-child(3) { height: 35%; animation-delay: -1.1s; }
.auth-wave span:nth-child(4) { height: 84%; animation-delay: -.5s; }
.auth-wave span:nth-child(5) { height: 48%; animation-delay: -1.4s; }
.auth-wave span:nth-child(6) { height: 96%; animation-delay: -.9s; }
.auth-wave span:nth-child(7) { height: 56%; animation-delay: -.1s; }
.auth-wave span:nth-child(8) { height: 72%; animation-delay: -1.3s; }
.auth-wave span:nth-child(9) { height: 30%; animation-delay: -.6s; }

@keyframes auth-wave {
    to { transform: scaleY(.62); opacity: .55; }
}

.auth-form-zone {
    width: 100%;
    max-width: 500px;
    justify-self: end;
}

.auth-messages {
    display: grid;
    gap: .7rem;
    margin-bottom: 1rem;
}

.auth-message {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: .75rem;
    align-items: start;
    padding: .9rem 1rem;
    border: 1px solid var(--auth-line);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .055);
    color: #e9e7f4;
    font-size: .88rem;
}

.auth-message-dot {
    width: 9px;
    height: 9px;
    margin-top: .38rem;
    border-radius: 50%;
    background: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(73, 198, 255, .12);
}

.auth-message--success .auth-message-dot { background: var(--auth-success); box-shadow: 0 0 0 4px rgba(85, 214, 158, .12); }
.auth-message--error .auth-message-dot,
.auth-message--danger .auth-message-dot { background: var(--auth-danger); box-shadow: 0 0 0 4px rgba(255, 125, 146, .12); }
.auth-message--warning .auth-message-dot { background: var(--auth-warning); box-shadow: 0 0 0 4px rgba(255, 195, 105, .12); }

.auth-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1.45rem, 4vw, 2.25rem);
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .018)),
        var(--auth-surface);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(28px);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(164, 151, 255, .7), transparent);
}

.auth-card-brand {
    width: 66px;
    height: 66px;
    margin: 0 auto 1.15rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, .055);
    box-shadow: 0 18px 35px rgba(0, 0, 0, .2);
}

.auth-card-brand img {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 10px 18px rgba(103, 83, 255, .38));
}

.auth-card-content {
    color: var(--auth-text);
}

.auth-card-content > :first-child,
.auth-card-content > form:first-child > :first-child {
    margin-top: 0;
}

.auth-card h1,
.auth-card h2,
.auth-card h3 {
    color: #fff;
    letter-spacing: -.035em;
}

.auth-card h1 {
    margin: 0 0 .55rem;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    line-height: 1.1;
    text-align: center;
}

.auth-card h2 {
    font-size: 1.35rem;
}

.auth-card p {
    color: var(--auth-muted);
}

.auth-card h1 + p,
.auth-card h2 + p {
    margin-top: 0;
    text-align: center;
}

.auth-card form {
    display: grid;
    gap: 1rem;
    margin-top: 1.45rem;
}

.auth-card form > p,
.auth-card form > div:not(.auth-actions):not(.socialaccount_ballot):not(.socialaccount_providers) {
    display: grid;
    gap: .45rem;
    margin: 0;
}

.auth-card label {
    color: #e9e7f6;
    font-size: .84rem;
    font-weight: 750;
}

.auth-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.auth-card select,
.auth-card textarea {
    width: 100%;
    min-height: 50px;
    padding: .82rem .95rem;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: .82rem;
    outline: 0;
    background: rgba(5, 4, 18, .48);
    color: #fff;
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-card textarea {
    min-height: 120px;
    resize: vertical;
}

.auth-card input::placeholder,
.auth-card textarea::placeholder {
    color: #77718f;
}

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
    border-color: rgba(119, 103, 255, .78);
    background: rgba(8, 6, 25, .72);
    box-shadow: 0 0 0 4px rgba(119, 103, 255, .14);
}

.auth-card input[aria-invalid="true"],
.auth-card .is-invalid {
    border-color: rgba(255, 125, 146, .75);
}

.auth-card input[type="checkbox"],
.auth-card input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--auth-primary);
}

.auth-card label:has(input[type="checkbox"]),
.auth-card label:has(input[type="radio"]) {
    display: inline-flex;
    align-items: flex-start;
    gap: .65rem;
    color: #c7c3da;
    font-weight: 600;
    cursor: pointer;
}

.auth-card button,
.auth-card input[type="submit"],
.auth-card [role="button"],
.auth-card .button,
.auth-card a.primaryAction {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .8rem 1.1rem;
    border: 0;
    border-radius: .82rem;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-strong));
    color: #fff;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(95, 79, 242, .25);
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.auth-card button:hover,
.auth-card input[type="submit"]:hover,
.auth-card [role="button"]:hover,
.auth-card .button:hover,
.auth-card a.primaryAction:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
    box-shadow: 0 15px 34px rgba(95, 79, 242, .34);
}

.auth-card button.secondaryAction,
.auth-card a.secondaryAction,
.auth-card .secondary {
    border: 1px solid var(--auth-line);
    background: rgba(255, 255, 255, .055);
    color: #eceaf8;
    box-shadow: none;
}

.auth-card a:not(.button):not([role="button"]):not(.primaryAction):not(.secondaryAction) {
    color: #aaa0ff;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.auth-card a:not(.button):not([role="button"]):hover {
    color: #d0caff;
    text-decoration: underline;
    text-underline-offset: .18em;
}

.auth-card ul.errorlist,
.auth-card .errorlist,
.auth-card .alert-error {
    margin: .1rem 0 0;
    padding: .7rem .85rem;
    list-style: none;
    border: 1px solid rgba(255, 125, 146, .25);
    border-radius: .75rem;
    background: rgba(255, 82, 112, .09);
    color: #ffb7c3;
    font-size: .82rem;
}

.auth-card .helptext,
.auth-card .help-text,
.auth-card small.helptext {
    color: #8e89a8;
    font-size: .78rem;
    line-height: 1.5;
}

.auth-card .helptext ul {
    margin: .45rem 0 0;
    padding-left: 1.1rem;
}

.auth-card hr {
    height: 1px;
    margin: 1.35rem 0;
    border: 0;
    background: var(--auth-line);
}

.auth-card table {
    width: 100%;
    border-collapse: collapse;
}

.auth-card th,
.auth-card td {
    padding: .7rem .4rem;
    border-bottom: 1px solid var(--auth-line);
    color: #d8d5e7;
    text-align: left;
}

.auth-card .socialaccount_providers,
.auth-card ul.socialaccount_providers {
    display: grid;
    gap: .7rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}

.auth-card .socialaccount_providers a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--auth-line);
    border-radius: .82rem;
    background: rgba(255, 255, 255, .04);
    color: #fff;
    text-decoration: none;
}

.auth-card .socialaccount_ballot .login-or {
    position: relative;
    margin: 1.2rem 0;
    color: #817c98;
    text-align: center;
}

.auth-card .socialaccount_ballot .login-or::before,
.auth-card .socialaccount_ballot .login-or::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--auth-line);
}

.auth-card .socialaccount_ballot .login-or::before { left: 0; }
.auth-card .socialaccount_ballot .login-or::after { right: 0; }

.auth-card .form-check,
.auth-card .fieldWrapper:has(input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
}

.auth-security-note {
    margin-top: 1.6rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--auth-line);
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: .75rem;
}

.auth-security-note > svg {
    width: 32px;
    height: 32px;
    padding: .42rem;
    border-radius: .7rem;
    background: rgba(85, 214, 158, .09);
    color: var(--auth-success);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-security-note p,
.auth-security-note strong,
.auth-security-note span {
    display: block;
    margin: 0;
}

.auth-security-note strong {
    color: #eae8f6;
    font-size: .8rem;
}

.auth-security-note span {
    margin-top: .1rem;
    color: #87829d;
    font-size: .72rem;
    line-height: 1.45;
}

.auth-footer {
    width: min(calc(100% - 2rem), 1220px);
    min-height: 68px;
    margin: 0 auto;
    padding: 1rem 0;
    border-top: 1px solid var(--auth-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #76718d;
    font-size: .76rem;
}

@media (max-width: 900px) {
    .auth-main {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 2.5rem;
    }

    .auth-showcase {
        min-height: auto;
        text-align: center;
    }

    .auth-showcase-content {
        margin: 0 auto;
    }

    .auth-showcase h1 {
        font-size: clamp(2.5rem, 10vw, 4.5rem);
    }

    .auth-showcase > .auth-showcase-content > p,
    .auth-feature {
        margin-inline: auto;
    }

    .auth-feature {
        text-align: left;
    }

    .auth-wave {
        display: none;
    }

    .auth-form-zone {
        max-width: 560px;
        justify-self: center;
    }
}

@media (max-width: 650px) {
    .auth-header-inner {
        min-height: 70px;
    }

    .auth-brand img {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .auth-brand-copy small,
    .auth-nav > a:first-child,
    .auth-nav .auth-nav-cta {
        display: none;
    }

    .auth-nav a,
    .auth-nav button {
        padding-inline: .65rem;
        font-size: .8rem;
    }

    .auth-main {
        width: min(calc(100% - 1rem), 1220px);
        padding: 1.8rem 0 2.5rem;
    }

    .auth-showcase h1 {
        margin-top: 1rem;
        font-size: clamp(2.25rem, 13vw, 3.35rem);
    }

    .auth-showcase > .auth-showcase-content > p {
        font-size: .94rem;
    }

    .auth-feature-list {
        margin-top: 1.5rem;
    }

    .auth-feature {
        grid-template-columns: 38px 1fr;
        padding: .68rem .72rem;
    }

    .auth-feature-icon {
        width: 38px;
        height: 38px;
    }

    .auth-card {
        padding: 1.25rem;
        border-radius: 1.1rem;
    }

    .auth-card-brand {
        width: 58px;
        height: 58px;
    }

    .auth-card-brand img {
        width: 46px;
        height: 46px;
    }

    .auth-footer {
        width: min(calc(100% - 1rem), 1220px);
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-wave span {
        animation: none;
    }

    .auth-card button,
    .auth-card input[type="submit"],
    .auth-card [role="button"],
    .auth-card .button,
    .auth-card a.primaryAction {
        transition: none;
    }
}
