/* Shared "sibling" theme for every property's public front door.
   This is a clean placeholder; real photography, fonts, and brand assets from
   Degmar / Marlowe will replace these tokens. Keep all per-brand values here so
   the whole family of property pages restyles from one place. */

:root {
  --navy: #14304a;
  --navy-deep: #0e2336;
  --gold: #b58d3c;
  --ink: #17171d;
  --muted: #6b6c72;   /* CertBunker #6f7076, nudged 1 notch darker for AA on paper */
  --surface: #ffffff;
  --surface-alt: #f2f2ee;   /* warm paper (from CertBunker) */
  --border: #e5e5df;
  --radius: 10px;
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-alt);
  line-height: 1.55;
}
a { color: var(--navy); }
.muted { color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--navy); color: #fff;
  padding: 0.9rem clamp(1rem, 4vw, 2rem);
}
.brand { color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.lang-switch { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lang-switch a {
  color: #cfdcea; text-decoration: none; font-size: 0.9rem;
  padding: 0.15rem 0.5rem; border-radius: 6px;
}
.lang-switch a.active, .lang-switch a:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Layout */
.site-main { max-width: var(--maxw); margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.5rem); }
.site-footer {
  max-width: var(--maxw); margin: 2rem auto 0; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2.5rem;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem;
}

/* Hero */
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--navy); margin: 0 0 0.5rem; }

/* Buttons */
.button {
  display: inline-block; margin-top: 0.75rem;
  padding: 0.6rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); color: var(--navy); text-decoration: none;
  border: 1px solid var(--navy); font-weight: 600;
}
.button:hover { background: var(--navy); color: #fff; }
.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-deep); }
.button--primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

/* Property grid (landing) */
.property-grid {
  display: grid; gap: 1.25rem; margin-top: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.property-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; display: flex; flex-direction: column;
}
.property-card h2 { color: var(--navy); margin: 0.6rem 0 0.25rem; font-size: 1.25rem; }
/* Pin the action to the bottom so side-by-side cards align their buttons. */
.property-card .button { margin-top: auto; align-self: flex-start; }
.property-card__photo, .property-hero__photo {
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  border-radius: 8px; aspect-ratio: 16 / 9;
}

