/* Palace owner landing page. Colors and spacing mirror mobile/src/theme.ts; the green hero and join
   sections follow the owner ad creatives (ads/creatives.html), so the page looks like the ad that was tapped. */

:root {
  --background: #F4F7F5;
  --card: #FFFFFF;
  --border: #E1E8E3;
  /* Input and chip outlines: 3:1 on white, so the fields read as fields. */
  --field-border: #84958B;
  --label: #0E1B13;
  --secondary-label: #5A6B61;
  /* 4.7:1 on white; theme.ts's #8A9A90 is too faint for placeholder text on the web. */
  --placeholder: #66776D;
  --primary: #0B7D45;
  --primary-pressed: #096A3A;
  --primary-deep: #075C33;
  --on-primary: #FFFFFF;
  --primary-soft: #E7F4EC;
  --on-primary-soft: #0B6E3F;
  --danger: #C5221F;
  --danger-soft: #FCEBEA;

  --xs: 4px;
  --sm: 8px;
  --md: 16px;
  --lg: 24px;
  --xl: 32px;
  --xxl: 48px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* In-page links land with a little air; the landing page's top bar doesn't stick. */
section[id] { scroll-margin-top: var(--md); }

body {
  margin: 0;
  background: var(--card);
  color: var(--label);
  /* No Arial: on macOS Chrome it takes Hebrew away from SF Hebrew. Segoe UI covers Hebrew on Windows. */
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

::selection { background: #BFE3CD; color: var(--label); }

h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(34px, 9.4vw, 58px); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: clamp(26px, 6.6vw, 36px); font-weight: 800; letter-spacing: -0.005em; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--on-primary-soft); text-underline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--md); }
.narrow { max-width: 640px; }

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

/* Top bar. privacy.html keeps the white sticky bar; the landing page's sits on the green hero. */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--md); height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; color: var(--label); text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary); color: var(--on-primary); font-size: 21px; font-weight: 800;
}

.topbar-stage { position: static; background: var(--primary); border-bottom: 0; backdrop-filter: none; }
.topbar-stage .brand { color: var(--on-primary); }
.topbar-stage .brand-mark { background: var(--on-primary); color: var(--primary); }
.topbar-stage :focus-visible { outline-color: var(--on-primary); }
.soon {
  padding: 5px 14px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  color: var(--on-primary); font-size: 14px; font-weight: 600; white-space: nowrap;
}

/* Buttons and links */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 var(--lg);
  border: 0; border-radius: 999px;
  background: var(--primary); color: var(--on-primary);
  font: inherit; font-size: 18px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 120ms ease, transform 120ms ease;
}
.button:hover { background: var(--primary-pressed); }
.button:active { transform: scale(0.98); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.button-small { min-height: 44px; padding: 0 var(--md); font-size: 15px; }
.button-block { width: 100%; }
.button-light { background: var(--on-primary); color: var(--primary); box-shadow: 0 10px 24px rgba(3, 38, 20, 0.25); }
.button-light:hover { background: var(--primary-soft); }
.button-light:focus-visible { outline-color: var(--on-primary); outline-offset: 3px; }
.arrow { width: 22px; height: 22px; flex: none; }

/* Hero: the ad's green field, its headline, and the earnings card made live. */

.hero {
  position: relative;
  overflow: hidden;
  padding: var(--md) 0 var(--xxl);
  background:
    radial-gradient(120% 70% at 0% 100%, var(--primary-deep) 0%, transparent 70%),
    linear-gradient(180deg, var(--primary) 0%, var(--primary-pressed) 55%, var(--primary-deep) 100%);
  color: var(--on-primary);
}
.bays {
  position: absolute;
  inset-inline-end: -140px;
  bottom: -70px;
  width: 560px;
  opacity: 0.1;
  transform: rotate(12deg);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 20px;
  grid-template-areas: "copy" "card" "actions";
}
.hero-copy { grid-area: copy; display: grid; gap: 12px; }
.lead { font-size: 18px; color: var(--primary-soft); max-width: 34em; }

.estimate {
  grid-area: card;
  display: grid; gap: var(--md);
  background: var(--card); color: var(--label);
  border-radius: 24px;
  padding: 20px 20px var(--lg);
  box-shadow: 0 18px 44px rgba(3, 38, 20, 0.32);
}
.estimate-title { font-size: 16px; font-weight: 700; color: var(--secondary-label); }
.estimate-amount {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px;
  margin-top: -6px;
  color: var(--primary); font-weight: 800; line-height: 1;
  font-size: clamp(46px, 14vw, 68px); font-variant-numeric: tabular-nums;
}
.estimate-amount .about { font-size: 0.5em; margin-inline-end: -4px; }
.estimate-amount .unit { font-size: 0.36em; font-weight: 700; white-space: nowrap; }
.fine-print { font-size: 13px; line-height: 1.5; color: var(--secondary-label); }

.hero-actions { grid-area: actions; display: grid; gap: 12px; justify-items: stretch; text-align: center; }
/* Tablets: the card and button keep a phone-like width instead of stretching across. */
.estimate, .hero-actions { width: 100%; max-width: 560px; }
.hero-note { font-size: 15px; color: var(--primary-soft); }

@media (min-width: 960px) {
  .hero { padding: var(--xl) 0 96px; }
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    grid-template-areas: "copy card" "actions card";
    column-gap: 72px; row-gap: var(--xl);
    align-items: center;
  }
  .hero-copy { align-self: end; padding-top: var(--xl); }
  .hero-actions { align-self: start; justify-items: start; text-align: start; }
  .lead { font-size: 20px; }
  .bays { width: 720px; inset-inline-end: auto; inset-inline-start: 38%; bottom: -120px; }
}

