/* Auth surfaces. Loaded only on login, registration, and password reset. */

@view-transition { navigation: auto; }

.auth-body {
    background: #f4f7fb;
    color: var(--ink);
    height: 100dvh;
    overflow: hidden;
}

.auth-body .auth-wrap {
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
}

.auth-body .auth-side {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 0;
    height: 100%;
    max-height: 100dvh;
    padding: 2.25rem 2.75rem 2rem;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(90% 70% at 100% 0%, rgba(59, 130, 246, .42), transparent 58%),
        radial-gradient(70% 55% at 0% 100%, rgba(109, 93, 251, .28), transparent 62%),
        linear-gradient(165deg, #07111f 0%, #0b1730 48%, #123a8c 145%) !important;
}

.auth-body .auth-side::before,
.auth-body .auth-side::after { content: none; }

.auth-sky { position: absolute; inset: 0; pointer-events: none; z-index: 0; }

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
}

.auth-orb-a {
    width: 320px;
    height: 320px;
    right: -80px;
    top: 8%;
    background: radial-gradient(circle, rgba(59, 130, 246, .5), transparent 68%);
    animation: authDrift 18s ease-in-out infinite;
}

.auth-orb-b {
    width: 220px;
    height: 220px;
    left: -40px;
    bottom: 18%;
    background: radial-gradient(circle, rgba(167, 196, 255, .28), transparent 70%);
    animation: authDrift 22s ease-in-out infinite reverse;
}

.auth-orb-c {
    width: 140px;
    height: 140px;
    right: 18%;
    bottom: 8%;
    background: radial-gradient(circle, rgba(109, 93, 251, .35), transparent 70%);
    animation: authDrift 14s ease-in-out infinite;
}

.auth-beam {
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -30%;
    width: 38%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
    transform: rotate(16deg);
    animation: authSweep 11s ease-in-out infinite;
}

.auth-side-logo,
.auth-stage,
.auth-side-copy { position: relative; z-index: 1; flex-shrink: 0; }

.auth-side-logo { display: inline-flex; width: max-content; }
.auth-side-logo img { height: 34px; width: auto; display: block; }

.auth-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    align-content: center;
}

.auth-glass {
    width: min(100%, 460px);
    padding: 1.15rem 1.2rem 1.35rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.auth-glass-bar { display: flex; gap: .4rem; margin-bottom: .35rem; }
.auth-glass-bar span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
}
.auth-glass-bar span:first-child { background: #7eb0ff; }

.auth-art { width: 100%; height: auto; display: block; }

.auth-spark {
    stroke-dasharray: 460;
    stroke-dashoffset: 460;
    animation: authDraw 2.4s var(--ease-lux) .25s forwards;
}

.auth-float {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: -1.4rem;
    margin-left: auto;
    margin-right: 6%;
    padding: .7rem .9rem .7rem .75rem;
    width: max-content;
    max-width: calc(100% - 1.5rem);
    border-radius: 16px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 16px 30px -20px rgba(0, 0, 0, .5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: authFloat 7s ease-in-out infinite;
}

.auth-float i {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .12);
    color: #dcebff;
}

.auth-float strong,
.auth-float span { display: block; line-height: 1.25; }
.auth-float strong { font-size: .84rem; font-weight: 700; letter-spacing: -.02em; }
.auth-float span { font-size: .72rem; color: rgba(226, 236, 252, .72); }

.auth-side-kicker {
    margin: 0 0 .7rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #9ec0ff !important;
}

.auth-display {
    margin: 0;
    max-width: 10.5em;
    font-size: clamp(2.15rem, 3.2vw, 3.25rem);
    font-weight: 650;
    line-height: 1.05;
    letter-spacing: -.045em;
    color: #fff;
}

.auth-side-lede {
    margin: 1rem 0 0;
    max-width: 28rem;
    color: rgba(226, 236, 252, .74);
    font-size: 1.02rem;
    line-height: 1.5;
}

.auth-body .auth-main {
    min-height: 0;
    height: 100%;
    max-height: 100dvh;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    padding: 2.5rem 1.75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        radial-gradient(80% 46% at 100% 0%, rgba(59, 130, 246, .13), transparent 56%),
        radial-gradient(55% 40% at 0% 100%, rgba(109, 93, 251, .07), transparent 62%),
        #f4f7fb;
}

.auth-body .auth-card {
    width: min(100%, 440px);
    max-width: none;
    margin: 0;
    padding: 2rem 2rem 1.55rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .85),
        0 30px 70px -36px rgba(16, 24, 48, .42),
        0 10px 24px -16px rgba(16, 24, 48, .18);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    view-transition-name: auth-card;
    contain: inline-size;
}

