/* ═══════════════════════════════════════════════════════════════
   auth.css — NolimitCloud auth page (login + register)
   Split-card layout on desktop, unboxed Cloudflare-style layout on mobile
   ═══════════════════════════════════════════════════════════════ */

/* ── Page shell ──────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c0c0e;
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

.auth-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ── Mobile header & titles (hidden on desktop) ───────────────── */
.auth-mobile-header {
    display: none;
}
.auth-mobile-title {
    display: none;
}

/* ── Desktop Split card ───────────────────────────────────────── */
.auth-split {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 270px 1fr;
    width: 100%;
    max-width: 780px;
    background: rgba(255,255,255,0.028);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 30px 80px rgba(0,0,0,0.65);
    animation: aSplitIn .55s cubic-bezier(.22,1,.36,1) both;
}
@keyframes aSplitIn {
    from { opacity:0; transform: translateY(28px) scale(.98); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}

/* ── Left — brand panel ─────────────────────────────────────── */
.auth-brand-panel {
    position: relative;
    padding: 2.25rem 1.75rem;
    background: linear-gradient(155deg,
        rgba(140,82,255,.2) 0%,
        rgba(88,101,242,.08) 55%,
        transparent 100%);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.auth-brand-panel::after {
    content: '';
    position: absolute;
    top: -100px; left: -100px;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(140,82,255,.22) 0%, transparent 65%);
    pointer-events: none;
}
.auth-bp-logo {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 2.25rem;
    position: relative;
    z-index: 1;
}
.auth-bp-logo img {
    width: 26px; height: 26px;
    border-radius: 7px;
    object-fit: contain;
}
.auth-bp-logo span {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}
.auth-bp-headline {
    position: relative;
    z-index: 1;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.04em;
    color: #fff;
    margin-bottom: .65rem;
}
.auth-bp-headline em {
    font-style: normal;
    color: #a78bfa;
}
.auth-bp-sub {
    position: relative;
    z-index: 1;
    font-size: .78rem;
    color: rgba(255,255,255,.42);
    line-height: 1.6;
    margin-bottom: auto;
}
.auth-bp-features {
    position: relative;
    z-index: 1;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.auth-bp-feat {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .75rem;
    color: rgba(255,255,255,.45);
}
.auth-bp-feat i {
    color: #8c52ff;
    font-size: .65rem;
    width: 13px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Right — form panel ─────────────────────────────────────── */
.auth-form-panel {
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Tab switcher ────────────────────────────────────────────── */
.auth-tabs {
    position: relative;
    display: flex;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.065);
    border-radius: 11px;
    padding: 4px;
    margin-bottom: 1.5rem;
}
.auth-tab-pill {
    position: absolute;
    inset: 4px auto 4px 4px;
    width: calc(50% - 4px);
    background: #8c52ff;
    border-radius: 8px;
    box-shadow: 0 2px 14px rgba(140,82,255,.45);
    transition: transform .32s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
}
.auth-tab-pill.on-reg { transform: translateX(100%); }
.auth-tab-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: .56rem 1rem;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,.42);
    font-size: .84rem;
    font-weight: 600;
    font-family: var(--font-primary, 'Space Grotesk', sans-serif);
    cursor: pointer;
    transition: color .22s;
    letter-spacing: .01em;
}
.auth-tab-btn.is-active { color: #fff; }
.auth-tab-btn:focus { outline: none; }
.auth-tab-btn::-moz-focus-inner { border: 0; }

/* ── OAuth buttons ───────────────────────────────────────────── */
.auth-oauth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
    margin-bottom: .65rem;
}
.auth-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .58rem .875rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.085);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,.82);
    font-size: .8rem;
    font-weight: 600;
    font-family: var(--font-primary, 'Space Grotesk', sans-serif);
    text-decoration: none;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .18s;
    white-space: nowrap;
}
.auth-oauth-btn:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.16);
    transform: translateY(-1px);
}
.auth-oauth-btn.aob-discord { border-color: rgba(88,101,242,.3); }
.auth-oauth-btn.aob-discord:hover { background: rgba(88,101,242,.12); border-color: rgba(88,101,242,.5); }
.auth-oauth-btn.aob-github:hover  { background: rgba(255,255,255,.05); }
.auth-oauth-btn.aob-google:hover  { background: rgba(255,255,255,.05); }
.auth-oauth-btn.aob-full { grid-column: 1 / -1; }

