/* ---- Deep Harbor: self-hosted web fonts (SIL OFL 1.1; see wwwroot/fonts/FONTS-LICENSE.txt) ---- */
@font-face {
    font-family: 'Hanken Grotesk';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/hanken-grotesk-variable.woff2') format('woff2');
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/public-sans-variable.woff2') format('woff2');
}

:root {
    --bg: #F7F9F9;
    --surface: #FFFFFF;
    --border: #E2EAEA;
    --text: #0E2A33;
    --muted: #5B6B6E;
    --primary: #0F766E;
    --primary-dark: #0B5750;
    --primary-soft: #CCFBF1;
    --signal: #22C55E;
    --amber: #F59E0B;
    --danger: #B4462F;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(14, 42, 51, .06), 0 1px 3px rgba(14, 42, 51, .05);
    --bottom-nav-height: 0px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
h1:focus { outline: none; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .5rem; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Topbar ── */
.topbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
}

.brand {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--primary); }
.brand small {
    font-weight: 500;
    font-size: .75rem;
    color: var(--muted);
    margin-left: .35rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.nav-links { display: flex; gap: .25rem; }
.nav-links a {
    color: var(--muted);
    padding: .4rem .75rem;
    border-radius: 8px;
    font-weight: 500;
}
.nav-links a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-links a.active { background: var(--primary-soft); color: var(--primary-dark); }

.cta-area { margin-left: auto; }

/* ── Content ── */
.content {
    padding: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    gap: 1rem;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .85rem 1rem;
    margin-bottom: .75rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: .38rem .75rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { padding: .65rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
}
.badge-available { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem .75rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
    padding: .38rem .55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-intro { color: var(--muted); margin: 0 0 1.25rem; }
.form-actions { margin-top: 1.25rem; }

.math-challenge {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.math-challenge span {
    font-weight: 600;
    white-space: nowrap;
}
.math-challenge input {
    width: 80px;
    padding: .38rem .55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}
.math-challenge input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.muted { color: var(--muted); }
.empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--muted);
}
.error-text { color: var(--danger); font-size: .85rem; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; font-size: .8rem; }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 3rem 1rem 2.5rem;
}
.hero h1 {
    font-size: 2.2rem;
    margin-bottom: .75rem;
}
.hero p {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
}
.hero-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Features ── */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
}
.feature-icon {
    margin-bottom: .75rem;
}
.feature-icon svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
}
.feature-card p {
    color: var(--muted);
    font-size: .9rem;
    margin: 0;
}

/* The front page's squares are links to the tour: they must look it and act it. */
a.feature-card {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.feature-card:hover, a.feature-card:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(14, 42, 51, .10);
    transform: translateY(-2px);
}
a.feature-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.feature-more {
    display: inline-block;
    margin-top: .9rem;
    color: var(--primary);
    font-weight: 600;
    font-size: .9rem;
}

.renter-door {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
}
.renter-door p { margin: 0; }
.renter-door strong { color: var(--text); }
.cta-area { display: flex; gap: .5rem; align-items: center; }

/* ── Tour ── */
.tour-section {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 2rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 5rem;
}
.tour-flip .tour-text { order: 2; }

/* A real screen, small, in a plain window frame. */
.shot {
    position: relative;
    margin: 0;
    padding-top: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(14, 42, 51, .16);
    overflow: hidden;
}
.shot::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    box-shadow: 10px 0 0 var(--border), 20px 0 0 var(--border);
}
.shot img { display: block; width: 100%; height: auto; }

