:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #65716a;
  --primary: #1f4938;
  --primary-dark: #163629;
  --primary-soft: #eaf1ed;
  --canvas: #f4f6f4;
  --surface: #ffffff;
  --surface-soft: #fafbfa;
  --line: #dce2de;
  --line-strong: #bbc6bf;
  --danger: #a53636;
  --danger-soft: #fff5f4;
  --success: #2f6b4e;
  --shadow: 0 8px 28px rgba(23, 34, 29, 0.06);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

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

.site-header__inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.brand-name {
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.property-address {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.language-control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.language-control label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.language-control select {
  min-width: 112px;
  height: 38px;
  padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 650;
  outline: none;
}

.language-control select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 73, 56, 0.12);
}

.form-stage { padding: 44px 20px 64px; }

.form-frame {
  width: min(940px, 100%);
  margin: 0 auto;
}

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.page-intro > div > p:last-child {
  max-width: 610px;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.required-note {
  flex: none;
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.registration-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 32px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  list-style: none;
}

.registration-map li {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border-right: 1px solid var(--line);
}

.registration-map li:last-child { border-right: 0; }

.registration-map span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 0.68rem;
  font-weight: 750;
}

.registration-map strong {
  font-size: 0.78rem;
  font-weight: 650;
}

.form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 12px;
}

