/* =========================================================
   Mia Ideas — app styles
   Brand palette from the Mia Bazo guidelines, same tokens as Mia Brain's public.css:
     #c46412  primary deep (burnt orange)
     #dd7904  primary (mid orange) ← anchor
     #f7931e  primary bright
     #333333  ink (charcoal)
     #f5bb3b  amber (supporting)
     #118ed4  blue, #63ad71 green, #c13936 red, #6c58b3 purple (status accents only)

   Unlike Mia Brain, which brands only its public pages and leaves the signed-in app on
   stock bootstrap-dark, the whole of Mia Ideas uses the brand shell — signed in or out.
   ========================================================= */

:root {
    --mb-primary: #dd7904;
    --mb-primary-deep: #c46412;
    --mb-primary-bright: #f7931e;
    --mb-amber: #f5bb3b;
    --mb-ink: #333333;
    --mb-ink-soft: #4a4a4a;
    --mb-page: #faf8f5;
    --mb-surface: #ffffff;
    --mb-muted: #6b6b6b;
    --mb-line: #ececec;
    --mb-line-strong: #d8d8d8;
}

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    background: var(--mb-page);
    color: var(--mb-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-feature-settings: "ss01" on, "cv11" on;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

a { color: var(--mb-primary-deep); }
a:hover { color: var(--mb-primary); }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(247, 147, 30, 0.55);
}
.form-control:focus, .form-select:focus { border-color: var(--mb-primary-bright); }