/* ── Separator ───────────────────────────────────────────────── */
.auth-or {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .75rem 0;
    color: rgba(255,255,255,.18);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.auth-or::before, .auth-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.07);
}

/* ── Views (login / register) ───────────────────────────────── */
.auth-view { display: none; }
.auth-view.is-active {
    display: block;
    animation: aViewIn .28s ease both;
}
@keyframes aViewIn {
    from { opacity:0; transform:translateX(8px); }
    to   { opacity:1; transform:translateX(0); }
}

/* ── Form ────────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}
.auth-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: .28rem;
}
.auth-lbl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.auth-lbl {
    font-size: .72rem;
    font-weight: 700;
    color: rgba(255,255,255,.5);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.auth-link-sm {
    font-size: .72rem;
    color: #8c52ff;
    font-weight: 500;
    text-decoration: none;
    transition: color .18s;
}
.auth-link-sm:hover { color: #a78bfa; }

/* Inputs */
.auth-input, .auth-select {
    width: 100%;
    padding: .68rem .875rem;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    color: #fff;
    font-size: .88rem;
    font-family: var(--font-primary, 'Space Grotesk', sans-serif);
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}
.auth-input::placeholder { color: rgba(255,255,255,.2); }
.auth-input:focus, .auth-select:focus {
    border-color: #8c52ff;
    background: rgba(140,82,255,.07);
    box-shadow: 0 0 0 3px rgba(140,82,255,.14);
}
.auth-input.a-pr { padding-right: 2.75rem; }

.auth-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='rgba(255,255,255,0.28)' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.25rem;
}
.auth-select option { background: #17171f; }

/* Input wrapper for eye toggle */
.auth-iw {
    position: relative;
}
.auth-toggle-eye {
    position: absolute;
    right: .8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,.28);
    cursor: pointer;
    padding: 0;
    font-size: .82rem;
    line-height: 1;
    transition: color .18s;
}
.auth-toggle-eye:hover { color: rgba(255,255,255,.65); }

/* Email + send code */
.auth-email-row {
    display: flex;
    gap: .45rem;
}
.auth-email-row .auth-input { flex: 1; min-width: 0; }
.auth-send-btn {
    flex-shrink: 0;
    padding: 0 .875rem;
    background: rgba(140,82,255,.15);
    border: 1px solid rgba(140,82,255,.28);
    border-radius: 8px;
    color: #a78bfa;
    font-size: .72rem;
    font-weight: 700;
    font-family: var(--font-primary, 'Space Grotesk', sans-serif);
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, border-color .18s;
    letter-spacing: .02em;
}
.auth-send-btn:hover:not(:disabled) {
    background: rgba(140,82,255,.26);
    border-color: rgba(140,82,255,.5);
}
.auth-send-btn:disabled { opacity: .38; cursor: not-allowed; }