.auth-body .auth-card-wide { width: min(100%, 480px); }

.auth-body .auth-brand { display: inline-flex; margin: 0 0 1.35rem; }
.auth-body .auth-brand .logo { height: 30px; width: auto; }

.auth-body .auth-title {
    margin: 0 0 .4rem;
    font-size: clamp(1.7rem, 2vw, 1.95rem);
    font-weight: 720;
    letter-spacing: -.042em;
    line-height: 1.1;
    color: var(--ink);
}

.auth-body .auth-lede {
    margin: 0 0 1.35rem;
    max-width: 34rem;
    color: var(--n-600);
    font-size: .94rem;
    line-height: 1.5;
}

.auth-form { display: flex; flex-direction: column; gap: .95rem; min-width: 0; }

.auth-field { min-width: 0; }

.auth-label {
    display: block;
    margin: 0 0 .4rem;
    font-size: .8rem;
    font-weight: 680;
    letter-spacing: -.01em;
    color: var(--n-700);
    transition: color .16s ease;
}

.auth-field:focus-within .auth-label { color: var(--primary); }

.auth-control {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 50px;
    padding: 0 .3rem 0 .95rem;
    border-radius: 14px;
    border: 1px solid rgba(17, 24, 39, .1);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.auth-control:focus-within {
    border-color: #1d4ed8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 78, 216, .12);
}

.auth-control:has(.is-invalid) {
    border-color: #d64545;
    box-shadow: 0 0 0 4px rgba(214, 69, 69, .12);
}

.auth-input {
    flex: 1 1 0%;
    width: 1%;
    min-width: 0;
    max-width: 100%;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    box-shadow: none !important;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: -.01em;
}

.auth-input::placeholder { color: #98a2b3; }

.auth-select {
    appearance: none;
    padding-right: 1.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .15rem center;
    cursor: pointer;
}

.auth-eye {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--n-500);
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.auth-eye:hover { color: var(--ink); background: rgba(17, 24, 39, .045); }
.auth-eye:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 1px; }
.auth-eye[aria-pressed="true"] { color: var(--primary); }
.auth-eye i { font-size: 1.05rem; transition: opacity .16s ease, transform .16s var(--ease-lux); }
.auth-eye[aria-pressed="true"] i { transform: scale(.92); }

.auth-hint {
    margin: .4rem 0 0;
    color: var(--n-500);
    font-size: .75rem;
    line-height: 1.4;
}

.auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    margin-top: -.15rem;
    min-width: 0;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: 0;
    min-height: 44px;
    color: var(--n-700);
    font-size: .88rem;
    font-weight: 550;
    line-height: 1.4;
    cursor: pointer;
}

.auth-meta .auth-check { min-height: 0; align-items: center; }

.auth-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    margin: .12rem 0 0;
    flex: 0 0 auto;
    border-radius: 6px;
    border: 1.5px solid rgba(17, 24, 39, .22);
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.auth-meta .auth-check input { margin-top: 0; }

.auth-check input:checked {
    border-color: var(--primary);
    background-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.2 6.2l2.4 2.4 5.2-5.3'/%3E%3C/svg%3E");
}

.auth-check input:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.auth-check a { font-weight: 700; color: var(--primary); text-underline-offset: 2px; }

.auth-text-link {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: .84rem;
    font-weight: 680;
    text-decoration: none;
}

.auth-text-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: 100%;
    min-height: 52px;
    margin-top: .15rem;
    padding: .75rem 1.1rem;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 720;
    letter-spacing: -.02em;
    cursor: pointer;
    box-shadow: 0 14px 28px -14px rgba(29, 78, 216, .85), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .16s var(--ease-lux), box-shadow .16s ease, filter .16s ease, background .2s ease;
}

