/**
 * Algorithm Auth — UI Styles
 * All styles previously inlined in auth.js innerHTML.
 * Load this BEFORE auth.js on every page that uses auth.
 */

/* ═══════════════════════════════════════════════════════════════════
   VERIFICATION BANNER (after email verification)
   ═══════════════════════════════════════════════════════════════════ */
.algo-verify-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    text-align: center;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.algo-verify-banner__close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.8;
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════════
   ANNOUNCEMENT BAR (site-wide announcement)
   ═══════════════════════════════════════════════════════════════════ */
.algo-announcement-bar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    text-align: center;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-family: var(--font-body);
    position: relative;
    z-index: 100;
}
.algo-announcement-bar__close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.7;
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════
   USER BADGE (credits display in header when logged in)
   ═══════════════════════════════════════════════════════════════════ */
.algo-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
    cursor: pointer;
    position: relative;
}
.algo-user-badge__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(99, 102, 241, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #a78bfa;
}
.algo-user-badge__name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}
.algo-user-badge__credits {
    font-size: 0.68rem;
    font-weight: 600;
}
.algo-user-badge__credits--green  { color: #34d399; }
.algo-user-badge__credits--yellow { color: #fbbf24; }
.algo-user-badge__credits--red    { color: #f87171; }
.algo-user-badge__credits--purple { color: #a78bfa; }

/* ═══════════════════════════════════════════════════════════════════
   USER DROPDOWN (click on badge)
   ═══════════════════════════════════════════════════════════════════ */
.algo-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px;
    min-width: 160px;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.algo-user-dropdown__email {
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #9ca3af;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}
.algo-user-dropdown__link,
.algo-user-dropdown__logout {
    display: block;
    padding: 8px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
    text-decoration: none;
}
.algo-user-dropdown__link {
    color: #a78bfa;
}
.algo-user-dropdown__link:hover {
    background: rgba(139, 92, 246, 0.08);
}
.algo-user-dropdown__logout {
    color: #f87171;
}
.algo-user-dropdown__logout:hover {
    background: rgba(248, 113, 113, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════
   ACCESS MODAL (login / register / waitlist)
   ═══════════════════════════════════════════════════════════════════ */
.algo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.algo-modal {
    background: #12121e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 36px 40px;
    max-width: 460px;
    width: 92%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    text-align: center;
    font-family: var(--font-body);
}

/* Tabs (Login / Register) */
.algo-modal__tabs {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 18px;
}
.algo-modal__tab {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #9ca3af;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
}
.algo-modal__tab--active {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

/* Inputs */
.algo-modal__input {
    width: 100%;
    padding: 11px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.algo-modal__input:focus {
    border-color: rgba(139, 92, 246, 0.5);
}
.algo-modal__input--tight {
    margin-bottom: 4px;
}

/* Message line (error / success) */
.algo-modal__msg {
    font-size: 0.78rem;
    color: #f87171;
    min-height: 18px;
    margin-bottom: 8px;
}
.algo-modal__msg--success {
    color: #10b981;
}

/* Primary button */
.algo-modal__btn {
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 8px;
    transition: opacity 0.15s;
}
.algo-modal__btn:hover:not(:disabled) {
    opacity: 0.9;
}
.algo-modal__btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
.algo-modal__btn--success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Forgot password link */
.algo-modal__forgot {
    font-size: 0.78rem;
    color: #818cf8;
    cursor: pointer;
}
.algo-modal__forgot:hover {
    text-decoration: underline;
}

/* Waitlist */
.algo-modal__intro {
    color: #9ca3af;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0 0 16px;
}
.algo-modal__row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}
.algo-modal__row .algo-modal__input {
    flex: 1;
    margin-bottom: 0;
}
.algo-modal__submit-inline {
    padding: 11px 24px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.algo-modal__honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
}
.algo-modal__roles {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.algo-modal__role {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 0.78rem;
    color: #9ca3af;
}
.algo-modal__role input {
    accent-color: #8b5cf6;
    width: 14px;
    height: 14px;
}

/* Free-tier info block */
.algo-modal__free {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 14px;
    margin-top: 14px;
}
.algo-modal__free-title {
    text-align: center;
    color: #a78bfa;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.algo-modal__chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 10px;
}
.algo-modal__chip {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.05);
    color: #a78bfa;
    font-size: 0.72rem;
}
.algo-modal__meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    color: #6b7280;
    font-size: 0.72rem;
    flex-wrap: wrap;
}
