/* ==========================================================================
   The York House — booking + confirmation pages
   Builds on styles.css tokens (ivory, forest, clay, brass, serif/sans).
   ========================================================================== */

/* ---------- sub-page header ---------- */
.sub-header .header-inner { grid-template-columns: 1fr auto 1fr; }
.back-link {
  display: inline-flex; align-items: center; gap: 10px; justify-self: start;
  font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase; text-decoration: none; color: var(--stone);
  transition: color .3s;
}
.back-link:hover { color: var(--charcoal); }
.sub-header .header-phone { display: inline; }
@media (max-width: 1023px) {
  .sub-header .header-inner { grid-template-columns: 1fr auto 1fr; }
  .sub-header .header-phone { display: none; }
}
@media (max-width: 560px) { .back-text { display: none; } .back-link { font-size: 18px; min-width: 44px; min-height: 44px; } }

/* ---------- layout ---------- */
.book { max-width: 1240px; margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--gutter) 120px; }
.book-intro { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }
.book-intro h1 { font-size: clamp(44px, 5.4vw, 76px); font-weight: 300; margin-bottom: 16px; }
.book-intro h1 em { color: var(--clay); }
.book-lede { color: var(--stone); font-size: var(--lede); max-width: 520px; margin: 0 auto; }

.book-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: start; }
@media (min-width: 1024px) { .book-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: clamp(48px, 5vw, 80px); } }

.notice { max-width: 860px; margin: 0 auto 40px; padding: 16px 22px; border-left: 2px solid var(--brass); background: var(--cream); font-size: 15px; color: var(--charcoal); }
.notice a { color: var(--clay); }
.notice-error { border-color: #b42318; }

/* ---------- steps ---------- */
.step { padding: 0 0 44px; margin-bottom: 44px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; margin-bottom: 0; }
.step-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.step-num { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--brass-ink); }
.step h2 { font-size: clamp(28px, 2.6vw, 36px); font-weight: 400; }
.step-hint { color: var(--stone); font-size: 15.5px; margin: 0 0 24px; min-height: 1.6em; }
.step-hint strong { font-weight: 500; color: var(--forest); }
.link-btn { margin-left: auto; background: none; border: 0; padding: 4px 0; cursor: pointer; font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--clay); border-bottom: 1px solid currentColor; }

/* ---------- calendar ---------- */
.calendar { position: relative; background: var(--cream); border: 1px solid var(--line); padding: clamp(18px, 3vw, 32px); }
.cal-nav { position: absolute; top: clamp(14px, 2.6vw, 26px); left: clamp(14px, 2.6vw, 26px); right: clamp(14px, 2.6vw, 26px); display: flex; justify-content: space-between; pointer-events: none; z-index: 1; }
.cal-btn { width: 40px; height: 40px; font-size: 15px; pointer-events: auto; background: var(--cream); }
.cal-btn:disabled { opacity: .3; cursor: default; }
.cal-btn:disabled:hover { background: var(--cream); color: inherit; border-color: var(--line); }
.cal-months { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 4vw, 48px); transition: opacity .3s; min-height: 340px; }
.cal-months.is-loading { opacity: .4; }
.cal-loading { grid-column: 1 / -1; align-self: center; text-align: center; color: var(--mist); }
.cal-title { text-align: center; font-family: var(--serif); font-size: 22px; margin: 6px 0 18px; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { text-align: center; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mist); padding-bottom: 10px; }
.cal-day {
  position: relative; aspect-ratio: 1 / 1.02; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 0; background: none; padding: 0; cursor: pointer; color: var(--charcoal); font: inherit;
  transition: background-color .2s, color .2s;
}
.cd-num { font-family: var(--serif); font-size: 18px; line-height: 1; }
.cd-rate { font-size: 9.5px; letter-spacing: 0.04em; color: var(--mist); line-height: 1; }
.cal-day:not(:disabled):hover { background: var(--sand); }
.cal-day.is-blank { cursor: default; }
.cal-day.is-past, .cal-day.is-booked { cursor: not-allowed; color: rgba(43, 42, 39, .28); }
.cal-day.is-booked .cd-num { text-decoration: line-through; text-decoration-color: rgba(164, 86, 63, .55); }
.cal-day.is-checkout-only { color: var(--stone); }
.cal-day.is-checkout-only::after { content: ""; position: absolute; left: 50%; bottom: 14%; width: 14px; height: 1px; background: var(--clay); transform: translateX(-50%); opacity: .5; }
.cal-day.is-today .cd-num { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 4px; }
.cal-day.is-range { background: var(--sand); }
.cal-day.is-range.is-preview { background: rgba(233, 223, 205, .6); }
.cal-day.is-start, .cal-day.is-end { background: var(--forest); color: var(--cream); }
.cal-day.is-start .cd-rate, .cal-day.is-end .cd-rate { color: var(--brass-soft); }
.cal-day.is-end.is-preview { background: rgba(31, 58, 46, .65); }
.cal-day:focus-visible { outline-offset: -2px; }
.cal-legend { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 12.5px; color: var(--stone); }
.cal-legend li { display: flex; align-items: center; gap: 9px; }
.lg { width: 14px; height: 14px; display: inline-block; }
.lg-available { border: 1px solid var(--line); background: var(--ivory); }
.lg-selected { background: var(--forest); }
.lg-booked { background: linear-gradient(135deg, transparent 45%, rgba(164, 86, 63, .6) 45%, rgba(164, 86, 63, .6) 55%, transparent 55%); border: 1px solid var(--line); }
@media (max-width: 760px) {
  .cal-months { grid-template-columns: 1fr; min-height: 300px; }
  .cd-num { font-size: 17px; }
  .cd-rate { font-size: 8.5px; }
}
@media (max-width: 400px) {
  .calendar { padding: 14px 10px; }
  .cal-dow span { letter-spacing: 0.06em; }
  .cd-num { font-size: 16px; }
}

