/* ============================================================
   Cosmo Realty Group — Forest green & cream theme
   Palette: #1F3D2B  #3A6B4C  #C8A24B  #EFE9DC  #2B2B28
   ============================================================ */

:root {
    --green-900: #1F3D2B; /* deep forest */
    --green-600: #3A6B4C; /* mid green   */
    --gold:      #C8A24B; /* accent      */
    --cream:     #EFE9DC; /* light bg    */
    --ink:       #2B2B28; /* near-black  */

    --gold-dark: #ab8835;
    --green-900-90: rgba(31, 61, 43, 0.90);
    --shadow: 0 10px 30px rgba(31, 61, 43, 0.12);
    --shadow-sm: 0 4px 14px rgba(31, 61, 43, 0.10);
    --maxw: 1140px;
    --radius: 14px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
/* Offset in-page anchor targets so they aren't hidden under the sticky header. */
section[id] { scroll-margin-top: 90px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: var(--crm-ink-text);
    background-color: var(--crm-cffffff-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--crm-forest-text);
    line-height: 1.18;
    margin: 0 0 .5em;
    font-weight: 600;
}

p { margin: 0 0 1rem; }

/* Blazor's <FocusOnNavigate Selector="h1"> focuses the heading on load for
   accessibility; suppress the default focus ring since a heading isn't an
   interactive control. */
h1:focus, h1:focus-visible { outline: none; }

a {
    color: var(--crm-green-text);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--crm-gold-dark-text); }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: .85rem 1.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .98rem;
    letter-spacing: .02em;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .18s ease;
}
.btn-gold {
    background: var(--crm-gold-bg);
    color: var(--crm-ink-text);
}
.btn-gold:hover {
    background: var(--crm-gold-dark-bg);
    color: var(--crm-cffffff-text);
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    border-color: var(--crm-cream-line);
    color: var(--crm-cream-text);
}
.btn-ghost:hover {
    background: var(--crm-cream-bg);
    color: var(--crm-forest-text);
}

/* ---------- Status pages (not found / not authorized) ---------- */
.status-page {
    max-width: 40rem;
    margin: 0 auto;
    padding: 5.5rem 1.5rem 6.5rem;
    text-align: center;
}
.status-page .eyebrow {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--crm-gold-dark-text);
    margin-bottom: 1rem;
}
.status-page h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    color: var(--crm-forest-text);
    margin-bottom: 1rem;
}
.status-page p {
    color: var(--crm-green-text);
    font-size: 1.05rem;
    margin-bottom: 2.25rem;
}
.status-actions {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.status-link {
    font-weight: 600;
    color: var(--crm-green-text);
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--crm-forest-bg);
    border-bottom: 3px solid var(--crm-gold-line);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
}
.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: var(--crm-cream-text);
    font-family: Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: .01em;
}
.brand:hover { color: var(--crm-cffffff-text); }
.brand .logo-mark {
    width: 62px;
    height: 42px;
    flex: 0 0 auto;
    background-color: var(--crm-gold-bg);
    -webkit-mask: url('img/logo.png') no-repeat center center;
    mask: url('img/logo.png') no-repeat center center;
    -webkit-mask-size: contain;
    mask-size: contain;
}
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand small {
    font-size: .62rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--crm-gold-text);
    font-family: "Segoe UI", sans-serif;
    margin-top: 2px;
}

.nav-toggle-label { display: none; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    color: var(--crm-cream-text);
    font-size: .95rem;
    font-weight: 500;
    padding: .35rem 0;
    border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--crm-gold-text); }
.nav-links a.active {
    color: var(--crm-gold-text);
    border-bottom-color: var(--crm-gold-line);
}
.nav-links .btn { padding: .55rem 1.4rem; border-bottom: none; }
.nav-links .btn:hover { color: var(--crm-cffffff-text); }

/* Account menu: gold avatar circle in the corner for everyone; the dropdown
   (Sign In when anonymous, CRM links + Sign Out when signed in) opens on
   hover or keyboard focus — pure CSS, no JS. The auto margin keeps the nav
   pinned right. */