/* ---- Top nav: charcoal, sticky, orange brand ---- */
.mia-nav {
    background: var(--mb-ink);
    color: #fff;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}
.mia-nav a.mia-brand,
.mia-nav a.mia-brand:hover { color: #fff; text-decoration: none; }

.mia-nav-links { display: flex; gap: 28px; align-items: center; }
.mia-nav-links a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}
.mia-nav-links a:hover { color: #fff; }
.mia-nav-links a.active { color: var(--mb-primary-bright); }

.mia-nav-user { color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.mia-nav .btn-signout {
    background: none;
    border: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 500;
}
.mia-nav .btn-signout:hover { color: #fff; }

@media (max-width: 768px) {
    .mia-nav-links { gap: 16px; }
    .mia-nav-user { display: none; }
}

/* ---- Brand lockup: Mia Bazo "A" mark + wordmark ---- */
.mia-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.mia-logo-mark { height: 32px; width: auto; display: block; }
/* Light surfaces get the orange mark; the charcoal nav swaps to white. */
.mia-logo-mark--orange { display: block; }
.mia-logo-mark--white { display: none; }
.mia-nav .mia-logo-mark--orange { display: none; }
.mia-nav .mia-logo-mark--white { display: block; }

.mia-logo-word { font-size: 20px; color: var(--mb-ink); letter-spacing: 0.01em; }
.mia-nav .mia-logo-word { color: #fff; }
.mia-logo-bold { font-weight: 700; }
.mia-logo-light { font-weight: 400; opacity: 0.75; }

/* ---- Buttons ---- */
.btn-cta, .btn-cta:focus {
    background: var(--mb-primary);
    color: #fff;
    font-weight: 600;
    border: 1px solid var(--mb-primary);
    border-radius: 8px;
    padding: 8px 18px;
    transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(196, 100, 18, 0.2);
}
.btn-cta:hover {
    background: var(--mb-primary-deep);
    border-color: var(--mb-primary-deep);
    color: #fff;
    box-shadow: 0 4px 12px rgba(196, 100, 18, 0.3);
}
.btn-cta:active { transform: translateY(1px); }

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(51, 51, 51, 0.18);
    color: var(--mb-ink);
    font-weight: 500;
    border-radius: 8px;
    padding: 8px 18px;
}
.btn-ghost:hover {
    background: rgba(51, 51, 51, 0.04);
    color: var(--mb-ink);
    border-color: rgba(51, 51, 51, 0.3);
}

/* ---- Page furniture ---- */
.page-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; color: var(--mb-ink); }
.eyebrow {
    color: var(--mb-primary-deep);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.surface {
    background: var(--mb-surface);
    border: 1px solid var(--mb-line);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

/* ---- Stage chips: the same soft-tint system as Mia Brain's note-type badges ---- */
.stage-chip {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .01em;
}
.stage-captured    { background: #eeeeee; color: #555555; }
.stage-researching { background: #e0f0fa; color: #0f6ca8; }
.stage-active      { background: #e4f2e8; color: #3e7d4c; }
.stage-paused      { background: #fdf3d7; color: #8a6d0f; }
.stage-binned      { background: #e6e4e1; color: #6b6b6b; }

.chip {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    background: var(--mb-page);
    border: 1px solid var(--mb-line);
    color: var(--mb-muted);
}
.chip-review { background: rgba(245, 187, 59, .22); border-color: rgba(245, 187, 59, .5); color: #8a6d0f; font-weight: 600; }

/* ---- Portfolio list ---- */
.idea-list { display: grid; gap: 10px; }
.idea-card {
    display: block;
    background: var(--mb-surface);
    border: 1px solid var(--mb-line);
    border-radius: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.idea-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(51, 51, 51, .06);
    border-color: var(--mb-primary-bright);
    color: inherit;
}
.idea-card .idea-title { font-weight: 600; letter-spacing: -0.01em; }
.idea-card .idea-oneliner { color: var(--mb-muted); font-size: .9rem; }

/* ---- Stage filter pills ---- */
.stage-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-filter a {
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--mb-muted);
    background: var(--mb-surface);
    border: 1px solid var(--mb-line);
    border-radius: 999px;
    padding: 5px 14px;
}
.stage-filter a:hover { border-color: var(--mb-primary-bright); color: var(--mb-primary-deep); }
.stage-filter a.active {
    background: var(--mb-primary);
    border-color: var(--mb-primary);
    color: #fff;
}

/* ---- Quick capture ---- */
.capture-bar .form-control {
    border-radius: 10px 0 0 10px;
    border-color: var(--mb-line-strong);
    padding-left: 1.1rem;
}
.capture-bar .btn { border-radius: 0 10px 10px 0; }

/* ---- History timeline ---- */
.history { list-style: none; padding: 0; margin: 0; }
.history li {
    border-left: 2px solid var(--mb-line);
    padding: 0 0 1.1rem 1rem;
    position: relative;
}
.history li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: .35rem;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--mb-primary-bright);
}
.history li:last-child { padding-bottom: 0; }

/* ---- Empty states ---- */
.empty {
    background: var(--mb-surface);
    border: 1px dashed var(--mb-line-strong);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--mb-muted);
}

/* ---- Footer ---- */
.mia-footer {
    background: #fff;
    border-top: 1px solid var(--mb-line);
    padding: 32px 0 24px;
    margin-top: 64px;
}
.mia-footer .footer-bottom { color: var(--mb-muted); font-size: 13px; }

/* ---- Sign-in card ---- */
.auth-card { max-width: 26rem; margin: 6vh auto 0; }

/* Claude-originated ideas and findings — purple, one of the Mia Bazo status accents,
   kept distinct from every stage colour so it never reads as a stage. */
.chip-claude { background: #ebe7f7; border-color: #d6cdf0; color: #55449e; font-weight: 600; }
/* Human-originated ideas. Both sides are labelled — labelling only the machine ones
   leaves the rest ambiguous, and the whole point is telling them apart at a glance. */
.chip-human { background: #e4f2e8; border-color: #cfe6d8; color: #3e7d4c; font-weight: 600; }

/* Waiting spinner, for work that happens off the request thread. */
.mia-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--mb-line-strong);
    border-top-color: var(--mb-primary);
    border-radius: 50%;
    animation: mia-spin 0.7s linear infinite;
}
@keyframes mia-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mia-spinner { animation: none; } }

/* Confidence in an analysis. Three levels, coloured by how much they should be trusted —
   and always shown beside the counted sourced/assumed figures, never instead of them. */
.conf-solid       { background:#e4f2e8; border-color:#cfe6d8; color:#3e7d4c; font-weight:600; }
.conf-indicative  { background:#fdf3d7; border-color:#f0e2b0; color:#8a6d0f; font-weight:600; }
.conf-speculative { background:#fae3e2; border-color:#f0cfcd; color:#a12f2c; font-weight:600; }

.mia-spinner-sm {
    display: inline-block;
    width: 10px; height: 10px;
    border: 2px solid var(--mb-line-strong);
    border-top-color: var(--mb-primary);
    border-radius: 50%;
    animation: mia-spin 0.7s linear infinite;
    vertical-align: -1px;
}