/* ---------- guests & pet ---------- */
.option-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.option-row:first-of-type { border-top: 1px solid var(--line); }
.option-title { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.option-sub { margin: 4px 0 0; font-size: 14px; color: var(--mist); }
.option-toggle { cursor: pointer; }
.stepper { display: flex; align-items: center; gap: 18px; }
.stepper output { font-family: var(--serif); font-size: 26px; min-width: 20px; text-align: center; }
.stepper-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--cream); cursor: pointer; font-size: 20px; line-height: 1; transition: border-color .3s, background-color .3s; }
.stepper-btn:hover:not(:disabled) { border-color: var(--forest); }
.stepper-btn:disabled { opacity: .3; cursor: default; }
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { display: block; width: 52px; height: 30px; border-radius: 30px; background: var(--sand-deep); transition: background-color .3s; position: relative; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); box-shadow: 0 2px 6px rgba(0, 0, 0, .15); transition: transform .35s var(--ease); }
.switch input:checked + .switch-track { background: var(--forest); }
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { outline: 1.5px solid var(--brass); outline-offset: 3px; }
.pet-field { margin-top: 22px; }

/* ---------- fields ---------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 24px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--stone); }
.optional { text-transform: none; letter-spacing: 0; font-weight: 300; color: var(--mist); font-size: 13px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 0; background: var(--cream);
  font-family: var(--sans); font-size: 16px; font-weight: 300; color: var(--charcoal); transition: border-color .3s, box-shadow .3s;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(31, 58, 46, .08); }
.field.has-error input, .field.has-error textarea { border-color: #b42318; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }

/* ---------- summary ---------- */
.summary { position: relative; }
@media (min-width: 1024px) { .summary { position: sticky; top: 104px; } }
.summary-card { background: var(--cream); border: 1px solid var(--line); box-shadow: 0 40px 80px -50px rgba(43, 42, 39, .35); }
.summary-img { height: 170px; overflow: hidden; }
.summary-img img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.summary-body { position: relative; padding: 30px 32px 28px; }
.summary-kicker { margin: 0 0 4px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--brass-ink); }
.summary-title { font-size: 28px; font-weight: 400; margin-bottom: 22px; }
.summary-stay { margin: 0 0 22px; border-top: 1px solid var(--line); }
.summary-stay div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary-stay dt { font-size: 10.5px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mist); padding-top: 3px; }
.summary-stay dd { margin: 0; font-family: var(--serif); font-size: 18px; text-align: right; }
.summary-lines { min-height: 48px; transition: opacity .3s; }
.summary.is-loading .summary-lines, .summary.is-loading .summary-total { opacity: .4; }
.summary-empty { margin: 0; color: var(--mist); font-size: 14.5px; }
.sum-line { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 15px; }
.sum-line small { display: block; font-size: 12.5px; color: var(--mist); }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--charcoal); }
.summary-total span { font-size: 11px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; }
.summary-total strong { font-family: var(--serif); font-weight: 400; font-size: 34px; color: var(--forest); }
.summary-total small { font-family: var(--sans); font-size: 11px; color: var(--mist); letter-spacing: 0.1em; }
.form-error { margin: 18px 0 0; padding: 12px 14px; background: #fdf3f1; border-left: 2px solid #b42318; color: #8a2a1c; font-size: 14px; }
.pay-btn { margin-top: 24px; min-height: 62px; position: relative; }
.pay-btn:disabled { opacity: .45; cursor: not-allowed; }
.pay-btn:disabled:hover { background: var(--clay); }
.spinner { display: none; width: 18px; height: 18px; border: 1.5px solid rgba(251, 248, 242, .35); border-top-color: var(--cream); border-radius: 50%; animation: spin .8s linear infinite; margin-left: 12px; }
.pay-btn.is-busy .spinner { display: inline-block; }
.pay-btn.is-busy { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
.summary-note { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; font-size: 13px; line-height: 1.55; color: var(--stone); }
.summary-note svg { flex: none; width: 14px; height: 14px; margin-top: 3px; fill: none; stroke: var(--brass); stroke-width: 1.3; }
.summary-trust { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); }
.summary-trust span { font-family: var(--serif); font-style: italic; font-size: 22px; letter-spacing: 0; color: var(--brass-ink); margin-right: 6px; vertical-align: -2px; }

/* ---------- mobile action bar ---------- */
.book-bar { display: none; }
@media (max-width: 1023px) {
  .book-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: rgba(251, 248, 242, .97); border-top: 1px solid var(--line); box-shadow: 0 -12px 30px -20px rgba(43, 42, 39, .4);
  }
  .bar-label { display: block; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); }
  .bar-total { font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--forest); }
  .book-page .sub-footer { padding-bottom: 96px; }
}