.nav-links { margin-left: auto; }
/* Account entries inside the nav list are the avatar's mobile stand-in. */
.nav-links .nav-account { display: none; }
.theme-toggle { margin-left: 1.2rem; }
.avatar-menu { position: relative; margin-left: 1.6rem; }
.avatar-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--crm-gold-bg);
    color: var(--crm-forest-text);
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .15s ease;
}
.avatar-circle svg { width: 22px; height: 22px; }
.avatar-menu:hover .avatar-circle,
.avatar-menu:focus-within .avatar-circle { border-color: var(--crm-cream-line); }
.avatar-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    min-width: 220px;
    background: var(--crm-cffffff-bg);
    border: 1px solid rgba(var(--crm-rgb31-61-43-line), .10);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(var(--crm-rgb0-0-0-shadow), .18);
    list-style: none;
    margin: 0;
    padding: .35rem 0;
    z-index: 200;
}
.avatar-menu:hover .avatar-dropdown,
.avatar-menu:focus-within .avatar-dropdown { display: block; }
/* Invisible strip bridging the gap under the circle so the menu
   doesn't close while the cursor travels down to it. */
.avatar-dropdown::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
}
.avatar-dropdown .avatar-signed-in {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .6rem 1.1rem .7rem;
    font-size: .76rem;
    color: var(--crm-green-text);
    border-bottom: 1px solid rgba(var(--crm-rgb31-61-43-line), .10);
    margin-bottom: .35rem;
}
.avatar-dropdown .avatar-signed-in strong {
    color: var(--crm-forest-text);
    font-size: .95rem;
}
.avatar-dropdown a {
    display: block;
    padding: .55rem 1.1rem;
    color: var(--crm-forest-text);
    font-size: .92rem;
    font-weight: 500;
}
.avatar-dropdown a:hover,
.avatar-dropdown a.active { background: var(--crm-cream-bg); color: var(--crm-forest-text); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
    position: relative;
    /* Green overlay (opaque on the left, behind the text) fading to reveal the
       golden-hour photo on the right. Layered above the hero image. */
    background-image:
        linear-gradient(
            to right,
            rgba(var(--crm-rgb31-61-43-bg), 0.97) 0%,
            rgba(var(--crm-rgb31-61-43-bg), 0.92) 25%,
            rgba(var(--crm-rgb31-61-43-bg), 0.70) 45%,
            rgba(var(--crm-rgb31-61-43-bg), 0.35) 70%,
            rgba(var(--crm-rgb31-61-43-bg), 0.10) 100%
        ),
        url('img/hero.jpg');
    background-size: cover, cover;
    background-position: center, center right;
    background-repeat: no-repeat, no-repeat;
    color: var(--crm-cream-text);
    padding: 6.5rem 0 5.5rem;
    overflow: hidden;
}

/* On narrow screens the text spans the full width, so darken the whole image
   for readability instead of fading to the right. */
@media (max-width: 860px) {
    .hero {
        background-image:
            linear-gradient(
                to bottom,
                rgba(var(--crm-rgb31-61-43-bg), 0.92) 0%,
                rgba(var(--crm-rgb31-61-43-bg), 0.80) 60%,
                rgba(var(--crm-rgb31-61-43-bg), 0.55) 100%
            ),
            url('img/hero.jpg');
    }
}
.hero::after {
    content: "";
    position: absolute;
    /* Position drifts slowly + randomly via JS (--glow-x / --glow-y); defaults to top-right. */
    left: var(--glow-x, 100%);
    top: var(--glow-y, 0%);
    width: 1380px;
    height: 1380px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(var(--crm-rgb200-162-75-bg),.28), transparent 62%);
    pointer-events: none;
    transition: left 6s ease-in-out, top 6s ease-in-out;
    will-change: left, top;
}

@media (prefers-reduced-motion: reduce) {
    .hero::after { transition: none; }
}
.hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: .25em;
    font-size: .78rem;
    color: var(--crm-gold-text);
    font-weight: 600;
    margin-bottom: 1.1rem;
}
.hero h1 {
    color: var(--crm-cffffff-text);
    font-size: clamp(2.2rem, 5vw, 3.7rem);
    max-width: 18ch;
    margin-bottom: 1.2rem;
}
.hero h1 .accent { color: var(--crm-gold-text); }

