/* ═══════════════════════════════════════════════════════════════
   styles-base.css
   Design tokens, reset, base elements, auth screen, mode picker.
   Loaded first — no wizard or bulk dependencies.
═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════
   DESIGN TOKENS
═══════════════════════════════ */
:root {
    --bg: #07090f;
    --s1: #0d1117;
    --s2: #131a24;
    --s3: #1a2332;
    --border: #1e2d42;
    --border2: #243448;
    --accent: #0ea5e9;
    --accent2: #38bdf8;
    --green: #22c55e;
    --yellow: #f59e0b;
    --red: #ef4444;
    --text: #e2e8f0;
    --text2: #94a3b8;
    --text3: #64748b;
    --mono: 'IBM Plex Mono', monospace;
    --sans: 'Poppins', sans-serif;
}

/* ═══════════════════════════════
   RESET & BASE
═══════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(14, 165, 233, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, .025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.hidden {
    display: none !important;
}

.fade {
    animation: fadeIn .2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════
   AUTH SCREEN
═══════════════════════════════ */
#authScreen {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

.auth-logo {
    height: 34px;
    display: block;
    margin: 0 auto 28px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.auth-sub {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 28px;
}

.auth-err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13px;
    color: #dc2626;
    margin-bottom: 14px;
    text-align: left;
    display: none;
}

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

.auth-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: #64748b;
    padding: 16px;
}

.auth-loading.show {
    display: flex;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    margin-bottom: 16px;
    padding: 13px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.terms-row input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #0ea5e9;
    cursor: pointer;
}

.terms-row label {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
    cursor: pointer;
}

.terms-row label a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
}

.google-btn {
    width: 100%;
    height: 50px;
    border: 1px solid #dadce0;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    color: #3c4043;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.google-btn:hover:not(:disabled) {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
    transform: translateY(-1px);
}

.google-btn:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
    box-shadow: none;
    transform: none;
}

.google-btn img {
    width: 20px;
    height: 20px;
}

.auth-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    color: #94a3b8;
}

.auth-footer a {
    color: #0ea5e9;
    text-decoration: none;
}

/* ═══════════════════════════════
   MODE PICKER
═══════════════════════════════ */
#modeScreen {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.mode-wrap {
    width: 100%;
    max-width: 900px;
}

.mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 14px;
}

.mode-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.mode-sub {
    font-size: 13px;
    color: var(--text2);
    text-align: center;
    margin-bottom: 28px;
}

.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.mode-card {
    background: var(--s1);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    cursor: pointer;
    transition: all .22s;
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, .25), transparent);
}

.mode-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(14, 165, 233, .12);
}

.mode-icon {
    font-size: 36px;
    margin-bottom: 14px;
}

.mode-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
}

.mode-desc {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 18px;
}

.mode-cta {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}



/* ═══════════════════════════════
   USER BADGE
═══════════════════════════════ */
.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--s2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.u-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #020c14;
    flex-shrink: 0;
    background: var(--accent);
    overflow: hidden;
}

.u-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.u-info {
    flex: 1;
    min-width: 0;
}

.u-name {
    font-size: 13px;
    font-weight: 600;
}

.u-email {
    font-size: 11px;
    color: var(--text3);
    font-family: var(--mono);
}

.u-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.u-chip {
    font-family: var(--mono);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--s3);
    border: 1px solid var(--border2);
    color: var(--text3);
    white-space: nowrap;
}

.u-chip b {
    color: var(--accent2);
}

.btn-signout {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--text3);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 11px;
    cursor: pointer;
    transition: all .15s;
}

.btn-signout:hover {
    color: var(--red);
    border-color: var(--red);
}