/* Status line */
.auth-hint {
    font-size: .72rem;
    color: rgba(255,255,255,.35);
    margin-top: .1rem;
    min-height: .9em;
    line-height: 1.4;
}
.auth-hint.ok  { color: #4ade80; }
.auth-hint.err { color: #f87171; }

/* TOS */
.auth-tos-wrap {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    cursor: pointer;
}
.auth-tos-wrap input[type=checkbox] {
    flex-shrink: 0;
    margin-top: .18rem;
    accent-color: #8c52ff;
    width: 14px; height: 14px;
    cursor: pointer;
}
.auth-tos-txt {
    font-size: .75rem;
    color: rgba(255,255,255,.35);
    line-height: 1.5;
}
.auth-tos-txt a { color: rgba(140,82,255,.8); text-decoration: none; transition: color .18s; }
.auth-tos-txt a:hover { color: #a78bfa; }

/* Submit button */
.auth-submit {
    width: 100%;
    padding: .78rem 1.5rem;
    background: #8c52ff;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    font-family: var(--font-primary, 'Space Grotesk', sans-serif);
    letter-spacing: .02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .22s, box-shadow .22s;
    margin-top: .2rem;
}
.auth-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(130deg, rgba(255,255,255,.13) 0%, transparent 55%);
    opacity: 0;
    transition: opacity .2s;
}
.auth-submit:hover::after { opacity: 1; }
.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(140,82,255,.48);
}
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled {
    opacity: .42;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Bottom note */
.auth-foot {
    text-align: center;
    margin-top: .875rem;
    font-size: .75rem;
    color: rgba(255,255,255,.28);
}
.auth-foot a { color: #8c52ff; font-weight: 600; text-decoration: none; transition: color .18s; }
.auth-foot a:hover { color: #a78bfa; }

/* Inline alert */
.auth-msg {
    padding: .6rem .875rem;
    border-radius: 8px;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    animation: aViewIn .22s ease both;
}
.auth-msg.is-err  { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.22); color: #fca5a5; }
.auth-msg.is-ok   { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.18); color: #86efac; }

/* ── Responsive (Cloudflare-style unboxed layout for Mobile) ─── */
@media (max-width: 720px) {
    .auth-page {
        padding: 0;
        align-items: flex-start;
        background: #0c0c0e;
    }

    .auth-container {
        width: 100%;
        min-height: 100vh;
        justify-content: flex-start;
    }

    /* Top bar on mobile with logo on left, Sign up / Sign in on right */
    .auth-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem 1.25rem 0.5rem 1.25rem;
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
    }

    .auth-mobile-logo {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        font-weight: 700;
        font-size: 1.05rem;
        color: #fff;
        letter-spacing: -0.02em;
    }

    .auth-mobile-logo img {
        width: 28px;
        height: 28px;
        border-radius: 7px;
        object-fit: contain;
    }

    .auth-mobile-action-btn {
        padding: 0.45rem 1.1rem;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        background: rgba(255, 255, 255, 0.04);
        color: #fff;
        font-size: 0.85rem;
        font-weight: 600;
        font-family: var(--font-primary, 'Space Grotesk', sans-serif);
        cursor: pointer;
        transition: all 0.2s;
    }

    .auth-mobile-action-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.28);
    }
    .auth-mobile-action-btn:focus { outline: none; }

    /* Unbox the card container on mobile */
    .auth-split {
        grid-template-columns: 1fr;
        max-width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        animation: none;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 1.25rem 1.25rem 2.5rem 1.25rem;
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
    }

    /* Desktop tabs hidden on mobile in favor of top-right header action button */
    .auth-tabs {
        display: none;
    }

    /* Display clean titles on mobile */
    .auth-mobile-title {
        display: block;
        font-size: 1.65rem;
        font-weight: 700;
        color: #fff;
        margin-bottom: 1.5rem;
        letter-spacing: -0.035em;
        line-height: 1.2;
    }

    .auth-oauth-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.5rem;
        margin-bottom: 0.85rem;
    }

    .auth-oauth-btn {
        padding: 0.65rem 0.5rem;
        font-size: 0.82rem;
    }

    .auth-oauth-btn.aob-full {
        grid-column: span 1;
    }

    .auth-input, .auth-select {
        padding: 0.75rem 0.9rem;
        font-size: 0.95rem;
        border-radius: 8px;
    }

    .auth-submit {
        padding: 0.85rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 8px;
        margin-top: 0.5rem;
    }

    .auth-foot {
        margin-top: 1.25rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 440px) {
    .auth-oauth-grid {
        grid-template-columns: 1fr;
    }
    .auth-2col {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }
}