/* Controls shared by the estimate and the form */

.field { display: grid; gap: var(--sm); border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, legend { font-weight: 600; font-size: 16px; padding: 0; }
legend { margin-bottom: var(--sm); }
output { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sm); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sm); }
.chips label { flex: 1 1 auto; }

/* Radio "chips" and the segmented control share one look. */
.segmented label, .chips label { position: relative; }
.segmented input, .chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span, .chips span {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 var(--md);
  border: 1px solid var(--field-border); border-radius: 999px;
  background: var(--card); font-size: 16px; font-weight: 600; text-align: center; white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.segmented input:checked + span, .chips input:checked + span {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}
.segmented input:focus-visible + span, .chips input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Range: a thumb big enough for a thumb. app.js sets --fill as the slider moves. */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 36px; margin: 0; background: transparent; cursor: pointer;
  --fill: 32%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px;
  background: linear-gradient(to left, var(--primary) var(--fill), var(--border) var(--fill));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px; height: 30px; margin-top: -11px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--primary);
  box-shadow: 0 2px 6px rgba(3, 38, 20, 0.25);
}
input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: var(--border); }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--primary); }
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--primary);
  box-shadow: 0 2px 6px rgba(3, 38, 20, 0.25);
}

/* Sections */

.section { padding: 56px 0; }
.section-tinted { background: var(--background); }
.section h2 + * { margin-top: var(--lg); }
.section-lead { color: var(--secondary-label); }
.section h2 + .section-lead { margin-top: var(--sm); }
.section-lead + * { margin-top: var(--lg); }

@media (min-width: 720px) {
  .section { padding: 88px 0; }
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--lg);
}
.card p { color: var(--secondary-label); }

/* How it works: a numbered line, not three boxes. */

.steps { list-style: none; padding: 0; margin: 0; display: grid; counter-reset: step; }
.steps li { position: relative; counter-increment: step; padding-inline-start: 52px; padding-bottom: var(--lg); }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; inset-inline-start: 0; top: -4px;
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); font-weight: 800;
}
.steps li::after {
  content: "";
  position: absolute; inset-inline-start: 17px; top: 38px; bottom: 6px;
  width: 2px; background: var(--border);
}
.steps li:last-child::after { display: none; }
.steps h3 { margin-bottom: var(--xs); }
.steps p { color: var(--secondary-label); }

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--xl); }
  .steps li { padding: 52px 0 0; }
  .steps li::after { inset-inline-start: 48px; inset-inline-end: 0; top: 17px; bottom: auto; width: auto; height: 2px; }
}

/* Trust points: a checklist, like the trust ad. */