/* Three screens overlapping, under the tour's heading. */
.tour-fan {
    position: relative;
    max-width: 720px;
    aspect-ratio: 700 / 440;
    margin: 0 auto 2rem;
}
.tour-fan .shot { position: absolute; }
.tour-fan .shot-back { left: 22%; top: 0; width: 55%; }
.tour-fan .shot-left { left: 1%; top: 57%; width: 48%; }
.tour-fan .shot-right { left: 50%; top: 42%; width: 48%; }
@media (max-width: 760px) {
    .tour-fan { aspect-ratio: auto; }
    .tour-fan .shot { position: relative; left: auto; top: auto; width: 100%; }
    .tour-fan .shot-left, .tour-fan .shot-right { display: none; }
    .tour-people { grid-template-columns: 1fr; }
}
@media (min-width: 761px) and (max-width: 1000px) {
    .tour-people { grid-template-columns: repeat(3, 1fr); }
}
.tour-text h2 { margin: 0 0 .6rem; font-size: 1.5rem; }
.tour-text p { margin: 0 0 .9rem; }
.tour-text ul { margin: 0 0 .9rem; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.tour-art svg { width: 100%; height: auto; display: block; }
.art-panel { fill: var(--bg); stroke: var(--border); }
.art-line { fill: var(--border); }
.art-strong { fill: var(--text); opacity: .75; }
.art-fade { fill: var(--muted); opacity: .35; }
.art-row circle, .art-row rect { fill: var(--muted); opacity: .3; }
.art-row .art-accent, .art-accent { fill: var(--primary); opacity: .85; }
.art-row .art-warn { fill: var(--amber); opacity: .9; }
.art-accent-soft { fill: var(--primary-soft); }
.art-bubble { fill: var(--surface); stroke: var(--border); }
.art-input { fill: var(--surface); stroke: var(--border); }
/* What a tenant sees, with what a vendor sees laid over its corner. */
.tour-pair { position: relative; aspect-ratio: 10 / 9; max-width: 420px; width: 100%; margin: 0 auto; }
.tour-pair .shot { position: absolute; }
.tour-pair .shot-tall { left: 0; top: 0; width: 60%; }
.tour-pair .shot-wide { right: 0; bottom: 4%; width: 68%; }
.tour-people {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .75rem;
}
.tour-person {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    background: var(--bg);
}
.tour-person h3 { margin: 0 0 .25rem; font-size: 1rem; color: var(--primary-dark); }
.tour-person p { margin: 0; font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) {
    .tour-section { grid-template-columns: 1fr; padding: 1.25rem; }
    .tour-flip .tour-text { order: 0; }
}
@media (prefers-reduced-motion: reduce) {
    a.feature-card { transition: none; }
    a.feature-card:hover, a.feature-card:focus-visible { transform: none; }
}

/* ── Unit Grid ── */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: .85rem;
}
.unit-card { display: flex; flex-direction: column; }
.unit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .7rem;
}
.unit-header h2 { margin: 0; font-size: 1.05rem; }
.unit-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .35rem 1rem;
    margin-bottom: .7rem;
}
.detail { display: flex; flex-direction: column; gap: .15rem; }
.detail-lbl {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.unit-price {
    margin-bottom: .7rem;
}
.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.price-period {
    font-size: .9rem;
    color: var(--muted);
}

/* ── Success Card ── */
.success-card {
    text-align: center;
    padding: 3rem 1.5rem;
}
.success-icon {
    color: #16a34a;
    margin-bottom: 1rem;
}
.success-card h2 {
    color: #166534;
    margin-bottom: .5rem;
}
.success-card p {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* ── Legal ── */
.legal-content {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.legal-content h2 {
    color: var(--primary-dark);
}
.legal-content p {
    color: var(--muted);
    margin: 0 0 .75rem;
    line-height: 1.65;
}
.legal-content p:last-child {
    margin-bottom: 0;
}
.legal-content h3 {
    font-size: 1rem;
    margin: 1rem 0 .35rem;
}
.legal-content ul {
    color: var(--muted);
    margin: 0 0 .75rem;
    padding-left: 1.2rem;
    line-height: 1.65;
}
.legal-content li {
    margin-bottom: .3rem;
}
.form-legal-note {
    color: var(--muted);
    font-size: .88rem;
    margin: .75rem 0 0;
    line-height: 1.5;
}

/* ── Fair Housing Notice (Apply form) ── */
.fair-housing-notice {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: var(--primary-soft);
    border-radius: 8px;
    font-size: .85rem;
    color: var(--muted);
}
.fair-housing-notice svg {
    flex-shrink: 0;
    color: var(--primary);
}
.fair-housing-notice a {
    margin-left: auto;
    white-space: nowrap;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--muted);
    font-size: .85rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.site-footer p { margin: .25rem 0 0; }

.footer-fair-housing {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .25rem;
}
.equal-housing-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* ── Mobile ── */
.mobile-overlay { display: none; }
.mobile-drawer { display: none; }
.bottom-nav { display: none; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }

@media (max-width: 768px) {
    /* 16px inputs stop iOS Safari auto-zooming on focus */
    .field input, .field select, input[type="search"], .topbar-search input { font-size: 16px; }
    :root { --bottom-nav-height: 60px; }

    .hamburger { display: flex; }
    .nav-links { display: none; }
    .cta-area { display: none; }
    .topbar { gap: 1rem; padding: 0 1rem; }

    .content {
        padding: 1rem;
        padding-bottom: calc(1rem + var(--bottom-nav-height));
    }

    h1 { font-size: 1.3rem; }
    .hero h1 { font-size: 1.6rem; }
    .hero { padding: 2rem 1rem 1.5rem; }

    .features { grid-template-columns: 1fr; }

    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 20;
    }

    .mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        background: var(--surface);
        z-index: 30;
        padding: 0;
        box-shadow: 4px 0 12px rgba(0, 0, 0, .1);
    }
    .drawer-header {
        padding: 1.25rem 1.25rem 1rem;
        border-bottom: 1px solid var(--border);
    }
    .mobile-drawer a {
        display: block;
        padding: .85rem 1.25rem;
        color: var(--text);
        font-weight: 500;
        font-size: .95rem;
    }
    .mobile-drawer a:hover { background: var(--bg); text-decoration: none; }
    .mobile-drawer a.active { color: var(--primary-dark); background: var(--primary-soft); }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-height);
        background: var(--surface);
        border-top: 1px solid var(--border);
        z-index: 10;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: var(--muted);
        font-size: .65rem;
        font-weight: 500;
        padding: .4rem .75rem;
        text-decoration: none;
    }
    .bottom-nav a svg {
        width: 22px;
        height: 22px;
    }
    .bottom-nav a.active {
        color: var(--primary);
    }

    .card { padding: 1rem; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: 1; }
    .unit-grid { grid-template-columns: 1fr; }

    .site-footer {
        padding-bottom: calc(1.5rem + var(--bottom-nav-height));
    }

    .page-head { flex-wrap: wrap; }
}

