/* ── Auth Modal Overlay ───────────────────────────────────────────────────── */
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.auth-modal.is-open { display: flex; }

/* ── Modal card ─────────────────────────────────────────────────────────────── */
.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.08);
    animation: modalSlideUp .25s ease;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.auth-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 32px; height: 32px;
    border: none;
    background: rgba(20, 20, 20, .07);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #141414;
    transition: background .15s;
    line-height: 1;
}
.auth-close:hover { background: rgba(20, 20, 20, .13); }

/* ── Views ──────────────────────────────────────────────────────────────────── */
.auth-view { display: none; }
.auth-view.active { display: block; }

/* ── Logo ───────────────────────────────────────────────────────────────────── */
.auth-logo {
    font-size: 1.375rem;
    font-weight: 900;
    color: #141414;
    letter-spacing: -.02em;
    margin-bottom: 24px;
}

/* ── Title ──────────────────────────────────────────────────────────────────── */
.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #141414;
    margin-bottom: 6px;
    line-height: 1.2;
}
.auth-subtitle {
    font-size: .875rem;
    font-weight: 500;
    color: #888;
    margin-bottom: 28px;
}

/* ── Form fields ────────────────────────────────────────────────────────────── */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.auth-field label {
    font-size: .8125rem;
    font-weight: 700;
    color: #141414;
}
.auth-field input {
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 500;
    color: #141414;
    background: #f5f5f2;
    border: 1.5px solid rgba(20, 20, 20, .12);
    border-radius: 12px;
    padding: 13px 16px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}
.auth-field input:focus {
    border-color: #141414;
    box-shadow: 0 0 0 3px rgba(20, 20, 20, .06);
}

/* ── Error ──────────────────────────────────────────────────────────────────── */
.auth-error {
    font-size: .8125rem;
    font-weight: 600;
    color: #e02020;
    min-height: 18px;
    margin-bottom: 8px;
}

/* ── Submit button ──────────────────────────────────────────────────────────── */
.auth-submit {
    width: 100%;
    padding: 15px;
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 700;
    background: #c1f11d;
    color: #141414;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s, opacity .2s;
    margin-top: 4px;
}
.auth-submit:hover   { background: #b4e018; }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Footer link ────────────────────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: .8125rem;
    font-weight: 500;
    color: #888;
}
.auth-footer button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .8125rem;
    font-weight: 700;
    color: #141414;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
}
.auth-footer button:hover { color: #16a34a; }

/* ── Nav user widget ────────────────────────────────────────────────────────── */
.nav-user-widget {
    display: none;
    align-items: center;
}
.nav-username-link {
    font-size: .875rem;
    font-weight: 700;
    color: #141414;
    text-decoration: none;
    border: 1.5px solid #141414;
    border-radius: 8px;
    padding: 5px 14px;
    transition: background .15s;
    font-family: inherit;
}
.nav-username-link:hover { background: rgba(20, 20, 20, .07); }

@media (max-width: 479px) {
    .auth-card { padding: 28px 20px; border-radius: 16px; }
}
