:root {
  --bg: #ffffff;
  --bg-raised: #f4f5f7;
  --text: #16181d;
  --text-muted: #4b4f58;
  --border: #c7cad1;
  --link: #1a4b8c;
  --link-visited: #5a3a8c;
  --accent: #0b5d3b;
  --accent-text: #ffffff;
  --focus: #1a4b8c;
  --danger: #8c1a1a;
  --danger-bg: #fbeaea;
  --ok-bg: #eaf5ee;
  --radius: 6px;
  --max-width: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-raised: #1d2025;
    --text: #eef0f3;
    --text-muted: #b7bbc4;
    --border: #3a3e47;
    --link: #8ab4f8;
    --link-visited: #c3a6f0;
    --accent: #36b37e;
    --accent-text: #052f1c;
    --focus: #8ab4f8;
    --danger: #ff8a8a;
    --danger-bg: #3a1a1a;
    --ok-bg: #16331f;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-size: 1.0625rem;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--link-visited);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  color: var(--text);
  padding: 0.75rem 1rem;
  border: 2px solid var(--focus);
  z-index: 10;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

header.site {
  border-bottom: 1px solid var(--border);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.25rem;
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  color: var(--text);
}

nav.site a {
  margin-left: 1.25rem;
  text-decoration: none;
  font-weight: 600;
}

nav.site a:first-child {
  margin-left: 0;
}

main {
  padding: 2rem 1.25rem 4rem;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  word-break: break-word;
}

h2 {
  font-size: 1.375rem;
  margin: 2rem 0 0.75rem;
}

p {
  max-width: 68ch;
}

.lede {
  font-size: 1.1875rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.actions {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin: 2rem 0;
}

@media (min-width: 853px) {
  .actions {
    grid-template-columns: 1fr 1fr;
  }
}

.offer-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bg-raised);
}

.offer-card h2 {
  margin-top: 0;
  font-size: 1.1875rem;
}

/* The rent offer is the primary call to action under the rent-first model —
   visually emphasized with the accent color, ahead of the secondary buy-outright
   card next to it. */
.offer-card.primary {
  border-color: var(--accent);
  border-width: 2px;
}

.offer-card.primary h2 {
  color: var(--accent);
}

.terms-list {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  max-width: 60ch;
}

.terms-list li {
  margin-bottom: 0.4rem;
}

.price {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.25rem 0 0.75rem;
}

.price-note {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 700;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.btn:visited {
  color: var(--accent-text);
}

form {
  margin-top: 0.5rem;
}

.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.9rem;
  margin: 0;
}

legend {
  font-weight: 600;
  padding: 0 0.25rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.radio-option label {
  display: inline;
  font-weight: 400;
  margin-bottom: 0;
}

.radio-option input[type="radio"] {
  width: auto;
  margin: 0;
}

.hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  max-width: 34rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

.error-text {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.3rem;
}

[aria-invalid="true"] {
  border-color: var(--danger);
}

.alert {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}

.alert.ok {
  background: var(--ok-bg);
  border-color: var(--accent);
}

.alert.error {
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* visually hidden but present for screen readers / the honeypot trap */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 2rem;
}

table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
}

caption {
  text-align: left;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.tier-badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.filters .field {
  margin-bottom: 0;
}

.not-found {
  text-align: center;
  padding: 3rem 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  a,
  .btn {
    transition: opacity 120ms ease-in-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
