/* The Landlord Year. Mobile first, no framework, no web fonts. */

:root {
  --ink: #1b2521;
  --ink-soft: #4a5752;
  --paper: #faf8f3;
  --panel: #ffffff;
  --line: #e2ddd2;
  --brand: #1f3a34;
  --brand-ink: #ffffff;
  --accent: #2f6f5e;
  --flag: #fff4e0;
  --flag-line: #e0a74a;
  --tax: #3f5fa8;
  --safety: #b0532f;
  --tenancy: #2f6f5e;
  --register: #7a4fa0;
  --focus: #f2b632;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ebe7df;
    --ink-soft: #b3aca0;
    --paper: #151a18;
    --panel: #1d2421;
    --line: #34403b;
    --brand: #203a33;
    --accent: #7cc4ad;
    --flag: #3a2e19;
    --flag-line: #c9923b;
    --tax: #8fa9e8;
    --safety: #e79a79;
    --tenancy: #7cc4ad;
    --register: #c3a2e0;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 2.1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.8em; }

/* header / footer */
.site-header { background: var(--brand); color: var(--brand-ink); }
.site-header .wrap { padding-top: 12px; padding-bottom: 12px; }
.brand { color: var(--brand-ink); font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px 0 40px; color: var(--ink-soft); font-size: 0.9rem; }

/* hero */
.hero { background: var(--brand); color: var(--brand-ink); padding: 28px 0 32px; }
.hero .eyebrow { opacity: 0.8; font-size: 0.9rem; margin-bottom: 0.4em; }
.hero .lede { font-size: 1.1rem; max-width: 38em; }
/* T-0188 B: the first screen's one action. Light button on the dark hero. */
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 20px 0 0; }
.hero .btn-hero { background: #fff; color: var(--brand); border-color: #fff; text-decoration: none; text-align: center; }
.hero-link { color: var(--brand-ink); }
.hero-note { opacity: 0.8; font-size: 0.88rem; margin: 16px 0 0; max-width: 38em; }
#property-1 { scroll-margin-top: 16px; }
.results .capture { margin: 0 0 28px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

.why { padding-top: 28px; }
.why-list { padding-left: 1.2em; margin: 0 0 0.6em; }
.why-list li { margin-bottom: 0.6em; }
.why-tail { color: var(--ink-soft); }
.src { font-size: 0.85rem; }

/* form */
.ly-form { margin-top: 24px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin: 0 0 16px;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.group {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field-row .narrow { flex: 0 0 90px; }
.hint { color: var(--ink-soft); font-size: 0.88rem; margin: 4px 0 0; }
legend + .hint { margin: -2px 0 8px; }
.group + .hint { margin: -4px 0 16px; }

/* Every text box, date and dropdown is exactly the same height. Safari and
   Chrome on macOS ignore min-height on a native <select>, which is why the
   dropdowns were shorter: take over their appearance and set a real height. */
input[type="text"], input[type="email"], input[type="date"], select {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  font: inherit;
  line-height: 46px;
  color: var(--ink);
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
}
select {
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237a837f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}
/* iOS Safari centres date text and adds its own inner height. */
input[type="date"]::-webkit-date-and-time-value { text-align: left; line-height: 46px; }
input[type="date"]::-webkit-datetime-edit { padding: 0; line-height: 46px; }

/* A follow-up field or note that appears under a Yes / No / Not sure answer. */
.sub { margin: 12px 0 0; }
.answer-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  font-size: 0.9rem;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 500;
  cursor: pointer;
}
.choices input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--panel);
  color: var(--accent);
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; } /* T-0189: "Show my year" until app.js loads */
@media (prefers-color-scheme: dark) { .btn-primary { color: #0f1714; } }
.btn-secondary { width: 100%; margin-bottom: 16px; }
.btn-link { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; font: inherit; cursor: pointer; padding: 8px 0; }

.submit-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.submit-row .btn-primary { flex: 1 1 200px; }
.privacy-line { color: var(--ink-soft); font-size: 0.9rem; margin-top: 12px; }

/* results */
.results { margin-top: 32px; scroll-margin-top: 16px; }
.notice {
  border-left: 4px solid var(--accent);
  background: var(--panel);
  padding: 12px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.block { margin: 0 0 28px; }
.block .intro { color: var(--ink-soft); }
.cards { list-style: none; margin: 0; padding: 0; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
  margin-bottom: 12px;
}
.card-tax { border-left-color: var(--tax); }
.card-safety { border-left-color: var(--safety); }
.card-tenancy { border-left-color: var(--tenancy); }
.card-register { border-left-color: var(--register); }
.card h3 { margin-bottom: 0.4em; }
.card p { font-size: 0.95rem; }
.when { font-weight: 700; margin-bottom: 0.2em; font-size: 1rem; }
.when .rel { font-weight: 400; color: var(--ink-soft); }
.prop {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 1px 8px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  vertical-align: 2px;
}
.reason { color: var(--ink-soft); }
.consequence { }
.source { font-size: 0.85rem; color: var(--ink-soft); }
.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.badge-rollout { background: color-mix(in srgb, var(--register) 15%, transparent); color: var(--register); }
.badge-proposed { background: var(--flag); color: var(--ink); }

.flags .card { background: var(--flag); border-color: var(--flag-line); border-left-color: var(--flag-line); }
.missing ul { padding-left: 1.2em; color: var(--ink-soft); }
.excluded { color: var(--ink-soft); }
.actions { margin: -8px 0 28px; }
.actions .btn { width: 100%; }

.capture .signup .btn { width: 100%; margin: 8px 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; margin: 4px 0 8px; }
.consent input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#signup-result .ok { color: var(--accent); font-weight: 600; }
#signup-result .err { color: var(--safety); font-weight: 600; }
/* T-0223: a wrong address shows on the box itself: 2px outline in the error colour, message directly under it. */
.signup input[aria-invalid="true"] { outline: 2px solid var(--safety); outline-offset: 0; border-color: var(--safety); box-shadow: 0 0 0 4px color-mix(in srgb, var(--safety) 25%, transparent); }
/* Forced-colours mode drops box-shadow, so the focused invalid box keeps a 3px outline of its own. */
.signup input[aria-invalid="true"]:focus-visible { outline: 3px solid var(--safety); box-shadow: 0 0 0 5px var(--focus); }
.signup .field { scroll-margin: 16px 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field-err { color: var(--safety); font-weight: 600; margin: 6px 0 0; scroll-margin: 16px 0 24px; }
/* T-0214: the answer sits directly under the button. After a signup, signup.js hides the rest of the
   form and the answer becomes this panel, where the button was, and takes focus (tabindex -1). */
.signup #signup-result p { margin: 2px 0 6px; }
.signup.is-done #signup-result { margin: 8px 0 4px; padding: 14px 16px; background: var(--paper); border: 2px solid var(--accent); border-radius: var(--radius); }
.signup.is-done #signup-result p { margin: 0; font-size: 1.05rem; }
#signup-result:focus { outline: none; }
#signup-result:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* PR #50 review, finding 1: keep a scrolled-to answer clear of the screen edge and Safari's toolbar. */
#signup-result { scroll-margin: 16px 0 24px; }
.upsell { border-style: dashed; }

/* T-0126: shared dates + email, above the form */
.shared { margin-top: 8px; }
.shared .cards { margin: 12px 0 20px; }
.shared .regions { margin: 8px 0; }
.shared .regions summary { cursor: pointer; color: var(--accent); }
.shared .regions ul { padding-left: 1.2em; margin: 8px 0 0; }
.shared { margin-top: 24px; }
.shared .capture { border-top: 1px solid var(--line, #d9dfdc); padding-top: 16px; }
.capture h3 { margin-top: 0; }
.more-toggle { display: block; margin: 8px 0 4px; text-align: left; }

.prose { padding-top: 28px; max-width: 680px; }
.todo { background: var(--flag); padding: 0 4px; }

[hidden] { display: none !important; }

@media (min-width: 640px) {
  .panel { padding: 24px; }
  .btn-secondary, .actions .btn, .capture .signup .btn { width: auto; }
  h1 { font-size: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Privacy page: the "don't count me" switch (T-0024). */
.count-switch { margin: 8px 0 24px; }
.count-switch p { margin-bottom: 8px; }

/* Guides (T-0025) */
.guide-list { list-style: none; padding: 0; }
.guide-list li { border-top: 1px solid var(--line); padding: 16px 0; }
.guide-list a { font-weight: 600; font-size: 1.1rem; }
.guide-list p { margin: 6px 0 0; }
.guide-checked, .guide-crumb { color: var(--ink-soft); font-size: 0.9rem; }
.guide-sticky {
  position: sticky; top: 0; z-index: 1;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 8px 0; margin: 0 0 16px; font-size: 0.9rem; color: var(--ink-soft);
}
.guide h2 { margin-top: 32px; scroll-margin-top: 48px; }
/* T-0346: the form sits under the sticky "Checked on" line (two lines tall at 375 px). When signup.js or the keyboard scrolls the
   field into view, keep its label and box clear of that line. */
.guide .capture .field { scroll-margin-top: 88px; }
.guide li { margin-bottom: 6px; }
.guide a { overflow-wrap: anywhere; }
.guide table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.guide th, .guide td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.guide blockquote { margin: 16px 0; padding: 4px 16px; border-left: 4px solid var(--accent); color: var(--ink-soft); }

/* T-0169: founding page screens. Two columns from 640px; on phones, a swipeable row. */
.founding .jump { margin-top: -0.2em; }
/* A .hint has no bottom margin; give a heading after one the gap a paragraph leaves above the other h2s (0.8em of the 17px body). */
.founding .hint + h2 { margin-top: 13.6px; }
.founding-shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 0 16px; }
.founding-shots figure { flex: 0 0 78%; margin: 0; scroll-snap-align: start; }
.founding-shots:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.founding-shots img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.founding-shots figcaption { color: var(--ink-soft); font-size: 0.9rem; margin-top: 6px; }
@media (min-width: 640px) {
  .founding-shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; overflow: visible; align-items: start; }
}

/* T-0167: Email it to myself / Copy as text / Print or save as PDF. */
.export { display: grid; gap: 8px; margin: 4px 0 12px; }
.export .btn { width: 100%; text-align: center; text-decoration: none; }
@media (min-width: 640px) {
  .export { display: flex; flex-wrap: wrap; }
  .export .btn { width: auto; }
}
.print-only { display: none; }

/* Printed page (Compliance T-0167 P1 to P6). Every page prints whole, footer included (it carries the
   trader name, address and contact). Only the home page with results showing prints the results alone:
   the P1 rule is scoped to body:has(#results:not([hidden])). A browser without :has() prints the whole page. */
@media print {
  :root { /* light palette even when the screen is in dark mode */
    --ink: #000; --ink-soft: #333; --paper: #fff; --panel: #fff; --line: #999; --accent: #000;
    --flag: #fff4e0; --flag-line: #e0a74a; --tax: #3f5fa8; --safety: #b0532f; --tenancy: #2f6f5e; --register: #7a4fa0;
    color-scheme: light;
  }
  body { background: #fff; color: #000; font-size: 12pt; }
  /* #capture: T-0188, the email box sits in the results once a calendar is shown. */
  body:has(#results:not([hidden])) :is(.site-header, .site-footer, .hero, #shared, .why, #ly-form, #upsell, .actions, #capture, button, .btn) { display: none !important; } /* P1 */
  .print-only { display: block; } /* P2, P3: these only exist inside the results */
  .print-head { font-weight: 700; margin-bottom: 12pt; }
  #results { margin-top: 0; }
  #results a { color: #000; overflow-wrap: anywhere; }
  #results a[href^="http"]::after { content: " (" attr(href) ")"; overflow-wrap: anywhere; } /* P4 */
  .badge { background: none !important; color: #000 !important; border: 1px solid #000; } /* P5: text, not colour only */
  .when .rel { display: none; } /* P6: goes stale on paper */
  .card { break-inside: avoid; }
}

/* T-0210: the Renters' Rights Act page. Phone first: the short answer on the first screen of an
   iPhone 13 (390 x 844), the email box straight after it. Copy: content/pages/renters-rights-act.md. */
.rra { padding-top: 18px; max-width: 680px; }
.rra .eyebrow { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 0.4em; }
.rra h1 { font-size: 1.55rem; line-height: 1.18; margin-bottom: 0.55em; }
.rra-answer { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 12px 14px 4px; }
.rra-answer h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin: 0 0 0.5em; }
.rra-answer p { font-size: 1rem; margin-bottom: 0.6em; }
.rra-answer p:last-child em { font-size: 0.88rem; color: var(--ink-soft); }
.rra-jump { margin: 10px 0 14px; font-weight: 600; }
.rra-capture { margin: 0 0 20px; scroll-margin-top: 12px; }
.rra-capture h2 { font-size: 1.15rem; margin-bottom: 0.4em; }
.rra-capture .signup .btn { width: 100%; margin: 8px 0; }
/* Option A: body-size and never collapsed, directly above the button (Compliance T-0209 Q1). */
.consent-line { font-size: 1rem; margin: 4px 0 4px; }
.rra-signpost { font-size: 0.95rem; color: var(--ink-soft); }
.rra-body h2, .rra-calendar h2, .rra-more h2, .rra-sources h2 { margin-top: 30px; }
.rra-body h3 { font-size: 1.02rem; margin: 22px 0 0.35em; }
.rra-body ul { padding-left: 1.2em; }
.rra-body li { margin-bottom: 0.55em; }
.rra-body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 0.92rem; margin: 0 0 0.8em; }
.rra-body th, .rra-body td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.rra-calendar { margin-top: 28px; }
.rra-calendar h2 { margin-top: 0; }
.rra-calendar .btn { text-decoration: none; }
.rra-end-cta { margin: 24px 0 12px; }
.rra-closing { font-size: 0.92rem; color: var(--ink-soft); margin-top: 20px; }
.rra-sources summary { cursor: pointer; color: var(--accent); }
.rra-source-list { list-style: none; padding-left: 0; font-size: 0.9rem; }
.rra-source-list li { margin-bottom: 0.5em; padding-left: 2.6em; text-indent: -2.6em; }
.rra-source-list .sid { display: inline-block; width: 2.6em; text-indent: 0; font-weight: 600; color: var(--ink-soft); }
.rra a { overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .rra h1 { font-size: 2.1rem; }
  .rra-body table { display: table; }
  .rra-capture .signup .btn { width: auto; }
}
