/* =========================================================
   Chateau Markham Towns — Online Sales Worksheet
   Shares the design system of the Groundbreaking RSVP page
   (tokens, buttons, fields, footer) and extends it for a
   longer, multi-section data-entry form.
   ========================================================= */

:root {
  --ink: #0a0a0a;
  --ink-soft: #2a2a2a;
  --muted: #707070;
  --line: #d8d8d8;
  --line-soft: #ececec;
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --sky: #cde0ea;
  --sky-2: #e8eff3;
  --accent: #0a0a0a;
  --error: #b00020;
  --success: #1f7a3a;

  --radius: 2px;
  --radius-card: 4px;

  --max: 780px;
  --gutter: 22px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The HTML `hidden` attribute must beat layout rules below. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--ink-soft); }

img { max-width: 100%; display: block; }

.page {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--bg-soft);
}

/* ---------- MASTHEAD ---------- */
.masthead {
  text-align: center;
  padding: 40px var(--gutter) 32px;
  background: linear-gradient(180deg, var(--sky-2) 0%, var(--sky) 100%);
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.04em;
  font-size: 46px;
  line-height: 1;
  margin: 0;
  color: var(--ink);
}

.wordmark-sub {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 11px;
  font-weight: 500;
  margin: 8px 0 0;
}

.masthead-title {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 13px;
  font-weight: 600;
  margin: 18px 0 0;
  color: var(--ink-soft);
}

.muted { color: var(--muted); }

/* ---------- BUTTON (shared with RSVP page) ---------- */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  border-radius: var(--radius);
}

.btn:hover {
  background: var(--ink);
  color: #fff;
}

.btn-primary {
  background: transparent;
  color: var(--ink);
}

.btn-block {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 13px;
}

.btn[disabled], .btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
  color: var(--ink);
}

/* ---------- WORKSHEET LAYOUT ---------- */
.worksheet { padding: 22px var(--gutter) 8px; }

.ws-section {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 22px 20px;
  margin: 0 0 16px;
}

.ws-head {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.ws-step {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.ws-head-text { flex: 1 1 auto; min-width: 0; }

.section-title {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  text-align: left;
  color: var(--ink);
}

.section-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}

/* ---------- FORM ROWS / FIELDS (shared with RSVP page) ---------- */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 14px;
}
.form-row:last-child { margin-bottom: 0; }

.form-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row.three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

@media (max-width: 560px) {
  .form-row.two,
  .form-row.three { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; min-width: 0; }

.field > label,
.label-like {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 6px;
  color: var(--ink-soft);
}

.req { color: var(--error); }

.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field input[type='date'],
.field select,
.field textarea {
  font: inherit;
  font-size: 15px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.12s ease;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}

.field input[type='date'] { min-height: 46px; }

.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23333' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.field.has-error .file-drop {
  border-color: var(--error);
}

.field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

/* ---------- CURRENCY ADORNMENT ---------- */
.money { position: relative; }
.money::before {
  content: '$';
  position: absolute;
  left: 12px;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}
/* Higher specificity than `.field input[type='text']` so the $ never overlaps. */
.field .money input { padding-left: 28px; }

/* ---------- RADIO ---------- */
.radio-row {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 8px 0;
  flex-wrap: wrap;
}

.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
}

.radio input {
  margin: 0;
  accent-color: var(--ink);
  flex-shrink: 0;
}

/* ---------- CHEQUE NOTE CALLOUT ---------- */
.note-callout {
  margin: 2px 0 0;
  padding: 12px 14px;
  background: var(--sky-2);
  border: 1px solid var(--sky);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.note-callout strong {
  color: var(--ink);
  letter-spacing: 0.02em;
}

/* ---------- FILE UPLOAD ---------- */
.file-drop {
  /* Reset inherited label-text styling, then lay out as a control. */
  text-transform: none;
  letter-spacing: normal;
  font-size: 15px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.file-drop:hover { border-color: var(--ink); }
.file-drop:focus-within { border-color: var(--ink); }
.file-drop.has-file { border-style: solid; }

/* Visually-hidden but focusable native input */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.file-cta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 9px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: background 0.12s ease, color 0.12s ease;
}
.file-drop:hover .file-cta { background: var(--ink); color: #fff; }

.file-name {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.file-drop.has-file .file-name { color: var(--ink); }

.file-clear {
  align-self: flex-start;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.file-clear:hover { color: var(--ink); }

/* ---------- PURCHASER 2 TOGGLE (switch) ---------- */
.p2-toggle { display: flex; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.18);
}
.switch-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.p2-fields { margin-top: 20px; }

/* ---------- SUBMIT / MESSAGES ---------- */
.submit-row { margin: 20px 0 0; }

.form-message {
  margin: 12px 0 0;
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}
.form-message.is-error { color: var(--error); }
.form-message.is-success { color: var(--success); }

/* ---------- THANK YOU ---------- */
.thank-you {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-align: center;
  padding: 44px 24px;
  margin: 0 0 16px;
}
.thank-you-check {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--sky-2);
  border: 1px solid var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}
.thank-you h2 {
  font-size: 22px;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}
.thank-you p {
  font-size: 14px;
  margin: 0 0 18px;
  color: var(--ink-soft);
}

/* ---------- FOOTER (shared with RSVP page) ---------- */
.site-footer {
  background: var(--bg-soft);
  padding: 32px var(--gutter) 40px;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}
.footer-brand {
  font-weight: 600;
  letter-spacing: 0.32em;
  font-size: 14px;
  margin: 0 0 12px;
}
.footer-line {
  font-size: 14px;
  margin: 4px 0;
}
.footer-line a { text-decoration: none; }
.footer-line a:hover { text-decoration: underline; }
.footer-copy {
  font-size: 11px;
  color: var(--muted);
  margin: 14px 0 0;
}

/* ---------- LARGE SCREENS ---------- */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .wordmark { font-size: 56px; }
  .ws-section { padding: 26px 26px; }
}
