/* ═══════════════════════════════════════════════════════════
   USER ACCOUNTS — nav buttons + slide-in Login / Register panel
   (shared by index.html and drawing.html, markup injected by auth.js)
═══════════════════════════════════════════════════════════ */

/* ── Nav buttons (right side) ── */
.nav-auth { display: flex; align-items: center; gap: 0.5rem; }
.nav-auth-btn {
    font-family: 'Share Tech Mono', monospace; font-size: 0.72rem;
    letter-spacing: 0.12em; text-transform: uppercase; line-height: 1;
    padding: 0.42rem 0.8rem; border-radius: 3px; cursor: pointer;
    color: var(--text-main); background: rgba(0,212,255,0.04);
    border: 1px solid rgba(190,190,200,0.22);
    transition: all 0.2s ease; white-space: nowrap;
    max-width: 14ch; overflow: hidden; text-overflow: ellipsis;
}
.nav-auth-btn:hover { color: #fff; border-color: var(--smoke-gray); background: rgba(0,212,255,0.1); }
.nav-auth-btn.primary {
    color: #fff; border-color: rgba(0,212,255,0.55);
    box-shadow: 0 0 10px rgba(0,212,255,0.2);
}
.nav-auth-btn.primary:hover { background: rgba(0,212,255,0.2); }
@media (max-width: 480px) {
    .nav-auth { gap: 0.3rem; }
    .nav-auth-btn { font-size: 0.62rem; padding: 0.38rem 0.5rem; letter-spacing: 0.06em; max-width: 9ch; }
}

/* ── Overlay + panel ── */
.auth-overlay {
    position: fixed; inset: 0; z-index: 990;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.auth-overlay.open { opacity: 1; pointer-events: auto; }
.auth-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1000;
    width: min(400px, 100%); overflow-y: auto;
    padding: 64px 28px 32px;
    background: linear-gradient(160deg, rgba(20,24,34,0.99) 0%, rgba(10,12,18,0.99) 100%);
    border-left: 1px solid rgba(0,212,255,0.3);
    box-shadow: -10px 0 40px rgba(0,0,0,0.6);
    transform: translateX(100%); transition: transform 0.3s ease;
}
.auth-panel.open { transform: translateX(0); }
.auth-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; cursor: pointer;
    color: var(--text-dim); font-size: 1.8rem; line-height: 1;
}
.auth-close:hover { color: #fff; }

/* ── Forms ── */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden], .auth-user[hidden] { display: none; }
.auth-title {
    font-family: 'Share Tech Mono', monospace; font-weight: 400;
    font-size: 1.5rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: #b4f1ff; margin-bottom: 6px;
    text-shadow: 0 0 3px rgba(255,255,255,0.7), 0 0 9px rgba(0,212,255,0.8), 0 0 20px rgba(0,212,255,0.5);
}
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
    font-family: 'Share Tech Mono', monospace; font-size: 0.68rem;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim);
}
.auth-field input {
    font-family: 'Rajdhani', sans-serif; font-size: 1.05rem; font-weight: 600;
    color: #fff; background: rgba(0,0,0,0.35);
    border: 1px solid rgba(190,190,200,0.22); border-radius: 3px;
    padding: 0.6rem 0.75rem; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field input:focus { border-color: var(--neon-blue); box-shadow: 0 0 10px rgba(0,212,255,0.25); }
.auth-consent {
    display: flex; gap: 10px; align-items: flex-start;
    font-size: 0.92rem; line-height: 1.4; color: var(--text-main);
}
.auth-consent input { margin-top: 0.25em; accent-color: var(--neon-blue); flex-shrink: 0; }
.auth-consent a { color: var(--neon-blue); }
.auth-submit {
    margin-top: 6px; min-height: 44px; cursor: pointer;
    font-family: 'Share Tech Mono', monospace; font-size: 0.85rem;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: #fff; background: rgba(0,212,255,0.18);
    border: 1px solid var(--neon-blue); border-radius: 3px;
    box-shadow: 0 0 14px rgba(0,212,255,0.3);
    transition: background 0.2s;
}
.auth-submit:hover { background: rgba(0,212,255,0.3); }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }
.auth-msg { font-size: 0.95rem; line-height: 1.4; min-height: 1.4em; }
.auth-msg.error { color: #ff8a80; }
.auth-msg.ok    { color: #81c784; }
.auth-switch { font-size: 0.95rem; color: var(--text-dim); }
.auth-switch button {
    background: none; border: none; padding: 0; cursor: pointer;
    font: inherit; color: var(--neon-blue); text-decoration: underline;
}

/* ── Logged-in view ── */
.auth-user { display: flex; flex-direction: column; gap: 16px; }
.auth-user-email { font-size: 1.1rem; color: var(--text-main); word-break: break-all; }
