/* ============================================================
   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(--ink);
    background-color: #fff;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--green-900);
    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(--green-600);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--gold-dark); }

.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(--gold);
    color: var(--ink);
}
.btn-gold:hover {
    background: var(--gold-dark);
    color: #fff;
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    border-color: var(--cream);
    color: var(--cream);
}
.btn-ghost:hover {
    background: var(--cream);
    color: var(--green-900);
}

/* ---------- 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(--gold-dark);
    margin-bottom: 1rem;
}
.status-page h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    color: var(--green-900);
    margin-bottom: 1rem;
}
.status-page p {
    color: var(--green-600);
    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(--green-600);
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--green-900);
    border-bottom: 3px solid var(--gold);
}
.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(--cream);
    font-family: Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: .01em;
}
.brand:hover { color: #fff; }
.brand .logo-mark {
    width: 62px;
    height: 42px;
    flex: 0 0 auto;
    background-color: var(--gold);
    -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(--gold);
    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(--cream);
    font-size: .95rem;
    font-weight: 500;
    padding: .35rem 0;
    border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--gold); }
.nav-links a.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}
.nav-links .btn { padding: .55rem 1.4rem; border-bottom: none; }
.nav-links .btn:hover { color: #fff; }

/* 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; }
.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(--gold);
    color: var(--green-900);
    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(--cream); }
.avatar-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    min-width: 220px;
    background: #fff;
    border: 1px solid rgba(31, 61, 43, .10);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .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(--green-600);
    border-bottom: 1px solid rgba(31, 61, 43, .10);
    margin-bottom: .35rem;
}
.avatar-dropdown .avatar-signed-in strong {
    color: var(--green-900);
    font-size: .95rem;
}
.avatar-dropdown a {
    display: block;
    padding: .55rem 1.1rem;
    color: var(--green-900);
    font-size: .92rem;
    font-weight: 500;
}
.avatar-dropdown a:hover,
.avatar-dropdown a.active { background: var(--cream); color: var(--green-900); }

/* ============================================================
   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(31, 61, 43, 0.97) 0%,
            rgba(31, 61, 43, 0.92) 25%,
            rgba(31, 61, 43, 0.70) 45%,
            rgba(31, 61, 43, 0.35) 70%,
            rgba(31, 61, 43, 0.10) 100%
        ),
        url('img/hero.jpg');
    background-size: cover, cover;
    background-position: center, center right;
    background-repeat: no-repeat, no-repeat;
    color: var(--cream);
    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(31, 61, 43, 0.92) 0%,
                rgba(31, 61, 43, 0.80) 60%,
                rgba(31, 61, 43, 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(200,162,75,.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(--gold);
    font-weight: 600;
    margin-bottom: 1.1rem;
}
.hero h1 {
    color: #fff;
    font-size: clamp(2.2rem, 5vw, 3.7rem);
    max-width: 18ch;
    margin-bottom: 1.2rem;
}
.hero h1 .accent { color: var(--gold); }

/* ---------- 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(239, 233, 220, .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(--cream); }
.section.ink { background: var(--ink); color: var(--cream); }

.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(--gold-dark);
    font-weight: 700;
    margin-bottom: .6rem;
}
.section.ink .section-head h2 { color: #fff; }
.section.ink .section-head p { color: rgba(239,233,220,.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(--gold);
    font-weight: 700;
    line-height: 1;
}
.stat .label {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .82rem;
    color: rgba(239,233,220,.8);
    margin-top: .6rem;
}

/* ---------- Cards / services ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
}
.card-x {
    background: #fff;
    border: 1px solid rgba(31,61,43,.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(--cream);
    color: var(--green-600);
    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: #4a4a44; margin-bottom: 0; }

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

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

/* ---------- Contact / SMS opt-in form ---------- */
.contact-form {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(31, 61, 43, .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(--green-900);
    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(--ink);
    background: #fff;
    border: 1px solid rgba(31, 61, 43, .25);
    border-radius: 8px;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(58, 107, 76, .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: #4a4a44;
    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: #4a4a44;
}

@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(--green-900);
    color: var(--cream);
    padding: 3.5rem 0;
    border-bottom: 3px solid var(--gold);
}
.page-hero h1 { color: #fff; margin: 0; }
.page-hero .updated { color: var(--gold); 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(--cream);
}
.legal h2:first-of-type { margin-top: 0; }
.legal h3 { font-size: 1.15rem; margin-top: 1.6rem; }
.legal p, .legal li { color: #3a3a35; }
.legal ul { padding-left: 1.3rem; }
.legal li { margin-bottom: .5rem; }
.legal .intro { font-size: 1.1rem; color: var(--ink); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: var(--ink);
    color: rgba(239,233,220,.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(239,233,220,.15);
}
.site-footer h4 {
    color: var(--gold);
    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(239,233,220,.8); display: block; margin-bottom: .5rem; }
.site-footer .footer-links a:hover { color: var(--gold); }
.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(239,233,220,.6);
}
.footer-bottom a { color: rgba(239,233,220,.6); }
.footer-bottom a:hover { color: var(--gold); }

/* ============================================================
   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(--cream);
        font-size: 1.7rem;
        line-height: 1;
        cursor: pointer;
        user-select: none;
    }
    .nav-links {
        position: absolute;
        top: 74px;
        left: 0;
        right: 0;
        background: var(--green-900);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0 1.5rem;
        border-bottom: 0 solid var(--gold);
        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(239, 233, 220, .10);
    }
    .nav-links a.active {
        color: var(--gold);
        border-bottom-color: rgba(239, 233, 220, .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(--gold);
    }
}

/* ============================================================
   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(200, 162, 75, .16); color: var(--gold-dark);  border: 1px solid rgba(200, 162, 75, .50); }
.pill-cool  { background: rgba(239, 233, 220, .80); color: var(--green-900); border: 1px solid rgba(31, 61, 43, .18); }
.pill-warm  { background: rgba(58, 107, 76, .12);  color: var(--green-600); border: 1px solid rgba(58, 107, 76, .40); }
.pill-won   { background: var(--green-900);        color: var(--cream);     border: 1px solid var(--green-900); }
.pill-dead  { background: rgba(43, 43, 40, .07);   color: #6B6B64;          border: 1px solid rgba(43, 43, 40, .15); }
.pill-brick { background: rgba(156, 59, 44, .12);  color: #9C3B2C;          border: 1px solid rgba(156, 59, 44, .35); }

/* Blazor error UI (kept from template) */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 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;
}
