:root {
    --auth-ink: #172033;
    --auth-muted: #667085;
    --auth-line: #dfe5ef;
    --auth-primary: #5546e8;
    --auth-primary-dark: #4338ca;
    --auth-soft: #f5f6ff;
    --auth-success: #059669;
    --auth-danger: #dc2626;
}

* {
    box-sizing: border-box;
}

body.auth-page {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    color: var(--auth-ink);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 10% 10%, rgba(129, 140, 248, 0.34), transparent 30%),
        radial-gradient(circle at 90% 85%, rgba(45, 212, 191, 0.18), transparent 26%),
        linear-gradient(135deg, #17134c 0%, #302a8f 48%, #151a36 100%);
}

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

.auth-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    opacity: 0.55;
    animation: authFloat 9s ease-in-out infinite;
}

.auth-orb--one {
    width: 190px;
    height: 190px;
    left: -55px;
    top: 16%;
    background: linear-gradient(145deg, rgba(129, 140, 248, 0.45), rgba(79, 70, 229, 0.08));
}

.auth-orb--two {
    width: 250px;
    height: 250px;
    right: -95px;
    bottom: 4%;
    background: linear-gradient(145deg, rgba(45, 212, 191, 0.25), rgba(16, 185, 129, 0.04));
    animation-delay: -3s;
}

.auth-grid-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.14;
    background-image:
        linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.18) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1160px, 100%);
    min-height: 690px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 32px 90px rgba(8, 11, 38, 0.38);
    animation: authShellEnter 0.65s cubic-bezier(.2,.8,.2,1) both;
}

.auth-shell--register {
    min-height: 790px;
}

.auth-showcase {
    position: relative;
    min-width: 0;
    padding: 44px 48px 38px;
    display: flex;
    flex-direction: column;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 82% 18%, rgba(255,255,255,0.18), transparent 25%),
        linear-gradient(145deg, #5145dd 0%, #3730a3 58%, #29236f 100%);
}

.auth-showcase::before,
.auth-showcase::after {
    content: '';
    position: absolute;
    z-index: -1;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
}

.auth-showcase::before {
    width: 420px;
    height: 420px;
    right: -220px;
    top: -160px;
    box-shadow: 0 0 0 54px rgba(255,255,255,0.035), 0 0 0 108px rgba(255,255,255,0.025);
}

.auth-showcase::after {
    width: 310px;
    height: 310px;
    left: -180px;
    bottom: -190px;
    box-shadow: 0 0 0 48px rgba(255,255,255,0.025);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    width: max-content;
    color: inherit;
    text-decoration: none;
}

.auth-brand__mark {
    width: 44px;
    height: 44px;
    padding: 8px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(14, 11, 55, 0.22);
}

.auth-brand__name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-showcase__copy {
    position: relative;
    z-index: 2;
    margin-top: 34px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.auth-kicker::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #5eead4;
    box-shadow: 0 0 0 5px rgba(94,234,212,0.13);
}

.auth-showcase h1 {
    max-width: 520px;
    margin: 20px 0 12px;
    font-size: clamp(34px, 4vw, 53px);
    line-height: 1.08;
    letter-spacing: -0.05em;
    font-weight: 800;
}

.auth-showcase__description {
    max-width: 500px;
    margin: 0;
    color: rgba(238, 242, 255, 0.82);
    font-size: 15px;
    line-height: 1.7;
}

.auth-illustration-wrap {
    position: relative;
    flex: 1;
    min-height: 290px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.auth-illustration-glow {
    position: absolute;
    left: 50%;
    bottom: 5%;
    width: 72%;
    height: 58%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: rgba(129, 140, 248, 0.4);
    filter: blur(38px);
}

.auth-illustration {
    position: relative;
    z-index: 1;
    display: block;
    width: min(455px, 92%);
    max-height: 385px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 22px 24px rgba(14, 11, 55, 0.24));
    animation: authIllustrationEnter 0.8s 0.15s cubic-bezier(.2,.8,.2,1) both;
}

.auth-mini-stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.auth-mini-stat {
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 15px;
    background: rgba(255,255,255,0.09);
    backdrop-filter: blur(8px);
}

.auth-mini-stat strong,
.auth-mini-stat span {
    display: block;
}

.auth-mini-stat strong {
    font-size: 12px;
    font-weight: 800;
}

.auth-mini-stat span {
    margin-top: 2px;
    color: rgba(238,242,255,0.68);
    font-size: 10px;
}

.auth-form-panel {
    position: relative;
    padding: 48px clamp(34px, 4.4vw, 64px) 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255,255,255,0.98);
}

.auth-shell--register .auth-form-panel {
    justify-content: flex-start;
    padding-top: 40px;
}