.sub-footer { padding: 36px var(--gutter); text-align: center; font-size: 13px; color: var(--stone); border-top: 1px solid var(--line); }
.sub-footer a { color: var(--clay); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ==========================================================================
   Confirmation page
   ========================================================================== */
.confirm { max-width: 820px; margin: 0 auto; padding: clamp(56px, 8vw, 110px) var(--gutter) 120px; }
.confirm-state { text-align: center; }
.confirm-mark { width: 72px; height: 72px; margin: 0 auto 30px; border-radius: 50%; border: 1px solid var(--brass); display: grid; place-items: center; }
.confirm-mark svg { width: 28px; height: 28px; fill: none; stroke: var(--forest); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.confirm-mark.is-wait { border-color: var(--line); }
.confirm-mark.is-wait::after { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--sand-deep); border-top-color: var(--forest); animation: spin .9s linear infinite; }
.confirm h1 { font-size: clamp(40px, 5vw, 66px); font-weight: 300; margin-bottom: 18px; }
.confirm h1 em { color: var(--clay); }
.confirm-lede { font-size: var(--lede); color: var(--stone); max-width: 560px; margin: 0 auto 44px; }
.confirm-ref { display: inline-block; margin-bottom: 44px; padding: 12px 22px; border: 1px solid var(--line); font-size: 11.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--stone); }
.confirm-ref strong { font-family: var(--serif); font-size: 20px; letter-spacing: 0.06em; color: var(--forest); margin-left: 10px; text-transform: none; }
.confirm-card { text-align: left; background: var(--cream); border: 1px solid var(--line); padding: clamp(26px, 4vw, 44px); margin-bottom: 36px; }
.confirm-dates { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; padding-bottom: 26px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.confirm-dates p { margin: 0; }
.confirm-dates .cd-label { font-size: 10.5px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--mist); margin-bottom: 6px; }
.confirm-dates .cd-date { font-family: var(--serif); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; }
.confirm-dates .cd-time { font-size: 13px; color: var(--stone); }
.confirm-dates .cd-arrow { font-family: var(--serif); font-size: 26px; color: var(--brass-ink); }
.confirm-dates > div:last-child { text-align: right; }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 32px; align-items: center; }
.confirm-actions .link-line { color: var(--clay); }
.confirm-help { margin-top: 44px; font-size: 14.5px; color: var(--stone); text-align: center; }
.confirm-help a { color: var(--clay); }
@media (max-width: 560px) {
  .confirm-dates { grid-template-columns: 1fr; gap: 14px; }
  .confirm-dates .cd-arrow { display: none; }
  .confirm-dates > div:last-child { text-align: left; }
}

/* ---------- discount code ---------- */
.promo { margin-top: 14px; }
.promo .link-btn { margin-left: 0; }
.promo-row { display: flex; gap: 8px; margin-top: 10px; }
.promo-row input { flex: 1; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); background: var(--ivory); font-family: var(--sans); font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; }
.promo-row input:focus { outline: none; border-color: var(--forest); }
.promo-apply { padding: 0 18px; border: 1px solid var(--forest); background: transparent; color: var(--forest); cursor: pointer; font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; transition: background-color .3s, color .3s; }
.promo-apply:hover { background: var(--forest); color: var(--cream); }
.promo-msg { margin: 10px 0 0; font-size: 13.5px; color: var(--forest); }
.promo-msg.is-error { color: #b42318; }
.promo-msg .link-btn { font-size: 10.5px; margin-left: 6px; }
.sum-line.is-discount { color: var(--forest); }

/* ---------- cancellation note + terms ---------- */
.cancel-note { margin: 16px 0 0; font-size: 13.5px; color: var(--forest); }
.terms-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 13.5px; line-height: 1.5; color: var(--stone); cursor: pointer; }
.terms-check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--forest); }
.terms-check a { color: var(--clay); }
.terms-check.has-error span { color: #b42318; }
.sub-footer-links { margin: 8px 0 0; }