.auth-submit:hover {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 18px 32px -14px rgba(29, 78, 216, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.auth-submit:active { transform: translateY(0); filter: none; }

.auth-submit:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 3px;
}

.auth-submit:disabled { cursor: progress; transform: none; filter: saturate(.9); }
.auth-submit .spinner-border { width: .95rem; height: .95rem; border-width: .14em; }

.auth-submit.is-success {
    background: linear-gradient(180deg, #1aaf70 0%, #0d8a50 100%);
    box-shadow: 0 14px 28px -14px rgba(22, 155, 98, .8);
}

.auth-submit.is-success i { animation: authPop .32s var(--ease-lux) both; }

.auth-success {
    margin: .15rem 0 0;
    padding: .8rem .9rem;
    border-radius: 14px;
    background: var(--success-soft);
    color: var(--success-dark);
    border: 1px solid rgba(22, 155, 98, .16);
    font-size: .86rem;
    font-weight: 650;
    line-height: 1.45;
    animation: authIn .35s var(--ease-lux) both;
}

.auth-divider {
    height: 1px;
    margin: 1.25rem 0 1rem;
    border: 0;
    background: linear-gradient(90deg, transparent, rgba(17, 24, 39, .12), transparent);
}

.auth-switch {
    margin: 0;
    text-align: center;
    color: var(--n-600);
    font-size: .92rem;
}

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

.auth-switch a:hover { text-decoration: underline; text-underline-offset: 2px; }

.auth-quiet {
    margin: .7rem 0 0;
    text-align: center;
    font-size: .8rem;
}

.auth-quiet a { color: var(--n-500); font-weight: 600; text-decoration: none; }
.auth-quiet a:hover { color: var(--n-700); text-decoration: underline; text-underline-offset: 2px; }

.auth-body .auth-alert,
.auth-body .form-alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: 0 0 1rem;
    padding: .8rem .9rem;
    border: 1px solid rgba(214, 69, 69, .18);
    border-radius: 14px;
    background: #fdeaea;
    color: #9f2c2c;
    font-size: .84rem;
    font-weight: 640;
    line-height: 1.45;
}

.auth-body .auth-alert i { margin-top: .08rem; flex-shrink: 0; }

.auth-body .invalid-feedback {
    display: block;
    margin: .38rem .1rem 0;
    color: #b42318;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.auth-body .pwa-install-card { margin-bottom: 1.1rem; }

@media (max-width: 1199.98px) {
    .auth-body .auth-side { padding: 1.75rem 1.6rem 1.5rem; }
    .auth-display { font-size: 2.2rem; }
    .auth-float { display: none; }
}

@media (max-height: 860px) and (min-width: 992px) {
    .auth-body .auth-side { gap: .85rem; padding-top: 1.25rem; padding-bottom: 1.15rem; }
    .auth-display { font-size: 1.9rem; max-width: 12em; }
    .auth-art { max-height: 140px; }
    .auth-float { display: none; }
    .auth-side-lede { margin-top: .5rem; font-size: .92rem; }
}

@media (max-width: 991.98px) {
    .auth-body .auth-wrap { grid-template-columns: minmax(0, 1fr); }
    .auth-body .auth-side { display: none; }
    .auth-body .auth-main {
        align-items: stretch;
        padding:
            max(1.15rem, env(safe-area-inset-top))
            max(1rem, env(safe-area-inset-right))
            max(1.35rem, env(safe-area-inset-bottom))
            max(1rem, env(safe-area-inset-left));
        background:
            radial-gradient(90% 28% at 50% 0%, rgba(59, 130, 246, .16), transparent 70%),
            #f4f7fb;
    }
.auth-body .auth-card,
    .auth-body .auth-card-wide {
        width: 100%;
        max-width: 100%;
        padding: 1.3rem 1.05rem 1.15rem;
        border-radius: 22px;
    }
    .auth-lede,
    .auth-switch,
    .auth-quiet { overflow-wrap: break-word; }
    .auth-body .auth-brand { margin-bottom: 1.15rem; }
    .auth-body .auth-title { font-size: 1.65rem; }
    .auth-body .auth-lede { margin-bottom: 1.15rem; font-size: .9rem; }
    .auth-eye { width: 44px; height: 44px; }
    .auth-submit { min-height: 52px; }
    .auth-switch a,
    .auth-text-link { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (min-width: 560px) and (max-width: 991.98px) {
    .auth-body .auth-main { align-items: center; }
    .auth-body .auth-card,
    .auth-body .auth-card-wide { width: min(100%, 480px); }
}

@media (prefers-reduced-motion: no-preference) {
    .auth-body .auth-card { animation: authIn .55s var(--ease-lux) both; }
    .auth-body .auth-side-copy,
    .auth-body .auth-stage { animation: authIn .7s var(--ease-lux) .06s both; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-orb,
    .auth-beam,
    .auth-spark,
    .auth-float,
    .auth-body .auth-card,
    .auth-body .auth-side-copy,
    .auth-body .auth-stage,
    .auth-submit.is-success i,
    .auth-success { animation: none !important; }
    .auth-spark { stroke-dashoffset: 0; }
    .auth-submit:hover { transform: none; }
}

@keyframes authIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes authDrift {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(14px, -16px, 0); }
}

@keyframes authSweep {
    0%, 100% { transform: translateX(0) rotate(16deg); opacity: .35; }
    50% { transform: translateX(220%) rotate(16deg); opacity: .75; }
}

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

@keyframes authDraw { to { stroke-dashoffset: 0; } }

@keyframes authPop {
    from { opacity: 0; transform: scale(.6); }
    to { opacity: 1; transform: none; }
}