/* Property front door */
.property-hero { display: grid; gap: 1.25rem; margin-bottom: 1.5rem; }
.property-hero__intro h1 { color: var(--navy); margin: 0 0 0.25rem; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.property-info, .property-apply {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-top: 1.25rem;
}
.property-info h2, .property-apply h2 { color: var(--navy); margin-top: 0; }

@media (min-width: 760px) {
  .property-hero { grid-template-columns: 1fr 1fr; align-items: center; }
}

/* ── Header right cluster: main nav | separator | language pill ── */
.header-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.main-nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.main-nav a { color: #cfdcea; text-decoration: none; font-size: 0.92rem; font-weight: 500; }
.main-nav a:hover { color: #fff; text-decoration: underline; }
/* "Admin" door, set apart from the resident "Sign in" as an outlined chip */
.main-nav a.nav-admin { border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 0.22rem 0.75rem; }
.main-nav a.nav-admin:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.header-sep { width: 1px; align-self: stretch; min-height: 26px; background: rgba(255,255,255,.22); }

/* Language dropdown — a pill, no JS (native <details>), clearly separate from the nav */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.24);
  padding: 0.32rem 0.7rem; border-radius: 999px; font-size: 0.9rem; white-space: nowrap;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { background: rgba(255,255,255,.2); }
.lang-menu__caret { font-size: 0.7rem; opacity: .85; }
.lang-menu[open] .lang-menu__caret { transform: rotate(180deg); }
.lang-menu__list {
  position: absolute; right: 0; top: calc(100% + 0.45rem); z-index: 30;
  list-style: none; margin: 0; padding: 0.35rem; min-width: 170px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md);
}
.lang-menu__list li { margin: 0; }
.lang-menu__list a { display: block; padding: 0.45rem 0.6rem; border-radius: 7px;
  color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.lang-menu__list a:hover { background: var(--surface-alt); }
.lang-menu__list a.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }

/* ── Flash messages ── */
.flashes { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.flash { padding: 0.7rem 1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.flash--success { border-color: var(--ok); background: var(--ok-soft); }
.flash--error { border-color: var(--danger); background: var(--danger-soft); }

/* ── Forms ── */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; max-width: 460px; }
.form-card--wide { max-width: 720px; }
.form-card h1 { color: var(--navy); margin-top: 0; }
.form-card label { display: block; margin: 0.9rem 0 0.25rem; font-weight: 600; }
.form-card label.checkbox { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; }
.form-card input[type=text], .form-card input[type=email], .form-card input[type=password],
.form-card input[type=number], .form-card select, .form-card textarea, .form-card input[type=file] {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; font-weight: 400; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: 2px solid var(--navy); outline-offset: 1px; }
.field-error { color: #c03b3b; font-size: 0.85rem; margin: 0.15rem 0 0; }

/* ── Lists & cards ── */
.stack { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; }
.list-card h2 { color: var(--navy); margin: 0 0 0.25rem; font-size: 1.15rem; }
.list-card__actions { display: flex; gap: 0.5rem; }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px;
  background: var(--surface-alt); border: 1px solid var(--border); font-size: 0.8rem; }
.badge--required { background: var(--danger-soft); border-color: var(--danger-border); color: #8a2020; }
.facts { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.3rem; }

/* ── Document checklist ── */
.checklist { margin-top: 1.5rem; }
.checklist__item { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-bottom: 0.6rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.checklist__uploads { display: flex; flex-direction: column; gap: 0.2rem; align-items: flex-end; }

/* ── Data table ── */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.data-table th, .data-table td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table thead th { background: var(--navy); color: #fff; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* MFA enrollment */
.qr { margin: 0.75rem 0; }
.qr svg { width: 196px; height: 196px; }
code { background: var(--surface-alt); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.95em; }

/* Brand logo + property photos */
.brand-logo { height: 54px; width: auto; display: block; background: #fff; padding: 6px 10px; border-radius: 10px; }
.property-card__photo, .property-hero__photo { overflow: hidden; }
.property-card__photo img, .property-hero__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ════════════════════════════════════════════════════════════════════════════
   DASHBOARD PASS — the staff/tenant "workspace" design system.
   The public marketing + applicant pages keep the calm layout above; the
   authenticated workspace (admin, leasing, plans) uses the shell below:
   a dark sidebar + light topbar + card-grid content area. All tokens live here
   so the whole family restyles from one place. (docs/DESIGN.md)
   ════════════════════════════════════════════════════════════════════════════ */
:root {
  /* Accent pair: a gentle GOLDEN-YELLOW fill (dark gold-brown text on it) that
     harmonizes with the Marlowe logo's yellow. Kept soft (same light, low-sat
     character as the former lime) so it reads warm, not neon. The fill is only
     ever used with dark text; the deep gold-brown is its ink + hover + stroke. */
  --accent: #f0d860;        /* golden-yellow — accent fill */
  --accent-deep: #3d2e05;   /* deep gold-brown — text on gold / accent ink */
  --accent-soft: #faefc9;   /* pale gold tint — row hover, active chip */
  /* Status palette (reserved — never reused as decoration). */
  --ok: #2e7d32;     --ok-soft: #e9f5ea;     --ok-border: #bcdcbd;
  --warn: #b45309;   --warn-soft: #fbf1e3;   --warn-border: #eccfa0;
  --danger: #c62828; --danger-soft: #fbeaea; --danger-border: #eccaca;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-md: 0 6px 16px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.06);
  --sidebar-w: 248px;
}

/* ── Shell ── */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
.app-sidebar {
  background: linear-gradient(180deg, #16223c, #111a30);
  color: #cdd6e6; padding: 1.1rem 0.9rem; display: flex; flex-direction: column; gap: 1.25rem;
  position: sticky; top: 0; height: 100vh;
}
.app-brand { display: inline-block; }
.app-brand img { height: 46px; width: auto; background: #fff; padding: 6px 9px; border-radius: 10px; }
.app-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.app-nav a {
  display: flex; align-items: center; gap: 0.65rem;
  color: #c3cde0; text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 0.6rem 0.75rem; border-radius: 9px; border-left: 3px solid transparent;
}
.app-nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.app-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-nav a.is-active { background: rgba(240,216,96,.18); color: #fff; border-left-color: var(--accent); }
.app-nav__footer {
  margin-top: auto; display: flex; flex-direction: column; gap: 0.25rem;
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 0.9rem;
}
.app-nav__footer a { color: #9fb0c9; text-decoration: none; font-size: 0.9rem; padding: 0.4rem 0.75rem; border-radius: 8px; }
.app-nav__footer a:hover { background: rgba(255,255,255,.07); color: #fff; }

.app-pane { display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0.9rem clamp(1rem, 3vw, 2rem); position: sticky; top: 0; z-index: 5;
}
.app-topbar__eyebrow { margin: 0; font-size: 0.72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.app-topbar__title { margin: 0.12rem 0 0; font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--navy); line-height: 1.2; }
.app-topbar__right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.app-user { font-size: 0.85rem; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-topbar .lang-switch a { color: var(--muted); }
.app-topbar .lang-switch a.active, .app-topbar .lang-switch a:hover { background: var(--accent-soft); color: var(--accent-deep); }
.app-content { padding: clamp(1.25rem, 3vw, 2rem); max-width: 1200px; width: 100%; }

/* ── Stat tiles (hero numbers) ── */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1.5rem; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); border-top: 3px solid var(--border); }
.stat-tile__label { margin: 0; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.stat-tile__value { margin: 0.3rem 0 0; font-size: 2.1rem; font-weight: 700; color: var(--navy); line-height: 1.05; }
.stat-tile__meta { margin: 0.35rem 0 0; font-size: 0.82rem; color: var(--muted); }
.stat-tile--accent { border-top-color: var(--navy); }
.stat-tile--ok { border-top-color: var(--ok); }
.stat-tile--warn { border-top-color: var(--warn); }

/* ── Section cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 1.25rem 1.35rem; margin-bottom: 1.25rem; }
.card > :first-child { margin-top: 0; }
.card > h2, .card > h3 { color: var(--navy); }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card__head h2, .card__head h3 { margin: 0; color: var(--navy); }
.card--pad0 { padding: 0; overflow: hidden; }

/* Page header row (title + primary action) */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0.25rem 0 0; }

/* ── Accent button (staff primary action) ── */
.button--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-deep); }
.button--accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

/* ── Status badges ── */
.badge--ok { background: var(--ok-soft); border-color: var(--ok-border); color: #10642b; }
.badge--warn { background: var(--warn-soft); border-color: var(--warn-border); color: #8a4b08; }
.badge--muted { background: var(--surface-alt); color: var(--muted); }
.badge--accent { background: var(--accent-soft); border-color: #e7d28f; color: var(--accent-deep); }

/* ── Table inside a card ── */
.card--pad0 .data-table thead th { background: var(--surface-alt); color: var(--navy); border-bottom: 2px solid var(--border); }
.card--pad0 .data-table tbody tr:hover { background: var(--accent-soft); }

/* ── Property cards with photo (staff grid) ── */
.manage-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.manage-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.manage-card__photo { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--navy), var(--navy-deep)); overflow: hidden; }
.manage-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.manage-card__body { padding: 1rem 1.15rem 1.15rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.manage-card__body h2 { color: var(--navy); margin: 0; font-size: 1.2rem; }
.manage-card__actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.manage-card__body p { margin: 0; }
.section-title, .page-head h2 { color: var(--navy); margin: 0; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.mt-lg { margin-top: 1.5rem; }

/* ── About / craftsmanship gallery (public) ── */
.craft-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.craft-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.craft-card figure { margin: 0; }
.craft-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.craft-card figcaption { padding: 0.8rem 1rem 1rem; border-top: 3px solid var(--accent); }
.craft-card figcaption strong { color: var(--navy); display: block; margin-bottom: 0.15rem; }
.craft-card figcaption span { color: var(--muted); font-size: 0.9rem; }
.logo-lockup { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.75rem; }
.logo-lockup img { height: 60px; width: auto; background: #fff; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); }

/* ── Historic-map hero backdrop (landing) — CSS-only; honors reduced motion ── */
.hero--map { position: relative; overflow: hidden; border-radius: 16px; background: var(--navy);
  color: #fff; padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 3rem); }
.hero--map__bg { position: absolute; inset: -8%; z-index: 0;
  background: url('/static/art/lowell-1876-map.svg') center / cover no-repeat;
  opacity: 0.18; filter: sepia(0.55) saturate(1.3) brightness(1.05);
  animation: mapDrift 72s ease-in-out infinite alternate; }
.hero--map::after { content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, var(--navy) 12%, rgba(20,48,74,.72) 48%, rgba(20,48,74,.30) 100%); }
.hero--map__inner { position: relative; z-index: 1; max-width: 680px; }
.hero--map h1 { color: #fff; margin: 0 0 0.5rem; font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
.hero--map .lede { color: rgba(255,255,255,.88); }
@keyframes mapDrift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to   { transform: scale(1.14) translate3d(-3%, -2%, 0); }
}
@media (prefers-reduced-motion: reduce) { .hero--map__bg { animation: none; } }

/* ── Maintenance photo thumbnails ── */
.photo-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.photo-grid img { width: 140px; height: 140px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); display: block; }

/* ── Collapse the sidebar on small screens ── */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
  .app-nav { flex-direction: row; flex-wrap: wrap; }
  .app-nav a, .app-nav a.is-active { border-left: none; }
  .app-nav__footer { margin: 0; border-top: none; padding-top: 0; flex-direction: row; }
}
