/* ============================================================
   WingNode — Auth pages
   Loaded via @push('head') on login/register/2fa/verify/reset
   Scoped to .wn-auth so it never bleeds into other pages.
   ============================================================ */

.wn-auth {
    --wn-primary:    var(--color-primary, #5b7cff);
    --wn-ai:         #a78bfa;
    --wn-ai-2:       #38bdf8;
    --wn-glow:       rgba(91,124,255,0.22);
    --wn-glow-lg:    rgba(91,124,255,0.12);
    --wn-ai-glow:    rgba(167,139,250,0.22);
    --wn-dim:        rgba(91,124,255,0.10);
    --wn-ai-dim:     rgba(167,139,250,0.10);
    --wn-border:     rgba(255,255,255,0.07);
    --wn-border-hi:  rgba(91,124,255,0.28);
    --wn-border-ai:  rgba(167,139,250,0.30);
    --wn-text-muted: rgba(255,255,255,0.55);
    --wn-text-dim:   rgba(255,255,255,0.32);

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 56px;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}

.wn-auth * { font-family: 'Outfit', sans-serif; }
.wn-auth .wn-mono { font-family: 'JetBrains Mono', monospace; }

/* ── Background orbs + grid ───────────────────────────── */
.wn-auth::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(91,124,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91,124,255,0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.5) 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.5) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.wn-auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    transform: translateZ(0);
}
.wn-auth-orb-1 { width: 520px; height: 400px; top: -120px; left: calc(50% - 260px); background: rgba(91,124,255,0.20); }
.wn-auth-orb-2 { width: 360px; height: 360px; bottom: -120px; right: -100px; background: rgba(167,139,250,0.16); }
.wn-auth-orb-3 { width: 280px; height: 280px; top: 50%; left: -100px; background: rgba(56,189,248,0.10); filter: blur(100px); }

/* ── Card ─────────────────────────────────────────────── */
.wn-auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    padding: 40px 36px 36px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--wn-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 30px 80px rgba(0,0,0,0.5),
        0 0 60px rgba(91,124,255,0.08),
        inset 0 1px 0 rgba(255,255,255,0.06);
}
.wn-auth-card.is-wide { max-width: 640px; }
.wn-auth-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at top, rgba(167,139,250,0.10), transparent 60%);
    pointer-events: none;
}
.wn-auth-card > * { position: relative; z-index: 1; }

@media (max-width: 480px) {
    .wn-auth { padding: 24px 12px 60px; }
    .wn-auth-card { padding: 30px 22px 26px; border-radius: 18px; }
}

/* ── Header ───────────────────────────────────────────── */
.wn-auth-head {
    text-align: center;
    margin-bottom: 26px;
}
/* Boxed context icon — used on 2FA / verify-email / password pages. */
.wn-auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(91,124,255,0.18), rgba(167,139,250,0.18));
    border: 1px solid var(--wn-border-hi);
    box-shadow: 0 0 32px var(--wn-glow);
    margin-bottom: 18px;
}
.wn-auth-logo img,
.wn-auth-logo svg { width: 32px; height: 32px; }

/* Brand mark — used on login / register. Natural aspect, top of stack. */
.wn-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}
.wn-auth-brand img {
    height: 44px;
    width: auto !important;
    max-width: 240px;
    object-fit: contain;
    filter: drop-shadow(0 0 28px rgba(91,124,255,0.45));
}

.wn-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--wn-ai-dim);
    border: 1px solid var(--wn-border-ai);
    color: var(--wn-ai);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.wn-auth-eyebrow-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--wn-ai);
    box-shadow: 0 0 6px var(--wn-ai);
    animation: wn-auth-pulse 2s ease-in-out infinite;
}
@keyframes wn-auth-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.45;transform:scale(.7)} }

