/* Brand variables (--primary, --hero-bg, --heading-font, ...) are injected per site
   from the "brand" block in data/site.json and data/companies.json. */
:root {
  --ink: #1f1d1b;
  --muted: #625b55;
  --card: #ffffff;
  --line: #e4ddd2;
  --now: #2a7444;
  --soon: #9a6614;
  --radius: 12px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); line-height: 1.55; font-family: var(--body-font); }
h1, h2 { font-family: var(--heading-font); font-weight: 700; letter-spacing: .01em; }
a { color: var(--link); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header / footer */
.site-header { background: var(--card); border-bottom: 4px solid var(--highlight); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { font-family: var(--heading-font); font-size: 1.4rem; color: var(--ink); text-decoration: none; border-left: 5px solid var(--primary); padding-left: 10px; }
.logo.has-img { border: 0; padding: 0; }
nav { display: flex; gap: 20px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 4px 0; border-bottom: 3px solid transparent; }
nav a:hover { border-bottom-color: var(--highlight); }
.site-footer { margin-top: 64px; background: var(--footer-bg); color: #e9e6e1; padding: 32px 0 20px; font-size: .92rem; }
.site-footer a { color: var(--footer-link); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.eho { max-width: 360px; display: flex; gap: 10px; align-items: flex-start; }
.eho-icon { font-size: 1.6rem; line-height: 1; }
.copyright { margin-top: 20px; opacity: .7; font-size: .85rem; }

/* Hero */
.hero { background: var(--hero-bg); color: var(--hero-ink); padding: 56px 0; border-bottom: 6px solid var(--highlight); }
.hero-inner { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin: 0 0 12px; line-height: 1.15; max-width: 680px; }
.hero p { font-size: 1.1rem; max-width: 620px; margin: 0 0 24px; opacity: .92; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn { background: var(--hero-btn); color: var(--hero-btn-ink); border-color: var(--hero-btn); }
.hero .btn.ghost { background: transparent; color: var(--hero-ink); border-color: var(--hero-ink); }
.hero-logo, .hero-logos a { background: #fff; border-radius: 16px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.hero-logos { display: grid; gap: 14px; }
.hero-logos a { display: flex; justify-content: center; transition: transform .15s; }
.hero-logos a:hover { transform: scale(1.03); }

/* Buttons */
.btn { display: inline-block; background: var(--primary); color: var(--primary-ink); border: 2px solid var(--primary-border); padding: 10px 20px; border-radius: 999px; text-decoration: none; font-weight: 700; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--link); }
.btn.block { display: block; width: 100%; }

/* Filters + grid */
#listings { padding-top: 32px; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; background: var(--card); padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); }
.filters label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; color: var(--muted); gap: 4px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.filters select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; min-width: 120px; color: var(--ink); }
.count { color: var(--muted); margin: 16px 0 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.card-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.placeholder { display: flex; align-items: flex-end; justify-content: flex-start; padding: 12px; background: linear-gradient(160deg, color-mix(in srgb, var(--highlight) 35%, #fff), var(--hero-bg)); color: #fff; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; }
.card-body { padding: 14px 16px 16px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 { font-size: 1.02rem; margin: 6px 0 4px; }
.rent { font-size: 1.35rem; font-weight: 800; }
.rent small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.rent.big { font-size: 2rem; margin: 8px 0 16px; }
.specs, .addr { margin: 0; color: var(--muted); font-size: .92rem; }
.mgr { display: inline-block; margin: 10px 0 0; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); border: 1.5px solid var(--primary-border); }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: #fff; white-space: nowrap; }
.badge.now { background: var(--now); }
.badge.soon { background: var(--soon); }
.empty { background: var(--card); padding: 24px; border-radius: var(--radius); text-align: center; }

/* Companies */
.companies, .about { margin-top: 56px; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.company { background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--highlight); border-radius: var(--radius); padding: 20px 22px; }
.company h2, .company h3 { margin-top: 0; }
.company-logo { display: inline-block; margin-bottom: 4px; }
.stack { display: grid; gap: 10px; margin: 16px 0; }

/* Property page */
.page, .property { padding-top: 32px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 680px; }
.crumbs a { text-decoration: none; font-weight: 600; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(80%, 1fr); gap: 10px; overflow-x: auto; border-radius: var(--radius); scroll-snap-type: x mandatory; }
.gallery > * { scroll-snap-align: start; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.gallery:has(> :only-child) { grid-auto-columns: 100%; }
.property-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; margin-top: 24px; align-items: start; }
.property h1 { margin: 0 0 4px; line-height: 1.2; }
.facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.facts li { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--highlight); border-radius: 10px; padding: 10px 16px; color: var(--muted); font-size: .85rem; }
.facts strong { display: block; color: var(--ink); font-size: 1.2rem; }
.features { columns: 2; padding-left: 20px; }
.features li::marker { color: var(--highlight); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.details dt { font-weight: 600; color: var(--muted); }
.details dd { margin: 0; }
.apply-box { background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--highlight); border-radius: var(--radius); padding: 20px; position: sticky; top: 100px; display: grid; gap: 10px; }
.apply-box .badge { justify-self: start; }
.apply-box .rent.big { margin: 0 0 6px; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }

@media (max-width: 800px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-logo { display: none; } /* already shown in the header */
  .hero-logos { grid-template-columns: 1fr 1fr; }
  .hero-logos img { height: 64px !important; }
  .property-grid { grid-template-columns: 1fr; }
  .apply-box { position: static; }
  .features { columns: 1; }
  .header-inner { justify-content: center; }
  nav { gap: 16px; }
}

/* Tenant login */
nav a.nav-login { padding: 7px 16px; border: 2px solid var(--primary-border); color: var(--primary-ink); }
nav a.nav-login:hover { border-bottom-color: var(--primary-border); }
.btn.big { padding: 14px 20px; font-size: 1.1rem; }
.portal-features { list-style: none; padding: 0; margin: 18px 0 4px; display: grid; gap: 8px; }
.portal-features li { padding-left: 28px; position: relative; }
.portal-features li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--highlight); color: var(--hero-bg); font-size: .75rem; font-weight: 800; display: grid; place-items: center; margin-top: 2px; }
.secure-note { margin-top: 24px; }
.company-grid:has(> :only-child) { max-width: 640px; }

/* Release number, top-right corner of every page */
.release { position: absolute; top: 4px; right: 10px; z-index: 11; font-size: .7rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted); background: var(--page); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; text-decoration: none; }
.release:hover { color: var(--ink); }
.site-header { position: sticky; }
.header-inner { padding-top: 24px; }

/* Trademark marks next to logos */
.tm-wrap { display: inline-flex; align-items: flex-start; }
.tm { font-size: .6rem; font-weight: 700; color: var(--muted); margin-left: 1px; line-height: 1; }
.hero-logo .tm, .hero-logos .tm { color: #555; font-size: .75rem; }
.copyright { line-height: 1.6; }

/* Apply page / application fee */
.fee-note { margin: 4px 0 0; color: var(--ink); }
.steps { padding-left: 20px; } .steps li { margin-bottom: 8px; }

/* TucsonAZ.Rentals brand: wordmark + two-tone stripe (MBP gold + Markus Homes lime) */
.logo.brandmark { display: inline-flex; align-items: center; gap: 10px; border: 0; padding: 0; text-decoration: none; line-height: 1; }
.brandmark img { width: 46px; height: 46px; }
.brandmark .bm-a { font-family: 'Archivo Black', system-ui, sans-serif; font-size: 1.45rem; letter-spacing: -.01em; color: var(--primary); text-transform: uppercase; }
.brandmark .bm-a b { font-weight: inherit; color: #3aa312; }
.brandmark .bm-text { display: inline-flex; align-items: baseline; }
.brandmark .bm-b { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 1.25rem; color: var(--highlight); text-transform: uppercase; letter-spacing: .04em; }
.site-header { border-bottom: 4px solid var(--highlight); border-image: linear-gradient(90deg, var(--highlight) 0 50%, var(--highlight2, var(--highlight)) 50% 100%) 1; }
.hero { border-bottom: 6px solid var(--highlight); border-image: linear-gradient(90deg, var(--highlight2, var(--highlight)) 0 50%, var(--highlight) 50% 100%) 1; }
@media (max-width: 520px) { .brandmark .bm-a { font-size: 1.1rem; } .brandmark .bm-b { font-size: .95rem; } .brandmark img { width: 38px; height: 38px; } }

/* Suggestion button + questionnaire */
.suggest-fab { position: fixed; right: 16px; bottom: 16px; z-index: 20; background: var(--primary); color: var(--primary-ink); border: 2px solid var(--primary-border);
  border-radius: 999px; padding: 10px 16px; font-weight: 700; text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.suggest-fab:hover { filter: brightness(1.1); }
.suggest-form { max-width: 720px; display: grid; gap: 4px; }
.suggest-form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.suggest-form legend { font-weight: 700; margin-bottom: 6px; }
.suggest-form .opt { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 6px 0; font-weight: 500; }
.suggest-form input:not([type=radio]):not([type=checkbox]), .suggest-form select, .suggest-form textarea {
  display: block; width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.suggest-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.suggest-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.err { background: #fbeaea; border: 1px solid #e2a5a5; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
@media (max-width: 560px) { .suggest-form .two { grid-template-columns: 1fr; } .suggest-fab { padding: 8px 12px; font-size: .9rem; } }
.btn { font-family: inherit; font-size: inherit; cursor: pointer; }

/* Online rental application */
.app-form { display: grid; gap: 16px; max-width: 980px; }
.app-form h2 { margin: 0 0 10px; font-size: 1.15rem; }
.app-form label { display: block; font-weight: 600; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.app-form input:not([type=radio]):not([type=checkbox]), .app-form select, .app-form textarea { display: block; width: 100%; font: inherit; color: var(--ink); padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: 4px; }
.app-form .g2, .app-form .g3, .app-form .g4 { display: grid; gap: 0 12px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.app-form .secure { background: #f4f1ff00; border: 2px dashed var(--highlight); border-radius: 10px; padding: 10px 12px 2px; margin-top: 6px; }
.app-form .secure-h { font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.app-form .opt { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; color: var(--ink); font-size: .95rem; }
.app-form .opt input { margin-top: 4px; } .app-form fieldset { border: 0; padding: 0; margin: 0 0 12px; } .app-form legend { font-weight: 700; margin-bottom: 6px; }
.app-form .yn .opt { display: inline-flex; margin-right: 18px; } .app-form details { margin: 6px 0 12px; } .app-form summary { cursor: pointer; font-weight: 600; }
.app-form .acks details { background: var(--page); border-radius: 10px; padding: 10px 14px; } .ack-list { display: grid; gap: 8px; margin: 12px 0; }
.app-form .sig { font-family: 'Brush Script MT', cursive; font-size: 1.4rem; }
.note-box { background: #eef4fb; border: 1px solid #b9cfe6; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .95rem; }
@media (max-width: 760px) { .g3, .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* Zelle payment */
.zelle { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 5px solid #6d1ed4; border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.zelle img { width: 150px; height: 150px; image-rendering: pixelated; flex: none; }
.zelle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.pay-section { background: var(--page); border-radius: 10px; padding: 12px 14px; margin: 12px 0; } .pay-section h3 { margin: 0 0 6px; font-size: 1.05rem; }
@media (max-width: 520px) { .zelle { flex-direction: column; align-items: flex-start; } }

/* Signature pad + ID photos */
.sigpad { position: relative; border: 2px dashed var(--line); border-radius: 10px; background: #fff; margin: 4px 0 14px; }
.sigpad canvas { display: block; width: 100%; height: 160px; touch-action: none; cursor: crosshair; border-bottom: 2px solid #333; }
.sigpad .btn { position: absolute; right: 8px; top: 8px; }
.id-prev { display: block; max-width: 100%; max-height: 140px; margin-top: 6px; border-radius: 6px; border: 1px solid var(--line); }

/* Floor plan */
.floorplan { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.floorplan img { width: 100%; height: auto; }

/* Showing scheduler */
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.days .day, .slots .slot { flex: none; font: inherit; font-size: .9rem; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.days .day.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary-border); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-bottom: 8px; }
.slots .slot.on { background: var(--highlight); border-color: var(--highlight); color: #111; font-weight: 700; }

/* Tenant login: centered on every screen */
.login-page { text-align: center; }
.login-page .lead { margin-left: auto; margin-right: auto; }
.login-page .company-grid { margin: 0 auto; }
.login-page .company { text-align: left; }
.login-page .company h2 { text-align: center; }
.login-page .secure-note { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Phones: the browser applies this automatically on screens 640px wide or less */
.mobile-cta { display: none; }
@media (max-width: 640px) {
  .site-header { position: static; }
  .header-inner { min-height: 0; padding-top: 24px; padding-bottom: 8px; gap: 4px; justify-content: center; }
  .logo.has-img img { height: 38px !important; }
  nav { width: 100%; justify-content: center; gap: 4px; }
  nav a { padding: 10px 12px; }
  nav a.nav-login { padding: 8px 16px; }
  .release { font-size: .62rem; top: 3px; right: 6px; }
  .hero { padding: 32px 0; }
  .hero p { font-size: 1rem; }
  .hero-actions .btn { display: block; width: 100%; }
  .page, .property { padding-top: 20px; }
  .page h1, .property h1 { font-size: 1.65rem; line-height: 1.2; }
  .lead { font-size: 1rem; }
  .company, .apply-box { padding: 18px 16px; }
  .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters { gap: 10px; }
  .filters label { flex: 1 1 40%; }
  .filters select { min-width: 0; width: 100%; }
  input, select, textarea { font-size: 16px !important; }   /* stops iPhones zooming into fields */
  .days .day, .slots .slot { padding: 11px 12px; }
  .site-footer { margin-top: 40px; }
  .suggest-fab { right: 12px; bottom: 12px; padding: 10px 13px; font-size: 1.1rem; line-height: 1; }
  .suggest-fab .fab-label { display: none; }
  .mobile-cta { display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0,0,0,.08); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .mobile-cta .mc-rent { flex: 1; font-size: 1.15rem; } .mobile-cta .mc-rent small { color: var(--muted); font-size: .8rem; }
  .mobile-cta .btn { padding: 10px 16px; }
  body:has(.mobile-cta) { padding-bottom: 76px; }
  body:has(.mobile-cta) .suggest-fab { display: none; }
}

/* Spam-trap fields: hidden from people on every form (bots fill them in) */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* HUD Equal Housing Opportunity logo (official artwork from 24 CFR Part 110), footer of every page */
.eho { align-items: center; }
.eho .eho-logo { width: 72px; height: 72px; flex: none; }