/* ---------- Hero headline reveal ----------
   Three stacked lines, full text laid out from the start (all spacing reserved,
   no reflow). Each line emerges into place from its own direction (slide + fade),
   in a tight overlapping stagger (each starts shortly after the one above). */
.hero h1.hero-reveal {
    max-width: 24ch;
}
.hero h1.hero-reveal .rev {
    display: block;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 100%;
    opacity: 0;
    animation-duration: 1.5s;
    animation-timing-function: cubic-bezier(.22, .61, .36, 1);
    animation-fill-mode: both;
    animation-delay: .2s;
}

/* Emerge from the left */
.hero h1.hero-reveal .rev-lr { animation-name: emerge-lr; }
@keyframes emerge-lr {
    from { opacity: 0; transform: translateX(-.6em); }
    to   { opacity: 1; transform: none; }
}

/* Emerge from below (bottom -> top) */
.hero h1.hero-reveal .rev-bt { animation-name: emerge-bt; }
@keyframes emerge-bt {
    from { opacity: 0; transform: translateY(.7em); }
    to   { opacity: 1; transform: none; }
}

/* Emerge from the right */
.hero h1.hero-reveal .rev-rl { animation-name: emerge-rl; }
@keyframes emerge-rl {
    from { opacity: 0; transform: translateX(.6em); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero h1.hero-reveal .rev {
        opacity: 1;
        animation: none;
    }
}
.hero p.lead {
    font-size: 1.18rem;
    max-width: 56ch;
    color: rgba(var(--crm-rgb239-233-220-text), .9);
    margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Lead paragraph is hidden until typewriter.js reveals + types it (no caret).
   Space is reserved by the script so the buttons below don't shift.
   No-JS fallback in <noscript> in App.razor keeps it visible. */
.hero p.lead.hero-type { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
    .hero p.lead.hero-type { visibility: visible; }
}

/* ---------- Scroll reveal (rise up + fade in on enter) ---------- */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .7s ease-out, transform .8s cubic-bezier(.22, .61, .36, 1);
    will-change: opacity, transform;
}
.reveal-up.in {
    opacity: 1;
    transform: none;
}
/* Stagger the value-word trio into a cascade. */
.stats .stat.reveal-up:nth-child(2) { transition-delay: .12s; }
.stats .stat.reveal-up:nth-child(3) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
    .reveal-up { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Generic sections
   ============================================================ */
.section { padding: 5rem 0; }
.section.cream { background: var(--crm-cream-bg); }
.section.ink { background: var(--crm-ink-bg); color: var(--crm-cream-text); }

.section-head {
    text-align: center;
    max-width: 60ch;
    margin: 0 auto 3rem;
}
.section-head .eyebrow {
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: .76rem;
    color: var(--crm-gold-dark-text);
    font-weight: 700;
    margin-bottom: .6rem;
}
.section.ink .section-head h2 { color: var(--crm-cffffff-text); }
.section.ink .section-head p { color: rgba(var(--crm-rgb239-233-220-text),.85); }

/* ---------- Stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: center;
}
.stat .num {
    font-family: Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--crm-gold-text);
    font-weight: 700;
    line-height: 1;
}
.stat .label {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .82rem;
    color: rgba(var(--crm-rgb239-233-220-text),.8);
    margin-top: .6rem;
}

/* ---------- Cards / services ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
}
.card-x {
    background: var(--crm-cffffff-bg);
    border: 1px solid rgba(var(--crm-rgb31-61-43-line),.10);
    border-radius: var(--radius);
    padding: 2rem 1.8rem;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.card-x:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-x .icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--crm-cream-bg);
    color: var(--crm-green-text);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    margin-bottom: 1.1rem;
}
.card-x h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.card-x p { color: var(--crm-c4a4a44-text); margin-bottom: 0; }

/* ---------- Process steps ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4rem;
}
.step {
    background: var(--crm-cffffff-bg);
    border-radius: var(--radius);
    padding: 1.8rem 1.4rem;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--crm-gold-line);
}
.step .n {
    font-family: Georgia, serif;
    font-size: 2rem;
    color: var(--crm-green-text);
    font-weight: 700;
}
.step h4 { margin: .3rem 0 .4rem; font-size: 1.1rem; }
.step p { font-size: .94rem; color: var(--crm-c4a4a44-text); margin: 0; }

/* ---------- CTA band ---------- */
.cta {
    background: linear-gradient(135deg, var(--crm-green-bg), var(--crm-forest-bg));
    color: var(--crm-cream-text);
    border-radius: 20px;
    padding: 3.2rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.cta h2 { color: var(--crm-cffffff-text); }
.cta p { max-width: 52ch; margin: 0 auto 1.8rem; color: rgba(var(--crm-rgb239-233-220-text),.92); }
.cta .contact-line {
    margin-top: 1.6rem;
    font-size: 1.05rem;
}
.cta .contact-line a { color: var(--crm-gold-text); font-weight: 600; }

/* ---------- Contact / SMS opt-in form ---------- */
.contact-form {
    max-width: 640px;
    margin: 0 auto;
    background: var(--crm-cffffff-bg);
    border: 1px solid rgba(var(--crm-rgb31-61-43-line), .10);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.contact-form label {
    display: block;
    font-weight: 600;
    color: var(--crm-forest-text);
    font-size: .92rem;
    margin-bottom: 1rem;
}
.contact-form input,
.contact-form textarea {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .7rem .8rem;
    font: inherit;
    font-weight: 400;
    color: var(--crm-ink-text);
    background: var(--crm-cffffff-bg);
    border: 1px solid rgba(var(--crm-rgb31-61-43-line), .25);
    border-radius: 8px;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--crm-green-line);
    box-shadow: 0 0 0 3px rgba(var(--crm-rgb58-107-76-shadow), .15);
}
.contact-form textarea { resize: vertical; }

.contact-form label.consent {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    font-weight: 400;
    font-size: .82rem;
    color: var(--crm-c4a4a44-text);
    line-height: 1.5;
    margin: .25rem 0 1.4rem;
}
.contact-form label.consent input {
    width: auto;
    margin: .2rem 0 0;
    flex: 0 0 auto;
}
.contact-form .btn { border: none; cursor: pointer; }
.contact-form .form-note {
    margin: 1rem 0 0;
    font-size: .9rem;
    color: var(--crm-c4a4a44-text);
}

@media (max-width: 860px) {
    .contact-form { padding: 1.4rem; }
    .contact-form .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* ============================================================
   Legal / content pages
   ============================================================ */
.page-hero {
    background: var(--crm-forest-bg);
    color: var(--crm-cream-text);
    padding: 3.5rem 0;
    border-bottom: 3px solid var(--crm-gold-line);
}
.page-hero h1 { color: var(--crm-cffffff-text); margin: 0; }
.page-hero .updated { color: var(--crm-gold-text); font-size: .9rem; margin-top: .4rem; }

.legal {
    max-width: 820px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 4.5rem;
}
.legal h2 {
    font-size: 1.5rem;
    margin-top: 2.4rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--crm-cream-line);
}
.legal h2:first-of-type { margin-top: 0; }
.legal h3 { font-size: 1.15rem; margin-top: 1.6rem; }
.legal p, .legal li { color: var(--crm-c3a3a35-text); }
.legal ul { padding-left: 1.3rem; }
.legal li { margin-bottom: .5rem; }
.legal .intro { font-size: 1.1rem; color: var(--crm-ink-text); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: var(--crm-ink-bg);
    color: rgba(var(--crm-rgb239-233-220-text),.8);
    padding: 3.5rem 0 1.5rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(var(--crm-rgb239-233-220-line),.15);
}
.site-footer h4 {
    color: var(--crm-gold-text);
    font-family: "Segoe UI", sans-serif;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .8rem;
    margin-bottom: 1rem;
}
.site-footer .brand { margin-bottom: 1rem; }
.site-footer .footer-links a { color: rgba(var(--crm-rgb239-233-220-text),.8); display: block; margin-bottom: .5rem; }
.site-footer .footer-links a:hover { color: var(--crm-gold-text); }
.site-footer .muted { font-size: .92rem; max-width: 38ch; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding-top: 1.5rem;
    font-size: .85rem;
    color: rgba(var(--crm-rgb239-233-220-text),.6);
}
.footer-bottom a { color: rgba(var(--crm-rgb239-233-220-text),.6); }
.footer-bottom a:hover { color: var(--crm-gold-text); }

/* ============================================================
   Responsive + pure-CSS mobile menu
   ============================================================ */
#nav-toggle-cb { display: none; }

@media (max-width: 860px) {
    .stats, .cards, .steps { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
    .cta { padding: 2.2rem 1.4rem; }
    .section { padding: 3.2rem 0; }

    .nav-toggle-label {
        display: block;
        color: var(--crm-cream-text);
        font-size: 1.7rem;
        line-height: 1;
        cursor: pointer;
        user-select: none;
    }
    .nav-links {
        position: absolute;
        top: 74px;
        left: 0;
        right: 0;
        background: var(--crm-forest-bg);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0 1.5rem;
        border-bottom: 0 solid var(--crm-gold-line);
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease, padding .25s ease, border-width .25s ease;
    }
    /* Sized to the viewport (not a magic number) and scrollable, so long menus
       — e.g. signed-in with the account section — never clip at the bottom. */
    #nav-toggle-cb:checked ~ .nav-links {
        max-height: calc(100dvh - 74px);
        overflow-y: auto;
        padding: .4rem 1.5rem 1.4rem;
        border-bottom-width: 3px;
    }
    .nav-links li { width: 100%; }

    /* Plain links: comfortable tap area, no floating underline (active = gold text). */
    .nav-links a {
        display: block;
        width: 100%;
        padding: .65rem 0;
        border-bottom: 1px solid rgba(var(--crm-rgb239-233-220-line), .10);
    }
    .nav-links a.active {
        color: var(--crm-gold-text);
        border-bottom-color: rgba(var(--crm-rgb239-233-220-line), .10);
    }

    /* Contact button: real padding, sized to its text, separated from the links. */
    .nav-links li:last-child { margin-top: 1rem; }
    .nav-links .btn {
        display: inline-block;
        width: auto;
        padding: .7rem 1.8rem;
        border-bottom: none;
    }
    .nav-links a.btn.active { border-bottom: none; }

    /* On small screens the hamburger menu carries the account actions and the
       avatar disappears, so the hamburger claims the free space to sit in the
       corner on its own. */
    .nav-toggle-label { margin-left: auto; }
    .avatar-menu { display: none; }
    .nav-links .nav-account { display: block; }

    /* Small-caps section label separating the account group from the site links. */
    .nav-account-label {
        margin-top: 1rem;
        padding-bottom: .3rem;
        font-size: .64rem;
        font-weight: 700;
        letter-spacing: .2em;
        text-transform: uppercase;
        color: var(--crm-gold-text);
    }
}

/* ============================================================
   CRM shared — status/outcome pills (used by Leads, Activities)
   ============================================================ */
.pill {
    display: inline-block;
    padding: .16rem .7rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .03em;
    white-space: nowrap;
}
.pill-new   { background: rgba(var(--crm-rgb200-162-75-bg), .16); color: var(--crm-gold-dark-text);  border: 1px solid rgba(var(--crm-rgb200-162-75-line), .50); }
.pill-cool  { background: rgba(var(--crm-rgb239-233-220-bg), .80); color: var(--crm-forest-text); border: 1px solid rgba(var(--crm-rgb31-61-43-line), .18); }
.pill-warm  { background: rgba(var(--crm-rgb58-107-76-bg), .12);  color: var(--crm-green-text); border: 1px solid rgba(var(--crm-rgb58-107-76-line), .40); }
.pill-won   { background: var(--crm-forest-bg);        color: var(--crm-cream-text);     border: 1px solid var(--crm-forest-line); }
.pill-dead  { background: rgba(var(--crm-rgb43-43-40-bg), .07);   color: var(--crm-c6b6b64-text);          border: 1px solid rgba(var(--crm-rgb43-43-40-line), .15); }
.pill-brick { background: rgba(var(--crm-rgb156-59-44-bg), .12);  color: var(--crm-c9c3b2c-text);          border: 1px solid rgba(var(--crm-rgb156-59-44-line), .35); }

/* Blazor error UI (kept from template) */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(var(--crm-rgb0-0-0-shadow), 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ============================================================
   Investor MAO components (run form, breakdown, map, comp editor).
   Global rather than scoped: they render on the Investor MAO page and
   inside the lead window, and Leaflet builds its popups outside Blazor.
   ============================================================ */
.imao-map { width: 100%; border-top: 1px solid var(--crm-ce6e0d2-line); z-index: 0; }
.imao-help { display: block; font-size: .8rem; color: var(--crm-c6b6b64-text); margin: .3rem 0; }
.imao-warning { margin: .75rem 0 0; font-size: .88rem; color: var(--crm-c9c3b2c-text); }
.imao-placed { margin: .9rem 0 0; }

/* Page shell shared by the three Investor MAO pages (pricing, comps, settings). */
.imao-page.container { padding: 1.6rem 1.5rem 4rem; }
.imao-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: .5rem; }
.imao-page-title { font-size: 1.7rem; margin: 0; }
.imao-page-lede { margin: 0 0 1.5rem; font-size: .92rem; line-height: 1.6; color: var(--crm-c6b6b64-text); }
.imao-stack { display: flex; flex-direction: column; gap: 1.75rem; }
.imao-card-title { font-size: 1.1rem; margin: 0 auto 0 0; align-self: center; }
.imao-body { padding: 1.5rem 1.5rem 1.75rem; }
.imao-saved { margin-bottom: 1rem; padding: .6rem 1rem; border-radius: var(--radius); background: rgba(var(--crm-rgb31-61-43-bg), .1); color: var(--crm-forest-text); font-size: .9rem; }
.imao-backtest { margin: 0 0 .75rem; font-size: .9rem; max-width: 75ch; }
.imao-backtest:last-child { margin-bottom: 0; }
.imao-import { cursor: pointer; margin: 0; }
/* A toolbar control with its label beside it, so the toolbar stays one line tall. */
.imao-inline-field { display: inline-flex; align-items: center; gap: .5rem; align-self: center; margin: 0; font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--crm-green-text); }
.imao-inline-field select { font: inherit; font-size: .9rem; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--crm-ink-text); background: var(--crm-cffffff-bg); border: 1px solid rgba(var(--crm-rgb31-61-43-line), .25); border-radius: 8px; padding: .35rem .6rem; max-width: 14rem; }
.imao-inline-field select:focus { outline: none; border-color: var(--crm-green-line); box-shadow: 0 0 0 3px rgba(var(--crm-rgb58-107-76-shadow), .15); }

/* Settings templates: pick one, or save the dials on the page under a name. */
.imao-templates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .9rem 1rem; padding: 1.1rem 1.5rem; background: rgba(var(--crm-rgb239-233-220-bg), .35); border-bottom: 1px solid rgba(var(--crm-rgb31-61-43-line), .08); }
.imao-templates > div { flex: 1 1 14rem; min-width: 0; }
.imao-templates-actions { flex: 0 0 auto !important; display: flex; flex-wrap: wrap; gap: .5rem; }
.imao-pill-btn { padding: .45rem 1.1rem; border-radius: 999px; border: 1.5px solid rgba(var(--crm-rgb58-107-76-line), .55); background: var(--crm-cffffff-bg); color: var(--crm-green-text); font-size: .86rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: all .15s ease; }
.imao-pill-btn:hover:not(:disabled) { background: var(--crm-green-bg); color: var(--crm-cffffff-text); }
.imao-pill-btn:disabled { opacity: .5; cursor: default; }
.imao-pill-btn.danger { border-color: rgba(var(--crm-rgb156-59-44-line), .5); color: var(--crm-c9c3b2c-text); }
.imao-pill-btn.danger:hover:not(:disabled) { background: var(--crm-c9c3b2c-bg); color: var(--crm-cffffff-text); }