.auth-mobile-brand {
    display: none;
    margin-bottom: 28px;
    color: var(--auth-ink);
}

.auth-form-heading {
    margin-bottom: 27px;
}

.auth-form-heading__eyebrow {
    margin: 0 0 7px;
    color: var(--auth-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-form-heading h2 {
    margin: 0;
    color: #111827;
    font-size: clamp(27px, 3vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.auth-form-heading p {
    margin: 9px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.6;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.55;
}

.auth-alert svg {
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 1px;
}

.auth-alert--error {
    color: #b42318;
    border-color: #fecaca;
    background: #fff1f2;
}

.auth-alert--success {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.auth-form {
    display: grid;
    gap: 17px;
}

.auth-form fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.auth-shell--register .auth-form {
    gap: 14px;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 7px;
}

.auth-label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.auth-label-row .auth-label {
    margin-bottom: 0;
}

.auth-label-link {
    color: var(--auth-primary);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.auth-label-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    z-index: 1;
    left: 15px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #98a2b3;
    pointer-events: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.auth-input {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 45px;
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    outline: none;
    color: #101828;
    background: #f8fafc;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.auth-input::placeholder {
    color: #a7b0c0;
    font-weight: 500;
}

.auth-input:hover {
    border-color: #c8d0df;
    background: #fff;
}

.auth-input:focus {
    border-color: #7569ef;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(85,70,232,0.11);
    transform: translateY(-1px);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--auth-primary);
    transform: translateY(-50%) scale(1.06);
}

.auth-password-toggle {
    position: absolute;
    z-index: 2;
    right: 7px;
    top: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 11px;
    color: #8b95a7;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--auth-primary);
    background: #efefff;
}

.auth-password-toggle:focus-visible {
    outline: 2px solid rgba(85,70,232,0.4);
    outline-offset: 1px;
}

.auth-password-toggle:active {
    transform: translateY(-50%) scale(0.9);
}

.auth-eye {
    width: 21px;
    height: 21px;
    overflow: visible;
}

.auth-eye__visible,
.auth-eye__slash {
    transform-box: fill-box;
    transform-origin: center;
}

.auth-eye__visible {
    transition: transform 0.18s ease;
}

.auth-eye__slash {
    stroke-dasharray: 26;
    stroke-dashoffset: 26;
    opacity: 0;
    transition: stroke-dashoffset 0.22s ease, opacity 0.16s ease;
}

.auth-password-toggle[aria-pressed="true"] .auth-eye__visible {
    transform: scaleY(0.78);
}

.auth-password-toggle[aria-pressed="true"] .auth-eye__slash {
    stroke-dashoffset: 0;
    opacity: 1;
}

.auth-password-toggle:hover .auth-eye__visible {
    animation: authEyeBlink 0.55s ease-in-out 1;
}

.auth-password-toggle.is-switching .auth-eye {
    animation: authEyePop 0.28s cubic-bezier(.2,.8,.2,1);
}

.auth-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-role-option {
    position: relative;
    cursor: pointer;
}

.auth-role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-role-card {
    min-height: 66px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.auth-role-card__icon {
    width: 35px;
    height: 35px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #667085;
    background: #e9edf5;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.auth-role-card__icon svg {
    width: 18px;
    height: 18px;
}

.auth-role-card strong,
.auth-role-card small {
    display: block;
}

.auth-role-card strong {
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.auth-role-card small {
    margin-top: 2px;
    color: #98a2b3;
    font-size: 9px;
    font-weight: 600;
}

.auth-role-option:hover .auth-role-card {
    border-color: #b7b1fa;
    transform: translateY(-1px);
}

.auth-role-option input:focus-visible + .auth-role-card {
    outline: 2px solid rgba(85,70,232,0.4);
    outline-offset: 2px;
}

.auth-role-option input:checked + .auth-role-card {
    border-color: #7569ef;
    background: #f2f1ff;
    box-shadow: 0 0 0 3px rgba(85,70,232,0.09);
}

.auth-role-option input:checked + .auth-role-card .auth-role-card__icon {
    color: #fff;
    background: linear-gradient(145deg, #695be9, #4f46e5);
    transform: scale(1.04);
}

.auth-role-option input:checked + .auth-role-card strong {
    color: #4338ca;
}

.auth-password-strength {
    margin-top: 9px;
}

.auth-strength-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.auth-strength-segment {
    height: 4px;
    flex: 1;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ecf2;
    transition: background 0.25s ease, transform 0.25s ease;
}

.auth-strength-label {
    min-width: 48px;
    margin-left: 5px;
    color: #98a2b3;
    font-size: 9px;
    font-weight: 800;
    text-align: right;
}

.auth-password-strength[data-score="1"] .auth-strength-segment:nth-child(1),
.auth-password-strength[data-score="2"] .auth-strength-segment:nth-child(-n+2),
.auth-password-strength[data-score="3"] .auth-strength-segment:nth-child(-n+3),
.auth-password-strength[data-score="4"] .auth-strength-segment:nth-child(-n+4) {
    transform: scaleY(1.2);
}

.auth-password-strength[data-score="1"] .auth-strength-segment:nth-child(1) { background: #ef4444; }
.auth-password-strength[data-score="2"] .auth-strength-segment:nth-child(-n+2) { background: #f59e0b; }
.auth-password-strength[data-score="3"] .auth-strength-segment:nth-child(-n+3) { background: #3b82f6; }
.auth-password-strength[data-score="4"] .auth-strength-segment:nth-child(-n+4) { background: #10b981; }
.auth-password-strength[data-score="1"] .auth-strength-label { color: #dc2626; }
.auth-password-strength[data-score="2"] .auth-strength-label { color: #d97706; }
.auth-password-strength[data-score="3"] .auth-strength-label { color: #2563eb; }
.auth-password-strength[data-score="4"] .auth-strength-label { color: #059669; }

.auth-field-note {
    min-height: 16px;
    margin: 6px 2px 0;
    color: #8b95a7;
    font-size: 9px;
    font-weight: 600;
}

.auth-field-note.is-error {
    color: var(--auth-danger);
}

.auth-field-note.is-valid {
    color: var(--auth-success);
}

.auth-submit {
    position: relative;
    width: 100%;
    height: 51px;
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #6558ea 0%, #4f46e5 55%, #4338ca 100%);
    box-shadow: 0 12px 24px rgba(79,70,229,0.25);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-105%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    transition: transform 0.6s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(79,70,229,0.32);
    filter: saturate(1.08);
}

.auth-submit:hover::before {
    transform: translateX(105%);
}

.auth-submit:focus-visible {
    outline: 3px solid rgba(99,102,241,0.28);
    outline-offset: 3px;
}

.auth-submit:active {
    transform: translateY(0) scale(0.985);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.78;
    transform: none;
}

.auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 999px;
    animation: authSpin 0.75s linear infinite;
}

.auth-switch {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #edf0f5;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.auth-switch a {
    color: var(--auth-primary);
    font-weight: 800;
    text-decoration: none;
}

.auth-switch a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-trust {
    margin-top: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #98a2b3;
    font-size: 9px;
    font-weight: 700;
}

.auth-trust svg {
    width: 13px;
    height: 13px;
    color: #10b981;
}

@keyframes authFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -18px, 0); }
}

@keyframes authShellEnter {
    from { opacity: 0; transform: translateY(20px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authIllustrationEnter {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authEyeBlink {
    0%, 38%, 62%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.08); }
}

@keyframes authEyePop {
    0% { transform: scale(1); }
    45% { transform: scale(0.78) rotate(-7deg); }
    100% { transform: scale(1); }
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 940px) {
    body.auth-page {
        padding: 18px;
        align-items: flex-start;
    }

    .auth-shell,
    .auth-shell--register {
        width: min(540px, 100%);
        min-height: 0;
        grid-template-columns: 1fr;
        margin: auto;
        border-radius: 28px;
    }

    .auth-showcase {
        display: none;
    }

    .auth-form-panel,
    .auth-shell--register .auth-form-panel {
        padding: 34px 38px 30px;
    }

    .auth-mobile-brand {
        display: inline-flex;
    }

    .auth-brand__mark {
        border: 1px solid #e7eaf2;
        box-shadow: 0 7px 18px rgba(47,43,96,0.1);
    }
}

@media (max-width: 560px) {
    body.auth-page {
        padding: 10px;
        background: linear-gradient(155deg, #292572 0%, #161936 100%);
    }

    .auth-shell,
    .auth-shell--register {
        border-radius: 22px;
    }

    .auth-form-panel,
    .auth-shell--register .auth-form-panel {
        padding: 25px 20px 23px;
    }

    .auth-mobile-brand {
        margin-bottom: 24px;
    }

    .auth-brand__mark {
        width: 39px;
        height: 39px;
        border-radius: 12px;
    }

    .auth-brand__name {
        font-size: 18px;
    }

    .auth-form-heading {
        margin-bottom: 22px;
    }

    .auth-form-heading h2 {
        font-size: 27px;
    }

    .auth-role-card {
        min-height: 58px;
    }
}

@media (max-width: 380px) {
    .auth-role-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell,
    .auth-illustration,
    .auth-orb,
    .auth-password-toggle:hover .auth-eye__visible,
    .auth-password-toggle.is-switching .auth-eye,
    .auth-spinner {
        animation: none !important;
    }

    .auth-submit,
    .auth-input,
    .auth-role-card {
        transition-duration: 0.01ms !important;
    }
}