.wn-auth-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.025em;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 8px;
}
.wn-auth-title .accent {
    background: linear-gradient(135deg, #a78bfa 0%, #38bdf8 60%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.wn-auth-sub {
    font-size: 13.5px;
    color: var(--wn-text-muted);
    line-height: 1.6;
    max-width: 340px;
    margin: 0 auto;
}

/* ── Form ─────────────────────────────────────────────── */
.wn-auth form .flex.flex-col.gap-2,
.wn-auth form { display: flex; flex-direction: column; gap: 14px; }

/* Override Paymenter generic form input styles inside auth */
.wn-auth fieldset label {
    color: rgba(255,255,255,0.75) !important;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .01em;
    margin-bottom: 6px !important;
}

.wn-auth input[type=text],
.wn-auth input[type=email],
.wn-auth input[type=password],
.wn-auth input[type=tel],
.wn-auth input[type=number] {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid var(--wn-border) !important;
    border-radius: 11px !important;
    color: #fff !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 13px !important;
    padding: 12px 14px !important;
    transition: border-color .2s, box-shadow .2s, background .2s !important;
}
.wn-auth input[type=text]:focus,
.wn-auth input[type=email]:focus,
.wn-auth input[type=password]:focus,
.wn-auth input[type=tel]:focus,
.wn-auth input[type=number]:focus {
    border-color: var(--wn-border-hi) !important;
    background: rgba(91,124,255,0.04) !important;
    box-shadow: 0 0 0 3px rgba(91,124,255,0.10), 0 0 24px rgba(91,124,255,0.08) !important;
    outline: none !important;
}
.wn-auth input::placeholder {
    color: rgba(255,255,255,0.28) !important;
    font-family: 'JetBrains Mono', monospace !important;
}
/* Don't override `background` here — Tailwind Forms uses `background-image`
   for the checked-state SVG checkmark; the shorthand would wipe it out. */
.wn-auth input[type=checkbox] {
    width: 16px !important;
    height: 16px !important;
    border-radius: 4px !important;
    border-color: var(--wn-border) !important;
}
.wn-auth input[type=checkbox]:not(:checked) {
    background-color: rgba(255,255,255,0.03) !important;
}

/* Submit button — `z-index: 5` keeps it above any captcha iframe overflow.
   Turnstile (flexible size) can render an iframe taller than the
   `min-h-[65px]` placeholder and steal pointer events from the button below. */
.wn-auth button[type=submit] {
    position: relative !important;
    z-index: 5 !important;
    background: linear-gradient(135deg, #5b7cff 0%, #7c3aed 100%) !important;
    border: 1px solid rgba(167,139,250,0.30) !important;
    border-radius: 11px !important;
    color: #fff !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: .02em !important;
    padding: 13px 24px !important;
    margin-top: 6px !important;
    box-shadow: 0 0 28px var(--wn-glow), inset 0 1px 0 rgba(255,255,255,0.12) !important;
    transition: transform .15s, box-shadow .2s, opacity .2s !important;
    cursor: pointer !important;
}

/* Constrain Turnstile container so the iframe can't bleed onto siblings */
.wn-auth #cf-turnstile {
    overflow: hidden;
    max-width: 100%;
    isolation: isolate;
}
.wn-auth button[type=submit]:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 0 44px var(--wn-glow), inset 0 1px 0 rgba(255,255,255,0.12) !important;
    opacity: .96 !important;
}
.wn-auth button[type=submit]:disabled {
    opacity: .5 !important;
    transform: none !important;
    cursor: not-allowed !important;
}

/* Forgot password / inline links */
.wn-auth a {
    color: var(--wn-ai);
    text-decoration: none;
    font-weight: 600;
    transition: color .15s;
}
.wn-auth a:hover { color: var(--wn-ai-2); }
.wn-auth label a { color: var(--wn-ai); }

/* ── OAuth divider + buttons ──────────────────────────── */
.wn-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--wn-text-dim);
}
.wn-auth-divider::before,
.wn-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
}

.wn-auth-oauth-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}
.wn-auth-oauth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 11px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--wn-border);
    color: rgba(255,255,255,0.85);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .2s, background .2s, transform .15s;
}
.wn-auth-oauth-btn:hover {
    border-color: var(--wn-border-hi);
    background: rgba(91,124,255,0.06);
    color: #fff !important;
    transform: translateY(-1px);
}
.wn-auth-oauth-btn img { width: 18px; height: 18px; }

/* ── Footer link ──────────────────────────────────────── */
.wn-auth-foot {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--wn-border);
    text-align: center;
    font-size: 13px;
    color: var(--wn-text-muted);
}

/* ── Trust strip below card ───────────────────────────── */
.wn-auth-trust {
    position: relative;
    z-index: 2;
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 11.5px;
    color: var(--wn-text-dim);
    font-weight: 500;
}
.wn-auth-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.wn-auth-trust-item svg {
    width: 13px; height: 13px;
    color: var(--wn-primary);
}

/* ── 2FA ──────────────────────────────────────────────── */
.wn-auth input[name="code"] {
    text-align: center !important;
    letter-spacing: .35em !important;
    font-size: 18px !important;
    padding: 14px !important;
}

/* ── Validation message tint ──────────────────────────── */
.wn-auth .text-red-500 { color: #fca5a5 !important; }

/* ── Wide register grid spacing ───────────────────────── */
.wn-auth-card.is-wide form > .flex.md\:grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 640px) {
    .wn-auth-card.is-wide form > .flex.md\:grid {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wn-auth-eyebrow-dot { animation: none !important; }
}