.points { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--lg); }
.points li { display: grid; grid-template-columns: 32px 1fr; column-gap: 14px; row-gap: var(--xs); }
.points li::before {
  content: "";
  grid-row: 1 / span 2;
  width: 32px; height: 32px; border-radius: 50%; margin-top: -3px;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.points p { color: var(--secondary-label); }

@media (min-width: 720px) {
  .points { grid-template-columns: 1fr 1fr; column-gap: var(--xxl); row-gap: var(--xl); }
}

/* FAQ */

.faq details { border-bottom: 1px solid var(--border); }
summary {
  display: flex; align-items: center; gap: 6px;
  min-height: 56px; padding: 12px 0;
  cursor: pointer; font-weight: 700; list-style: none;
}
summary::-webkit-details-marker { display: none; }
/* A drawn plus that turns into a minus. */
summary::after {
  content: "";
  flex: none; width: 16px; height: 16px; margin-inline-start: auto;
  background:
    linear-gradient(var(--primary), var(--primary)) center / 16px 2.5px no-repeat,
    linear-gradient(var(--primary), var(--primary)) center / 2.5px 16px no-repeat;
}
details[open] > summary::after {
  background: linear-gradient(var(--primary), var(--primary)) center / 16px 2.5px no-repeat;
}
.faq details > p { color: var(--secondary-label); padding-bottom: var(--md); }
.faq details:first-of-type { border-top: 1px solid var(--border); }

/* Join: back on the green, closing the page the way it opened. */

.join {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: var(--on-primary);
}
.join .section-lead { color: var(--primary-soft); }

.form { display: grid; gap: 20px; box-shadow: 0 18px 44px rgba(3, 38, 20, 0.32); color: var(--label); }
input[type="text"], input[type="tel"] {
  width: 100%; min-height: 52px; padding: 0 var(--md);
  border: 1px solid var(--field-border); border-radius: var(--radius-md);
  background: var(--card); color: var(--label); font: inherit;
  caret-color: var(--primary);
}
input::placeholder { color: var(--placeholder); opacity: 1; }
input[type="tel"] { text-align: right; }
input[type="text"]:focus-visible, input[type="tel"]:focus-visible { outline-offset: 0; border-color: var(--primary); }
input[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
/* The first invalid field gets focus; keep it red rather than the green focus ring. */
input[aria-invalid="true"]:focus-visible { border-color: var(--danger); outline-color: var(--danger); }
.optional { color: var(--secondary-label); font-weight: 400; }

/* Optional details fold away; they're still sent with the form. */
.more { border: 0; border-radius: var(--radius-md); background: var(--background); }
.more > summary { min-height: 52px; padding: 0 var(--md); font-weight: 600; font-size: 16px; }
.more-body { display: grid; gap: 20px; padding: var(--xs) var(--md) 20px; }

/* .card p would otherwise turn errors inside the form grey. */
.field-error, .form-error, .card .field-error, .card .form-error { color: var(--danger); font-size: 15px; font-weight: 600; }
.form-error { background: var(--danger-soft); padding: var(--sm) var(--md); border-radius: var(--radius-sm); }

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--secondary-label); cursor: pointer; }
.consent input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary); flex: none; cursor: pointer; }

.thanks { text-align: center; display: grid; gap: var(--sm); justify-items: center; padding: var(--xl) var(--lg); color: var(--label); }
.thanks:focus { outline: none; }
.thanks-mark {
  width: 64px; height: 64px; border-radius: 50%; margin-bottom: var(--sm);
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 34px no-repeat;
}
.thanks h3 { font-size: 22px; }

[hidden] { display: none !important; }

.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Footer */

.footer { border-top: 1px solid var(--border); padding: var(--md) 0; font-size: 15px; color: var(--secondary-label); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sm) var(--md); }
.footer-links { display: flex; gap: var(--lg); }
.footer a { display: inline-block; padding: 10px 0; }

/* Sticky join button on scroll; app.js shows it while neither the hero button nor the form is in view. */

.sticky-cta {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 15;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(14, 27, 19, 0.1);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 220ms;
}
.sticky-cta.is-shown { transform: none; visibility: visible; transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.sticky-cta .button { display: flex; max-width: 480px; margin: 0 auto; }
/* The cookie banner takes the bottom edge while it's up. */
.consent-banner:not([hidden]) ~ .sticky-cta { display: none; }

/* Cookie consent banner. Accept and decline look the same: saying no is as easy as yes. */
/* While it's up, focused fields scroll clear of it and the footer can scroll above it. */
html:has(#consent-banner:not([hidden])) { scroll-padding-bottom: 200px; }
body:has(#consent-banner:not([hidden])) { padding-bottom: 200px; }

.consent-banner {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(14, 27, 19, 0.08);
  padding: var(--md) 0 calc(var(--md) + env(safe-area-inset-bottom));
}
.consent-banner-inner { display: grid; gap: var(--md); }
.consent-banner p { font-size: 15px; color: var(--secondary-label); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sm); }
.button-secondary { background: var(--primary-soft); color: var(--on-primary-soft); }
.button-secondary:hover { background: #D6EDDF; }

@media (min-width: 720px) {
  .consent-banner-inner { grid-template-columns: 1fr auto; align-items: center; }
  .consent-actions { grid-template-columns: auto auto; }
}

/* Privacy notice page */

.doc { padding: var(--xl) 0 var(--xxl); }
.doc h1 { font-size: 32px; margin-bottom: var(--md); }
.doc h2 { font-size: 21px; margin: var(--xl) 0 var(--sm); }
.doc p, .doc li { color: var(--secondary-label); }
.doc ul { padding-inline-start: var(--lg); }
.draft-banner {
  background: #FFF4D6; color: #6B4E00; border: 1px solid #F1D88A;
  padding: var(--sm) var(--md); border-radius: var(--radius-sm); font-size: 15px; margin-bottom: var(--lg);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, .sticky-cta, .sticky-cta.is-shown { transition: none !important; }
}