.imao-check { display: inline-flex; align-items: center; gap: .45rem; align-self: center; font-size: .88rem; font-weight: 600; color: var(--crm-forest-text); cursor: pointer; }
.imao-check input { width: 1rem; height: 1rem; accent-color: var(--crm-green-other); cursor: pointer; }
.imao-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .85rem 1.5rem; font-size: .8rem; color: var(--crm-c6b6b64-text); }
.imao-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .4rem; vertical-align: -.05rem; border: 1px solid var(--crm-c2b2b28-line); }
.imao-legend i.faded { background: var(--crm-cc9c9c1-bg); border-color: var(--crm-c9a9a92-line); }
.imao-legend i.subject { background: var(--crm-cffffff-bg); border: 3px solid var(--crm-cb8892b-line); }

/* Fields on the pages match the lead window's (CrmModal styles its own). */
.imao-page .form-label { font-size: .8rem; font-weight: 600; color: var(--crm-forest-text); margin-bottom: .3rem; }
.imao-page .form-control,
.imao-page .form-select { border: 1px solid rgba(var(--crm-rgb31-61-43-line), .25); border-radius: 8px; color: var(--crm-ink-text); }
.imao-page .form-control:focus,
.imao-page .form-select:focus { border-color: var(--crm-green-line); box-shadow: 0 0 0 3px rgba(var(--crm-rgb58-107-76-shadow), .15); }

