/* Auth shell — login, register, forgot, reset, verify-email. */

/* Clip the card, not html/body — overflow on the root breaks position:fixed bg. */
body.auth-shell,
body:has(.auth-page) {
    max-width: 100%;
}

/* Same idea as home: nav floats, photo is one continuous layer. */
body.auth-shell .navbar,
body:has(.auth-page) .navbar {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: absolute;
    width: 100%;
}

main.container:has(.auth-page) {
    max-width: 100% !important;
    width: 100%;
    padding: 0 !important;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    align-items: safe center;
    justify-content: center;
    position: relative;
    overflow-x: clip;
}

body.auth-shell .immersive-bg,
body:has(.auth-page) .immersive-bg {
    position: fixed !important;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.38;
    overflow: hidden;
    z-index: -1;
}
body.auth-shell .immersive-bg img,
body:has(.auth-page) .immersive-bg img {
    filter: brightness(0.45) contrast(1.05) saturate(0.85);
    transform: scale(1.06);
}
body.auth-shell .immersive-bg-overlay,
body:has(.auth-page) .immersive-bg-overlay {
    background:
        radial-gradient(ellipse 100% 80% at 50% 100%, rgba(255, 51, 119, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse 90% 70% at 50% 30%, rgba(10, 11, 15, 0.55) 0%, rgba(3, 4, 7, 0.94) 100%);
}

body:has(.auth-page--register) .immersive-bg img {
    filter: brightness(0.42) contrast(1.05) saturate(0.9);
}
body:has(.auth-page--register) .immersive-bg-overlay {
    background:
        radial-gradient(ellipse 100% 75% at 50% 0%, rgba(121, 40, 202, 0.12) 0%, transparent 42%),
        radial-gradient(ellipse 90% 70% at 50% 40%, rgba(10, 11, 15, 0.58) 0%, rgba(3, 4, 7, 0.95) 100%);
}

.auth-page {
    width: 100%;
    max-width: min(440px, 100%);
    margin: 0 auto;
    padding: calc(var(--mgf-navbar-h, 72px) + 1rem) 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    z-index: 2;
    overflow-x: clip;
    box-sizing: border-box;
}

.auth-ambient {
    position: absolute;
    left: 0;
    right: 0;
    top: 42%;
    transform: translateY(-50%);
    width: 100%;
    max-width: 100%;
    height: min(90vh, 640px);
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.auth-ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(56px);
    opacity: 0.32;
}
.auth-ambient-blob--1 {
    width: 200px;
    height: 200px;
    background: var(--sweet-primary);
    top: 0;
    left: 0;
}
.auth-ambient-blob--2 {
    width: 180px;
    height: 180px;
    background: var(--dark-primary);
    bottom: 8%;
    right: 0;
}
.auth-ambient-blob--3 {
    width: 120px;
    height: 120px;
    background: var(--sweet-secondary);
    top: 40%;
    right: 12%;
    opacity: 0.22;
    filter: blur(40px);
}
.auth-page--register .auth-ambient-blob--1 {
    background: var(--dark-primary);
    left: auto;
    right: 0;
}
.auth-page--register .auth-ambient-blob--2 {
    background: var(--sweet-primary);
    right: auto;
    left: 0;
    bottom: 5%;
}
.auth-page--register .auth-ambient-blob--3 {
    background: var(--dark-secondary);
    right: auto;
    left: 18%;
    opacity: 0.2;
    filter: blur(42px);
}
.auth-ambient-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.35;
    -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 45%, #000 0%, transparent 72%);
    mask-image: radial-gradient(ellipse 65% 60% at 50% 45%, #000 0%, transparent 72%);
}

.auth-card {
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 1;
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem 2rem;
    background: rgba(10, 11, 18, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 51, 119, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 51, 119, 0.45), rgba(121, 40, 202, 0.25), transparent 55%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.auth-page--register .auth-card {
    background: rgba(10, 11, 18, 0.75);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(121, 40, 202, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.auth-page--register .auth-card::before {
    background: linear-gradient(135deg, rgba(121, 40, 202, 0.5), rgba(255, 51, 119, 0.22), transparent 60%);
}

.auth-card-inner { position: relative; z-index: 1; }

.auth-card-head {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.auth-page--register .auth-card-head { margin-bottom: 1.5rem; }

.auth-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    text-decoration: none;
    margin: 0;
    letter-spacing: -0.02em;
}
.auth-logo-link .brand-dot { color: var(--sweet-primary); }
.auth-logo-link .brand-ai {
    background: linear-gradient(135deg, var(--sweet-primary), var(--dark-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

.auth-badge-row {
    display: inline-flex;
    align-items: center;
    margin: 0;
    flex-shrink: 0;
}
.auth-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 51, 119, 0.12);
    border: 1px solid rgba(255, 51, 119, 0.28);
    color: var(--sweet-primary);
}
.auth-page--register .auth-badge {
    background: rgba(121, 40, 202, 0.15);
    border-color: rgba(154, 76, 255, 0.35);
    color: var(--dark-secondary);
}

.auth-heading {
    font-size: clamp(1.65rem, 4vw, 2rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}
.auth-heading .grad {
    background: linear-gradient(135deg, #fff 0%, var(--sweet-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-page--register .auth-heading .grad {
    background: linear-gradient(135deg, #fff 0%, var(--dark-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 1.75rem;
}
.auth-page--register .auth-sub {
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
}

.auth-gift {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0.95rem 1.1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.18);
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
}
.auth-gift strong { color: var(--token-color); font-weight: 800; }
.auth-gift-ico { font-size: 1.35rem; line-height: 1; flex-shrink: 0; }

.auth-form .form-group { margin-bottom: 1.15rem; }
.auth-form .form-control {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.08);
    padding: 0.9rem 1.05rem;
    border-radius: var(--radius-md);
}
.auth-form .form-control:focus {
    border-color: rgba(255, 51, 119, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 51, 119, 0.2);
}
.auth-page--register .auth-form .form-control:focus {
    border-color: rgba(154, 76, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(121, 40, 202, 0.22);
}

.pw-strength-bar {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    margin-top: 8px;
    overflow: hidden;
}
.pw-strength-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
    background: linear-gradient(90deg, var(--sweet-primary), var(--dark-primary));
}
.pw-strength-text { font-size: 0.76rem; color: var(--text-muted); margin-top: 5px; }

.auth-submit {
    width: 100%;
    margin-top: 0.35rem;
    padding: 1rem 1.25rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--sweet-primary), var(--dark-primary));
    box-shadow: 0 14px 36px rgba(255, 51, 119, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.1), box-shadow 0.25s;
}
.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(255, 51, 119, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.auth-page--register .auth-submit {
    background: linear-gradient(135deg, var(--dark-primary), var(--sweet-primary));
    box-shadow: 0 14px 36px rgba(121, 40, 202, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.auth-page--register .auth-submit:hover {
    box-shadow: 0 18px 44px rgba(121, 40, 202, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-submit--secondary {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
}
.auth-submit--secondary:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

a.auth-google {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.15rem;
    padding: 0.95rem 1.25rem;
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: #1f1f1f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
a.auth-google:hover {
    background: #f4f4f4;
    color: #1f1f1f;
}
.auth-google-mark { flex: 0 0 auto; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.35rem 0;
    color: var(--text-faint);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.auth-switch {
    text-align: center;
    font-size: 0.92rem;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--sweet-primary);
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.25rem;
    transition: color 0.2s;
}
.auth-switch a:hover { color: var(--sweet-secondary); }
.auth-page--register .auth-switch {
    margin-top: 1.35rem;
}
.auth-page--register .auth-switch a {
    color: var(--dark-secondary);
}

.auth-terms {
    font-size: 0.74rem;
    color: var(--text-faint);
    text-align: center;
    margin-top: 1.1rem;
    line-height: 1.5;
}
.auth-terms a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.auth-terms a:hover { color: var(--text); }

.auth-pills,
.auth-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-perks { gap: 0.45rem; margin-top: 1.35rem; padding-top: 1.2rem; }
.auth-pill,
.auth-perk {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.auth-perk { font-size: 0.72rem; padding: 0.32rem 0.6rem; }

.verify-email-highlight {
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
}

.auth-aside { display: none; }
.auth-shell-grid { display: block; width: 100%; }
.auth-aside-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sweet-primary);
    margin-bottom: 1rem;
}
.auth-page--register .auth-aside-kicker { color: var(--dark-secondary); }

@media (max-width: 480px) {
    .auth-card { padding: 1.75rem 1.35rem 1.65rem; }
}

@media (min-width: 960px) {
    .auth-page:has(.auth-shell-grid) {
        max-width: 1100px;
        width: min(1100px, calc(100% - 4rem));
        padding: calc(var(--mgf-navbar-h, 72px) + 2.25rem) 2rem 4rem;
    }
    .auth-shell-grid {
        display: grid;
        grid-template-columns: minmax(260px, 1fr) minmax(360px, 440px);
        gap: clamp(2rem, 5vw, 4.5rem);
        align-items: center;
    }
    .auth-aside { display: block; }
    .auth-aside .auth-heading {
        font-size: clamp(2.2rem, 4vw, 3.1rem);
        margin-bottom: 0.75rem;
    }
    .auth-aside .auth-sub {
        font-size: 1.05rem;
        margin-bottom: 0;
        max-width: 26rem;
    }
    .auth-aside .auth-pills,
    .auth-aside .auth-perks {
        margin-top: 1.75rem;
        padding-top: 0;
        border-top: none;
    }
    .auth-card-intro,
    .auth-pills--card,
    .auth-perks--card,
    .auth-gift--card { display: none; }
    .auth-aside .auth-gift {
        margin-top: 1.5rem;
        margin-bottom: 0;
    }
    .auth-ambient {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        transform: none;
    }
    .auth-ambient-blob--1 { width: 320px; height: 320px; }
    .auth-ambient-blob--2 { width: 280px; height: 280px; }
}
