/**
 * Nexora — login / signup pages.
 */

body.nex-auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    font-family: var(--font-body);
    color: #E2E8F0;
    padding: 1.25rem 1rem 2rem;
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(109, 40, 217, 0.42), transparent 58%),
        radial-gradient(720px 380px at 92% 8%, rgba(79, 70, 229, 0.32), transparent 55%),
        radial-gradient(640px 320px at 50% 110%, rgba(14, 165, 233, 0.12), transparent 50%),
        #050A14;
    -webkit-font-smoothing: antialiased;
}

body.nex-auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
    opacity: 0.55;
}

.nex-auth-shell {
    width: min(440px, 100%);
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1rem;
}

.nex-auth-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #F8FAFC;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.04em;
    font-size: 1.05rem;
    justify-self: center;
    transition: opacity 0.15s ease;
}

.nex-auth-brand-link:hover {
    opacity: 0.88;
}

.nex-auth-brand-link img {
    width: 36px;
    height: 36px;
    display: block;
}

.nex-auth-card {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: var(--nex-text);
    border-radius: 22px;
    padding: 1.65rem 1.55rem 1.45rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65) inset,
        0 24px 64px rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.55);
    animation: nex-auth-rise 0.45s ease both;
}

@keyframes nex-auth-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nex-auth-card-head {
    margin-bottom: 1.15rem;
}

.nex-auth-card h1 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3.5vw, 1.55rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #0F172A;
}

.nex-auth-card .nex-auth-lead {
    margin: 0;
    color: var(--nex-text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.nex-auth-card label:not(.nex-auth-agree) {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #1E293B;
}

.nex-auth-card input[type="email"],
.nex-auth-card input[type="password"],
.nex-auth-card input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.78rem 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 11px;
    margin-bottom: 0.9rem;
    font: inherit;
    background: #F8FAFC;
    color: #0F172A;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    min-height: 46px;
}

.nex-auth-card input[type="email"]:focus,
.nex-auth-card input[type="password"]:focus,
.nex-auth-card input[type="text"]:focus {
    outline: none;
    background: #fff;
    border-color: rgba(109, 40, 217, 0.45);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.14);
}

.nex-auth-card input::placeholder {
    color: #94A3B8;
}

.nex-auth-card .nex-btn,
.nex-auth-card a.nex-btn,
.nex-auth-card button.nex-btn {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 46px;
    box-sizing: border-box;
    margin: 0;
    float: none;
    position: relative;
}

.nex-auth-card .nex-btn.nex-btn-primary,
.nex-auth-submit {
    background: var(--nex-gradient, linear-gradient(135deg, #6D28D9, #4F46E5));
    color: #fff;
    border: none;
    box-shadow: 0 10px 22px rgba(109, 40, 217, 0.28);
    font-weight: 700;
}

.nex-auth-card .nex-btn.nex-btn-primary:hover,
.nex-auth-submit:hover {
    box-shadow: 0 14px 28px rgba(109, 40, 217, 0.36);
}

.nex-auth-card .nex-btn:disabled,
.nex-auth-card .nex-btn.is-disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
    box-shadow: none;
}

.nex-auth-error {
    margin: 0 0 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 11px;
    background: #FEF2F2;
    color: #B91C1C;
    font-size: 0.88rem;
    line-height: 1.45;
    border: 1px solid #FECACA;
}

.nex-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.05rem 0;
    color: var(--nex-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nex-auth-divider::before,
.nex-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(15, 23, 42, 0.1);
}

.nex-auth-sso-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.15rem;
}

.nex-auth-sso-stack > a.nex-btn {
    flex: 0 0 auto;
    align-self: stretch;
}

.nex-btn-google {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: var(--nex-text);
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-decoration: none;
    min-height: 46px;
    font-weight: 700;
}

.nex-btn-google:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.nex-btn-google svg {
    flex-shrink: 0;
}

.nex-btn-discord {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #5865F2;
    color: #fff;
    border: 1px solid #4752C4;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-decoration: none;
    min-height: 46px;
    font-weight: 700;
}

.nex-btn-discord:hover {
    background: #4752C4;
    transform: translateY(-1px);
}

.nex-btn-discord svg {
    flex-shrink: 0;
}

.nex-auth-agree {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0 0 1rem;
    padding: 0.8rem 0.85rem;
    border-radius: 12px;
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.08);
    cursor: pointer;
    font-size: 0.84rem;
    line-height: 1.45;
    color: #334155;
    font-weight: 500;
}

.nex-auth-agree:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.16);
    border-color: rgba(109, 40, 217, 0.35);
}

.nex-auth-agree input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0.1rem 0 0;
    flex-shrink: 0;
    accent-color: #6D28D9;
    cursor: pointer;
}

.nex-auth-agree a {
    color: var(--nex-primary, #6D28D9);
    font-weight: 700;
    text-decoration: none;
}

.nex-auth-agree a:hover {
    text-decoration: underline;
}

.nex-auth-agree-hint {
    margin: -0.45rem 0 0.95rem;
    font-size: 0.78rem;
    color: #B91C1C;
    display: none;
}

.nex-auth-agree-hint.is-visible {
    display: block;
}

.nex-auth-footer {
    margin-top: 1.15rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--nex-text-muted);
}

.nex-auth-footer a {
    color: var(--nex-primary, #6D28D9);
    font-weight: 700;
    text-decoration: none;
}

.nex-auth-footer a:hover {
    text-decoration: underline;
}

.nex-auth-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.95rem;
    font-size: 0.8rem;
}

.nex-auth-legal-links a {
    color: #94A3B8;
    text-decoration: none;
    font-weight: 600;
}

.nex-auth-legal-links a:hover {
    color: #E2E8F0;
    text-decoration: underline;
}

.nex-auth-field-note {
    font-weight: 500;
    opacity: 0.65;
}

@media (max-width: 420px) {
    .nex-auth-card {
        padding: 1.35rem 1.15rem 1.25rem;
        border-radius: 18px;
    }

    .nex-auth-agree {
        font-size: 0.8rem;
    }
}
