/* ============================================================================
   Shared top navigation — used by BOTH the app (index.html) and the landing
   (landing.html), so the two bars are always identical and can't drift.
   Self-contained: explicit colors (no CSS variables), since the two pages have
   different token scopes. Warm/copper theme, matching the app + canvas.
   ========================================================================== */
#top-nav {
    display: flex;
    align-items: center;
    height: 42px;
    background: #222228;
    border-bottom: 1px solid #2E2E36;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 200;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.nav-logo {
    font-weight: 700;
    font-size: 14px;
    color: #C4785A;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    /* Identical whether it's the landing <a> or the in-app <button> (→ home). */
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}
/* No mouse-click focus box on the logo button; keep a ring for keyboard nav. */
.nav-logo:focus { outline: none; }
.nav-logo:focus-visible { outline: 2px solid rgba(196,120,90,0.5); outline-offset: 3px; border-radius: 4px; }
.nav-logo-mark { font-size: 12px; }

.nav-links { display: flex; gap: 2px; margin-left: 32px; }

.nav-link {
    background: none;
    border: none;
    color: #6E6E76;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
}
.nav-link:hover { color: #A0A0A8; }
.nav-link.active { color: #C4785A; border-bottom-color: #C4785A; }

.nav-spacer { flex: 1; }

/* Account avatar (top-right) — opens the account menu in the app; on the landing
   it's a plain link into the app. The single entry point for account + settings. */
.nav-account { position: relative; display: inline-flex; }
.nav-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none;
    color: #C4785A; background: #C4785A1F; border: 1px solid #C4785A45;
    transition: background 0.15s, border-color 0.15s;
}
.nav-avatar:hover { background: #C4785A2E; border-color: #C4785A66; }
/* No mouse-click focus box; keep a ring for keyboard nav. */
.nav-avatar:focus { outline: none; }
.nav-avatar:focus-visible { outline: 2px solid rgba(196,120,90,0.6); outline-offset: 2px; }
.nav-avatar.active { background: #C4785A3A; border-color: #C4785A80; }

/* Account dropdown (app only). Fixed + high z so it floats above full-screen
   surfaces like the brainstorm canvas (z-index 1000) instead of being trapped
   behind them in the nav's stacking context. Anchored under the top-right avatar. */
.nav-menu {
    position: fixed; top: 48px; right: 16px; z-index: 2100;
    min-width: 210px; background: #222228; border: 1px solid #38383F;
    border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.45); padding: 6px;
}
.nav-menu[hidden] { display: none; }
.nav-menu-header {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 10px; border-bottom: 1px solid #2E2E36; margin-bottom: 6px;
}
.nav-avatar-sm {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #C4785A;
    background: #C4785A1F; border: 1px solid #C4785A45;
}
.nav-menu-name { font-size: 13px; font-weight: 600; color: #EAEAED; }
.nav-menu-sub { font-size: 11px; color: #6E6E76; }
.nav-menu-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    background: none; border: none; cursor: pointer; font-family: inherit;
    font-size: 13px; color: #A0A0A8; padding: 9px 8px; border-radius: 7px;
    text-align: left; transition: background 0.12s, color 0.12s;
}
.nav-menu-item:hover { background: rgba(255,255,255,0.05); color: #EAEAED; }
.nav-menu-icon { width: 16px; text-align: center; color: #6E6E76; }
.nav-menu-item:hover .nav-menu-icon { color: #C4785A; }
/* Guest menu: Sign up is the primary action; Log in is a quiet secondary link. */
.nav-menu-cta {
    display: block; width: 100%; text-align: center; cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 600; color: #fff; background: #C4785A; border: none;
    padding: 9px 8px; border-radius: 7px; transition: opacity 0.12s;
}
.nav-menu-cta:hover { opacity: 0.9; }
.nav-menu-link {
    display: block; width: 100%; text-align: center; cursor: pointer; font-family: inherit;
    font-size: 12px; color: #A0A0A8; background: none; border: none;
    padding: 8px; margin-top: 2px; transition: color 0.12s;
}
.nav-menu-link:hover { color: #EAEAED; }

/* Landing-page "Sign in" link (top-right, replaces the avatar on the marketing page) */
.nav-signin {
    font-size: 13px; font-weight: 600; color: #C4785A; text-decoration: none;
    padding: 7px 16px; border-radius: 8px; border: 1px solid #C4785A55;
    transition: background 0.15s, border-color 0.15s;
}
.nav-signin:hover { background: #C4785A1A; border-color: #C4785A99; }

/* Guest avatar (signed-out) — neutral person glyph, muted */
.nav-avatar-guest { color: #A0A0A8; }
.nav-avatar-guest svg { display: block; }

/* Landing: paired Log in (ghost) + Sign up (primary) */
.nav-authpair { display: inline-flex; align-items: center; gap: 10px; }
.nav-login {
    font-size: 13px; font-weight: 600; color: #A0A0A8; text-decoration: none;
    padding: 7px 12px; border-radius: 8px; transition: color 0.15s;
}
.nav-login:hover { color: #EAEAED; }
.nav-signup {
    font-size: 13px; font-weight: 600; color: #fff; text-decoration: none;
    padding: 7px 16px; border-radius: 8px; background: #C4785A;
    transition: filter 0.15s;
}
.nav-signup:hover { filter: brightness(1.08); }

/* ============================================================================
   Auth modal (sign in / create account). Lives here (not style.css) so BOTH the
   app and the landing page — which only load nav.css — can render it. Explicit
   font stack since the landing has no :root --font.
   ========================================================================== */
.auth-backdrop {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(10,10,12,0.72);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* The landing page has no global box-sizing reset (it doesn't load style.css),
   so scope one here — otherwise width:100% inputs/buttons overflow the modal. */
.auth-backdrop, .auth-backdrop * { box-sizing: border-box; }
.auth-modal {
    position: relative; width: 100%; max-width: 400px;
    background: #1C1C21; border: 1px solid #34343C; border-radius: 16px;
    padding: 22px 24px 24px; box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.auth-close {
    position: absolute; top: 13px; right: 13px; background: none; border: none;
    color: #6E6E76; font-size: 20px; line-height: 1; cursor: pointer;
    padding: 2px 7px; border-radius: 6px; transition: all 0.15s;
}
.auth-close:hover { color: #EAEAED; background: rgba(255,255,255,0.06); }
.auth-tabs {
    display: flex; gap: 2px; width: fit-content; margin: 0 auto 18px;
    padding: 3px; background: #161619; border: 1px solid #2E2E36; border-radius: 9px;
}
.auth-tab {
    background: none; border: none; cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 600; color: #8A8A92; padding: 7px 16px;
    border-radius: 7px; transition: background 0.15s, color 0.15s;
}
.auth-tab.active { background: #34343C; color: #EAEAED; }
.auth-head { margin-bottom: 18px; }
.auth-title { font-size: 22px; font-weight: 800; color: #EAEAED; letter-spacing: -0.4px; }
.auth-sub { font-size: 13px; color: #8A8A92; margin-top: 4px; line-height: 1.5; }
.auth-oauth {
    display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
    background: #232329; border: 1px solid #38383F; color: #EAEAED;
    font-family: inherit; font-size: 14px; font-weight: 500; padding: 11px;
    border-radius: 10px; cursor: pointer; transition: all 0.15s; margin-bottom: 12px;
}
.auth-oauth:hover { background: #2A2A30; border-color: #45454d; }
.auth-oauth-mark {
    width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #1a1a1a;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}
.auth-divider { display: flex; align-items: center; gap: 10px; color: #5A5A62; font-size: 11px; margin: 6px 0 14px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #2E2E36; }
.auth-label { display: block; font-size: 12px; color: #A0A0A8; margin: 12px 0 6px; }
.auth-input {
    width: 100%; background: #161619; border: 1px solid #35343B; border-radius: 10px;
    color: #EAEAED; font-family: inherit; font-size: 14px; padding: 11px 13px;
    outline: none; transition: border-color 0.15s;
}
.auth-input:focus { border-color: #C4785A; }
.auth-input::placeholder { color: #5A5A62; }
.auth-error {
    margin-top: 12px; font-size: 12.5px; color: #E07B7B; line-height: 1.45;
    background: rgba(207,110,117,0.10); border: 1px solid rgba(207,110,117,0.28);
    border-radius: 8px; padding: 8px 11px;
}
.auth-submit {
    width: 100%; margin-top: 16px; padding: 12px; border: none; border-radius: 10px;
    background: #C4785A; color: #fff; font-family: inherit; font-size: 14px;
    font-weight: 600; cursor: pointer; transition: filter 0.15s;
}
.auth-submit:hover { filter: brightness(1.07); }
.auth-submit:disabled { opacity: 0.7; cursor: default; }
.auth-footer { margin-top: 16px; text-align: center; font-size: 13px; color: #8A8A92; }
.auth-footer a { color: #C4785A; font-weight: 600; cursor: pointer; }
.auth-footer a:hover { text-decoration: underline; }