/* The pages' own navigation: pill links, the current page filled. */
.imao-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.imao-nav-link { padding: .4rem 1.1rem; border-radius: 999px; border: 1.5px solid rgba(var(--crm-rgb58-107-76-line), .55); background: var(--crm-cffffff-bg); color: var(--crm-green-text); font-size: .86rem; font-weight: 600; white-space: nowrap; }
.imao-nav-link:hover { background: var(--crm-green-bg); color: var(--crm-cffffff-text); }
.imao-nav-link.active { background: var(--crm-forest-bg); border-color: var(--crm-forest-line); color: var(--crm-cream-text); }

/* Run form: the address and its Run button share a row; suggestions drop below the address. */
.imao-run-top { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.imao-address { position: relative; flex: 1 1 auto; min-width: 0; }
.imao-run-btn { flex: 0 0 auto; padding: .5rem 2rem; border: none; line-height: 1.5; white-space: nowrap; }
.imao-use-btn { margin-top: 1rem; padding: .6rem 1.5rem; border: none; }
.btn-gold:disabled { background: var(--crm-gold-bg); color: var(--crm-ink-text); border-color: transparent; opacity: .5; cursor: default; transform: none; }
.imao-suggest { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: .3rem 0; list-style: none; background: var(--crm-cffffff-bg); border: 1px solid rgba(var(--crm-rgb31-61-43-line), .25); border-radius: 8px; box-shadow: var(--shadow-sm); max-height: 16rem; overflow: auto; }
.imao-suggest li { padding: .5rem .85rem; font-size: .92rem; color: var(--crm-ink-text); cursor: pointer; }
.imao-suggest li:hover,
.imao-suggest li.active { background: rgba(var(--crm-rgb239-233-220-bg), .7); color: var(--crm-forest-text); }

/* The investor MAO range on the lead window's Lead tab; the whole band opens the MAO page. */
.imao-lead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-radius: 8px; border: 1px solid rgba(var(--crm-rgb31-61-43-line), .12); background: var(--crm-cf4efe3-bg); color: var(--crm-ink-text); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
.imao-lead:hover { border-color: var(--crm-green-line); box-shadow: 0 0 0 3px rgba(var(--crm-rgb58-107-76-shadow), .12); color: var(--crm-ink-text); }
.imao-lead-main { min-width: 0; }
.imao-lead-label { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--crm-c6b6b64-text); }
.imao-lead-value { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.2; color: var(--crm-forest-text); }
.imao-lead-note { display: block; font-size: .84rem; color: var(--crm-c3d3d38-text); }
.imao-lead-go { flex: 0 0 auto; font-size: .84rem; font-weight: 600; color: var(--crm-green-text); white-space: nowrap; }