.form-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.guest-counter {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.error-summary {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid #ecc4c1;
  border-radius: 8px;
  color: #742828;
  background: var(--danger-soft);
}

.error-summary h3 { margin: 0 0 0.35rem; font-size: 0.88rem; }
.error-summary ul { margin: 0; padding-left: 1.1rem; font-size: 0.8rem; }

.guest-block {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.guest-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.guest-heading-wrap {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.guest-index {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

.guest-title { margin: 0; font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.guest-header p { margin: 0.18rem 0 0; color: var(--muted); font-size: 0.72rem; }

.remove-guest {
  padding: 0.45rem 0.7rem;
  border: 1px solid #e5c5c3;
  border-radius: 7px;
  color: var(--danger);
  background: #fff;
  font-size: 0.7rem;
  font-weight: 650;
}

.remove-guest:hover,
.remove-guest:focus-visible { background: var(--danger-soft); }

.guest-content { padding: 0 1.25rem; }

.form-section {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.form-section--last { border-bottom: 0; }

.section-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding-top: 0.1rem;
}

.section-label span { color: var(--primary); font-size: 0.7rem; font-weight: 750; }
.section-label h4 { margin: 0; color: var(--ink); font-size: 0.74rem; font-weight: 700; }

.field-grid { display: grid; gap: 1rem 1.1rem; }
.field-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field--wide { grid-column: 1 / -1; }
.field { min-width: 0; }

.field label {
  display: flex;
  min-height: 1.2rem;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.76rem;
  font-weight: 650;
}

.field label .required-mark,
.field label .visa-required-mark { color: var(--danger); }
.field label small { color: var(--muted); font-size: 0.63rem; font-weight: 550; }

.field input,
.field select {
  width: 100%;
  height: 46px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field select { padding-right: 2.25rem; appearance: none; }
.select-wrap { position: relative; }

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.field input:hover,
.field select:hover { border-color: #84938a; }

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 73, 56, 0.12);
}

.invalid-feedback,
.server-error {
  display: none;
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.68rem;
  font-weight: 600;
}

.server-error { display: block; }

.was-validated .field:has(input:invalid) .invalid-feedback,
.was-validated .field:has(select:invalid) .invalid-feedback,
.field:has(.is-invalid) .invalid-feedback,
.was-validated .check-control:has(input:invalid) + .consent-feedback { display: block; }

.was-validated .field input:invalid,
.was-validated .field select:invalid,
.field input.is-invalid,
.field select.is-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.add-guest {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 700;
}

.add-guest span { font-size: 1rem; line-height: 1; }

.add-guest:hover,
.add-guest:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.add-guest:disabled { cursor: not-allowed; opacity: 0.45; }

.submit-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  margin-top: 18px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.check-control {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  cursor: pointer;
  font-size: 0.76rem;
  line-height: 1.45;
}

.check-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.custom-check {
  position: relative;
  display: block;
  width: 19px;
  height: 19px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
}

.check-control input:checked + .custom-check { border-color: var(--primary); background: var(--primary); }

.check-control input:checked + .custom-check::after {
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: "";
  transform: rotate(45deg);
}

.check-control input:focus-visible + .custom-check { outline: 3px solid rgba(31, 73, 56, 0.15); outline-offset: 2px; }
.was-validated .check-control input:invalid + .custom-check { border-color: var(--danger); }
.check-control a { color: var(--primary); font-weight: 700; text-underline-offset: 0.15rem; }

.consent-feedback,
.secure-note { margin-left: 1.65rem; }

.secure-note {
  margin-top: 0.45rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.secure-note::before { margin-right: 0.4rem; color: var(--success); content: "●"; font-size: 0.5rem; }

.submit-button {
  display: inline-flex;
  min-width: 210px;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease;
}

.submit-button:hover,
.submit-button:focus-visible { border-color: var(--primary-dark); background: var(--primary-dark); }

.form-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 28px;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
}

/* Privacy */
.document-page { min-height: 100vh; padding: 24px; background: var(--canvas); }
.document-shell { width: min(940px, 100%); margin: 0 auto; }

.document-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 24px;
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid var(--line);
}

.brand-lockup--dark { color: var(--ink); }

.document-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.document-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  gap: 2rem;
  align-items: end;
  padding: 2rem;
  border-bottom: 1px solid var(--line);
}

.document-header h1,
.success-card h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.document-header p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.policy-list { counter-reset: policy; padding: 0 2rem; }

.policy-section {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  counter-increment: policy;
}

.policy-section::before {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  content: counter(policy);
  font-size: 0.68rem;
  font-weight: 700;
}

.policy-section:last-child { border-bottom: 0; }
.policy-section h2 { margin: 0 0 0.55rem; font-size: 0.95rem; }
.policy-section p, .policy-section li { color: var(--muted); font-size: 0.8rem; line-height: 1.65; }
.policy-section p { margin: 0 0 0.45rem; }
.policy-section ul { margin: 0; padding-left: 1rem; }

.document-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.document-actions p { margin: 0; color: var(--muted); font-size: 0.7rem; }

.text-link,
.primary-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: var(--primary);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.primary-link { color: #fff; background: var(--primary); }
.text-link:hover, .primary-link:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }

/* Success */
.success-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.success-shell { width: min(680px, 100%); }
.success-brand { display: flex; justify-content: center; margin-bottom: 18px; }

.success-card {
  padding: clamp(2rem, 6vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.success-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin: 0 auto 1.4rem;
  border-radius: 50%;
  color: var(--success);
  background: var(--primary-soft);
  font-size: 1.4rem;
}

.success-card > p { max-width: 34rem; margin: 0.9rem auto 0; color: var(--muted); font-size: 0.85rem; }

.success-summary {
  max-width: 34rem;
  margin: 1.6rem auto;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface-soft);
}

.success-summary h2 { margin: 0 0 0.3rem; font-size: 0.74rem; }
.success-summary p { margin: 0; color: var(--muted); font-size: 0.76rem; }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem; }

@media (max-width: 760px) {
  .site-header__inner { width: min(100% - 28px, 1040px); }
  .property-address { display: none; }
  .form-stage { padding: 32px 14px 44px; }
  .page-intro { display: block; }
  .required-note { margin-top: 0.75rem; }
  .form-section { grid-template-columns: 115px minmax(0, 1fr); gap: 1.25rem; }
}

@media (max-width: 600px) {
  .site-header__inner { min-height: 64px; gap: 0.75rem; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { max-width: 105px; font-size: 0.76rem; }
  .header-actions { gap: 0; }

  .language-control label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .language-control select { min-width: 102px; height: 36px; }
  .page-intro h1 { font-size: 1.8rem; }
  .registration-map { margin-bottom: 26px; }

  .registration-map li {
    min-height: 46px;
    justify-content: center;
    padding: 0.55rem 0.3rem;
  }

  .registration-map strong { font-size: 0.66rem; }
  .registration-map span { width: 21px; height: 21px; }
  .guest-header, .guest-content { padding-right: 1rem; padding-left: 1rem; }
  .form-section { display: block; padding: 1.35rem 0; }
  .section-label { margin-bottom: 0.9rem; }
  .field-grid--two { grid-template-columns: 1fr; }
  .submit-panel { display: block; padding: 1rem; }
  .submit-button { width: 100%; margin-top: 1rem; }
  .form-footer { display: grid; gap: 0.25rem; }
  .document-page, .success-page { padding: 14px; }
  .document-topbar, .document-header, .document-actions { display: block; }
  .document-topbar .language-control { margin-top: 1rem; }
  .document-header, .policy-list, .document-actions { padding-right: 1rem; padding-left: 1rem; }
  .document-header h1 { margin-bottom: 0.8rem; font-size: 1.8rem; }
  .document-actions .primary-link { width: 100%; margin-top: 0.8rem; }
  .success-card { padding: 1.8rem 1rem; }
  .success-actions { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