/* Horizontally scroll wide data tables instead of overflowing the viewport (mobile). */
.card-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- Deep Harbor: dark mode ---- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #081A20;
        --surface: #0E2A33;
        --border: #1C3A42;
        --text: #EAF2F1;
        --muted: #9DB2B2;
        --primary: #2DD4BF;
        --primary-dark: #5EEAD4;
        --primary-soft: #10362F;
        --danger: #F87171;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
    }
}

/* ---- Deep Harbor: align figures wherever numbers stack ---- */
table.grid td, .stat .num, .metric .v { font-variant-numeric: tabular-nums; }

/* ---- Deep Harbor: in-app theme toggle (explicit choice overrides OS pref) ---- */
:root[data-theme="light"] {
    --bg: #F7F9F9; --surface: #FFFFFF; --border: #E2EAEA; --text: #0E2A33;
    --muted: #5B6B6E; --primary: #0F766E; --primary-dark: #0B5750;
    --primary-soft: #CCFBF1; --danger: #B4462F;
    --shadow: 0 1px 2px rgba(14, 42, 51, .06), 0 1px 3px rgba(14, 42, 51, .05);
}
:root[data-theme="dark"] {
    --bg: #081A20; --surface: #0E2A33; --border: #1C3A42; --text: #EAF2F1;
    --muted: #9DB2B2; --primary: #2DD4BF; --primary-dark: #5EEAD4;
    --primary-soft: #10362F; --danger: #F87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
}
.btn-theme {
    background: none; border: 1px solid var(--border); color: var(--muted);
    border-radius: 8px; width: 36px; height: 32px; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1;
    flex: none;
}
.btn-theme:hover { background: var(--bg); color: var(--text); }
.btn-theme::before { content: "\263E"; }
:root[data-theme="dark"] .btn-theme::before { content: "\2600"; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .btn-theme::before { content: "\2600"; } }

/* Deep Harbor display face */
h1, h2, .brand, .stat .num { font-family: "Hanken Grotesk", "Public Sans", system-ui, sans-serif; letter-spacing: -.01em; }

/* Deep Harbor: logo mark in the wordmark */
.brand-mark { width: 1.5em; height: 1.5em; color: var(--primary); vertical-align: middle; margin-right: .35rem; }
