/* ================================================================
   Auth gate — the sign-in / sign-up overlay on the main page.
   Built on the same tokens as gameverse.css so it feels native.
   ================================================================ */

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* While the gate is up the page underneath must not be usable. */
body.auth-locked {
    overflow: hidden;
}

body.auth-locked .navbar,
body.auth-locked .main-content {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 34px 32px 30px;
    border: 1px solid var(--border-color-strong, rgba(255, 255, 255, 0.2));
    border-radius: 18px;
    background: linear-gradient(180deg, #141418 0%, #0b0b0d 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75);
    transform: translateY(14px) scale(0.98);
    transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.auth-overlay.is-open .auth-card {
    transform: translateY(0) scale(1);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-brand i {
    font-size: 1.1rem;
    opacity: 0.85;
}

.auth-card h2 {
    margin: 20px 0 6px;
    font-size: 1.45rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.auth-sub {
    margin: 0 0 22px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary, #9a9a9f);
}

/* ---------------------------------------------------------- tabs */

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.auth-tab {
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary, #9a9a9f);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 550;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab:hover {
    color: #fff;
}

.auth-tab.active {
    background: #fff;
    color: #000;
}

/* --------------------------------------------------------- fields */

.auth-field {
    margin-bottom: 14px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 550;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary, #9a9a9f);
}

.auth-field input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font: inherit;
    font-size: 0.93rem;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-field input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.07);
}

.auth-hint {
    margin: 6px 2px 0;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.38);
}

/* -------------------------------------------------------- buttons */

.auth-submit {
    width: 100%;
    margin-top: 8px;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #000;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 650;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.12s ease;
}

.auth-submit:hover:not(:disabled) {
    opacity: 0.88;
}

.auth-submit:active:not(:disabled) {
    transform: scale(0.99);
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: progress;
}

/* -------------------------------------------------------- message */

.auth-message {
    display: none;
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.45;
}

.auth-message.show {
    display: block;
}

.auth-message.error {
    border-color: rgba(255, 86, 86, 0.35);
    background: rgba(255, 86, 86, 0.1);
    color: #ff9a9a;
}

.auth-message.success {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(74, 222, 128, 0.1);
    color: #86efac;
}

.auth-message.info {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary, #9a9a9f);
}

/* ------------------------------------------------- signed-in chip */

.auth-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    white-space: nowrap;
}

.auth-chip-name {
    font-weight: 550;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-chip button {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, #9a9a9f);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.auth-chip button:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

@media (max-width: 520px) {
    .auth-card {
        padding: 26px 20px 24px;
    }
    .auth-chip-name {
        display: none;
    }
}
