:root {
  --ink: #12302e;
  --ink-soft: #4a6461;
  --muted: #6f8582;
  --line: #dbe5e3;
  --bg: #f5f8f7;
  --surface: #ffffff;
  --brand: #0f6b62;
  --brand-dark: #0a4f48;
  --brand-tint: #e3f2ef;
  --sand: #f6efe2;
  --accent: #c98a3d;
  --danger: #b4372f;
  --danger-tint: #fbeceb;
  --success: #1f7a4d;
  --success-tint: #e6f5ec;
  --warn-tint: #fdf4e3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 48, 46, 0.06), 0 8px 24px rgba(18, 48, 46, 0.06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", system-ui, sans-serif;
  --script: "Great Vibes", "Segoe Script", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -0.03em; }
h2 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ---- Header / footer ------------------------------------------------------------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; font-size: 1.1rem; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font); font-weight: 500; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--ink-soft); }

.site-footer { padding: 32px 0 48px; color: var(--muted); font-size: 0.85rem; text-align: center; }
.site-footer .container { border-top: 1px solid var(--line); padding-top: 24px; }
.site-footer p { margin: 0 0 4px; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--brand); }

/* ---- Hero ------------------------------------------------------------------------ */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(201, 138, 61, 0.18), transparent 60%),
    linear-gradient(160deg, #0f6b62 0%, #0b4d47 70%, #093f3a 100%);
  color: #fff;
  padding: 64px 0 72px;
}
.hero p.lead { font-size: 1.15rem; color: rgba(255, 255, 255, 0.85); max-width: 560px; }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #f3d9b5; margin-bottom: 14px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
.hero-grid .card { color: var(--ink); }
@media (max-width: 860px) {
  .hero { padding: 40px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
}

.features { padding: 64px 0 24px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .features { padding-top: 40px; } .feature-grid { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.feature p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* ---- Cards / panels -------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.card + .card { margin-top: 20px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title h2, .card-title h3 { margin: 0; }
.page { padding: 40px 0 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin: 0; }
.subtle { color: var(--muted); }
.small { font-size: 0.86rem; }

/* ---- Forms ----------------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.field .hint { font-size: 0.84rem; color: var(--muted); margin-top: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15, 107, 98, 0.15); }
input:disabled { background: var(--bg); color: var(--muted); }
textarea { min-height: 160px; resize: vertical; }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.18em; text-transform: uppercase; }
input.signature-input { font-family: var(--script); font-size: 1.75rem; padding: 2px 13px; color: #13235a; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }

/* Large selectable option cards for the two consents. */
.option { border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; transition: border-color 0.15s, background 0.15s; background: #fff; }
.option + .option { margin-top: 16px; }
.option.selected { border-color: var(--brand); background: #f7fcfb; }
.option-head { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.option-head input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.option-head strong { display: block; font-size: 1.08rem; }
.option-head span { color: var(--ink-soft); font-size: 0.95rem; }
.option-body { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
details.legal { margin-top: 12px; font-size: 0.88rem; color: var(--ink-soft); }
details.legal summary { cursor: pointer; color: var(--brand); font-weight: 600; }
details.legal p { margin: 10px 0 0; }

/* ---- Combobox (address picker) --------------------------------------------------- */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.combo-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--brand-tint); }
.combo-list .empty { color: var(--muted); cursor: default; background: none !important; }

/* ---- Buttons --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1;
  padding: 12px 18px; border-radius: 10px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-soft); padding: 8px 10px; }
.btn-ghost:hover { color: var(--brand); background: var(--brand-tint); }
.btn-danger { background: #fff; color: var(--danger); border-color: #efc9c6; }
.btn-danger:hover { background: var(--danger-tint); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 22px; font-size: 1.02rem; }
.btn-sm { padding: 7px 11px; font-size: 0.84rem; border-radius: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Alerts / badges ------------------------------------------------------------- */
.alert { border-radius: 12px; padding: 14px 16px; font-size: 0.94rem; margin-bottom: 18px; border: 1px solid transparent; }
.alert-error { background: var(--danger-tint); color: #7d231d; border-color: #f2cfcc; }
.alert-success { background: var(--success-tint); color: #155a38; border-color: #c3e6d2; }
.alert-info { background: var(--brand-tint); color: var(--brand-dark); border-color: #c6e4de; }
.alert-warn { background: var(--warn-tint); color: #7a5214; border-color: #f0dcb3; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge-yes { background: var(--success-tint); color: var(--success); }
.badge-no { background: #eef1f1; color: var(--muted); }
.badge-brand { background: var(--brand-tint); color: var(--brand-dark); }

.status-banner { display: flex; gap: 16px; align-items: flex-start; }
.status-banner .icon { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; }
.summary-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 14px 0 18px; font-size: 0.95rem; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ---- Admin ----------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab { font: inherit; font-weight: 600; color: var(--ink-soft); background: none; border: 0; border-bottom: 2.5px solid transparent; padding: 12px 14px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .value { font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .label { color: var(--muted); font-weight: 500; font-size: 0.86rem; margin: 4px 0 0; }
.progress { height: 8px; border-radius: 99px; background: #e7eeed; overflow: hidden; margin-top: 10px; }
.progress span { display: block; width: 0; height: 100%; background: var(--brand); border-radius: 99px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar input[type="search"] { flex: 1 1 240px; max-width: 360px; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #fafcfb; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
td.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22); color: var(--ink); }
dialog::backdrop { background: rgba(10, 30, 28, 0.45); }
dialog .dialog-body { padding: 26px; }
dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px; background: var(--bg); border-top: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 0.92rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.auth-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px 20px; }
.auth-wrap .card { width: 100%; max-width: 420px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
.mt-lg { margin-top: 28px; }
.mt-sm { margin-top: 12px; }
.eyebrow-accent { color: var(--accent); }
fieldset.option { margin: 16px 0 0; min-width: 0; }
fieldset.option legend { padding: 0 6px; margin-left: -6px; }
/* Dashboard: use the full screen width so every column of the homes table fits. */
.admin-wide .container { max-width: 1760px; padding: 0 24px; }
.homes-table { font-size: 0.86rem; }
.homes-table th, .homes-table td { padding: 10px 10px; }
.homes-table th { letter-spacing: 0.03em; }
.homes-table td { overflow-wrap: anywhere; }
.homes-table td.nowrap { white-space: nowrap; }
.homes-table td.col-email { min-width: 165px; }
.homes-table td.col-owners { min-width: 110px; }
.homes-table td.col-date { min-width: 120px; }
.homes-table .actions { flex-wrap: wrap; min-width: 200px; max-width: 330px; margin-left: auto; }

/* ---- Home page sections ---------------------------------------------------------- */
.section-intro { max-width: 760px; margin-bottom: 28px; }
.section-intro p { color: var(--ink-soft); font-size: 1.05rem; }
.steps-section { padding: 24px 0 48px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px;
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700;
}
.steps strong { display: block; margin-bottom: 4px; }
.steps span { color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.badge-fail { background: var(--danger-tint); color: var(--danger); }
#history-dialog { width: min(760px, calc(100vw - 32px)); }
#history-body h3 { margin-bottom: 10px; }
.toolbar-check { align-items: center; font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.toolbar-check input { margin: 0; }
.vantaca-check { align-items: center; gap: 6px; font-size: 0.84rem; }
.vantaca-check input { margin: 0; width: 18px; height: 18px; }
.all-set { margin: 4px 0 0; color: var(--success); }