@media (max-width: 860px) {
    .imao-page.container { padding: 1rem 1.25rem 2.5rem; }
    .imao-body { padding: 1.1rem 1rem 1.25rem; }
    .imao-run-top { flex-direction: column; align-items: stretch; }
}
.imao-breakdown { margin-top: 1rem; }
.imao-result { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-radius: 8px; background: var(--crm-cf4efe3-bg); }
.imao-result-none { display: block; }
.imao-result-label { display: block; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--crm-c6b6b64-text); }
.imao-result-value { display: block; font-size: 1.9rem; font-weight: 700; color: var(--crm-forest-text); line-height: 1.1; }
.imao-result-sub { display: block; margin-top: .3rem; font-size: .88rem; color: var(--crm-c3d3d38-text); }
.imao-confidence { padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.imao-confidence-high { background: var(--crm-cddebdd-bg); color: var(--crm-c2e6b3f-text); }
.imao-confidence-medium { background: var(--crm-cf3e6c7-bg); color: var(--crm-c7a5a12-text); }
.imao-confidence-low { background: var(--crm-cf2dad5-bg); color: var(--crm-c9c3b2c-text); }
.imao-steps { margin: .9rem 0 .4rem; padding-left: 1.3rem; font-size: .9rem; }
.imao-steps li { margin-bottom: .35rem; }
.imao-reasons { margin: 0 0 .6rem; padding-left: 1.1rem; font-size: .82rem; color: var(--crm-c6b6b64-text); }
/* Scrolls down only: the cells wrap to fit, so there is never a sideways scroll. */
.imao-neighbors { max-height: 320px; overflow-x: hidden; overflow-y: auto; border: 1px solid var(--crm-ce6e0d2-line); border-radius: 6px; }
.imao-neighbors table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.imao-neighbors th { position: sticky; top: 0; background: var(--crm-cf4efe3-bg); font-weight: 600; padding: .45rem .5rem; text-align: left; }
.imao-neighbors td { padding: .4rem .5rem; border-top: 1px solid var(--crm-cefeae0-line); overflow-wrap: anywhere; }
.imao-neighbors .num { text-align: right; white-space: nowrap; overflow-wrap: normal; }

/* Narrow screens and the lead window on a phone: each neighbor becomes a labeled card. */
@media (max-width: 860px) {
    .imao-neighbors { max-height: none; border: none; }
    .imao-neighbors table,
    .imao-neighbors tbody { display: block; }
    .imao-neighbors thead { display: none; }
    .imao-neighbors tr { display: block; margin-bottom: .7rem; padding: .2rem .8rem; border: 1px solid var(--crm-ce6e0d2-line); border-radius: 10px; background: var(--crm-cffffff-bg); }
    .imao-neighbors td { display: grid; grid-template-columns: 96px 1fr; column-gap: .8rem; align-items: baseline; padding: .4rem 0; border-top: 1px solid var(--crm-cefeae0-line); }
    .imao-neighbors tr td:first-child { border-top: none; }
    .imao-neighbors td::before { content: attr(data-label); font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--crm-green-text); }
    .imao-neighbors td > * { grid-column: 2; justify-self: end; text-align: right; }
    .imao-neighbors td > .imao-tag { grid-row: 2; margin: .15rem 0 0; }
}
.imao-tag { margin-left: .35rem; padding: 0 .4rem; border-radius: 4px; font-size: .7rem; background: var(--crm-cf3e6c7-bg); color: var(--crm-c7a5a12-text); }
.imao-delete { color: var(--crm-c9c3b2c-text); }
.imao-popup { font-size: .8rem; line-height: 1.35; min-width: 13rem; }
.imao-popup strong { display: block; font-size: .88rem; margin-bottom: .2rem; }
.imao-popup-edit { margin-top: .4rem; border: 1px solid var(--crm-cb8892b-line); background: var(--crm-cffffff-bg); color: var(--crm-c7a5a12-text); border-radius: 4px; font-size: .78rem; padding: .1rem .5rem; cursor: pointer; }
.imao-subject { background: var(--crm-cffffff-bg); border: 4px solid var(--crm-cb8892b-line); border-radius: 50%; box-shadow: 0 0 0 2px var(--crm-cffffff-shadow); }
