:root {
  color-scheme: light;
  --bg: #fcfaf7;
  --surface: #ffffff;
  --accent: #ebd1a7;
  --primary: #722f14;
  --primary-deep: #5f2610;
  --secondary: #84592c;
  --ink: #422d1c;
  --ink-2: #6b5a47;
  --ink-3: #755f4c;
  --line: rgba(66, 45, 28, 0.14);
  --line-strong: rgba(66, 45, 28, 0.26);
  --error: #a83b1e;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-ui: "Outfit", "Segoe UI", system-ui, Arial, sans-serif;
  --radius: 12px;
  --page-max: 1440px;
}

/* Light-only by design: the Feast Uluwatu brand palette (PRD Appendix A) is a
   warm light scheme across email and web. Inventing a dark theme risks breaking
   brand fidelity. Tokens are centralized here so a dark theme can be added later. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

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

/* Single-page web app: the booking view and the inline success panel share the
   page. The hidden attribute must win over their display:grid classes. */

.booking[hidden],
.success[hidden] {
  display: none;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 250, 247, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--page-max);
  margin-inline: auto;
  height: 72px;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.header-phone {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}

.header-phone:hover {
  color: var(--primary);
}

/* Booking layout */

.booking {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: calc(100dvh - 73px);
}

.intro {
  background: var(--accent);
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
  display: flex;
  justify-content: flex-end;
}

.intro-inner {
  width: 100%;
  max-width: 480px;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
}

.intro h1 {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.intro h1 em {
  font-style: italic;
  font-weight: 500;
}

.intro-lede {
  margin: 1.1rem 0 0;
  max-width: 42ch;
  font-weight: 300;
  font-size: 1.08rem;
  color: var(--ink);
}

.intro-media {
  margin-top: 2.25rem;
}

.intro-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}

.intro-lower {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 1.25rem;
  align-items: center;
}

.intro-small {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.25rem;
}

.detail {
  margin: 0;
}

.detail dt {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
}

.detail dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.detail dd a {
  text-decoration: none;
}

.detail dd a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Form column */

.form-col {
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  border-left: 1px solid var(--line);
}

.form-inner {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}

.form-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.form-heading p {
  margin: 0.6rem 0 0;
  color: var(--ink-2);
  max-width: 48ch;
}

fieldset {
  margin: 2.25rem 0 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 1rem;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.field-label .optional {
  font-weight: 400;
  color: var(--ink-2);
}

.field-helper {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.field-error {
  margin: 0;
  font-size: 0.8rem;
  color: var(--error);
}

.field-input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.8rem 0.95rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field-input::placeholder {
  color: var(--ink-3);
}

.field-input:hover {
  border-color: rgba(66, 45, 28, 0.4);
}

.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(114, 47, 20, 0.15);
}

.field-input.is-invalid {
  border-color: var(--error);
}

.field-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(168, 59, 30, 0.15);
}

.field-input[type="date"],
.field-input[type="time"] {
  min-height: 3.05rem;
}

textarea.field-input {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.5;
}

/* Stepper */

.stepper {
  display: grid;
  grid-template-columns: 3.25rem 1fr 3.25rem;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.stepper button {
  height: 3rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.stepper button:hover:not(:disabled) {
  background: rgba(114, 47, 20, 0.09);
}

.stepper button:active:not(:disabled) {
  transform: scale(0.93);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper output {
  text-align: center;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

/* Segmented control */

.segment-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.segment {
  position: relative;
  display: block;
}

.segment input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: background 0.18s ease, color 0.18s ease;
}

.segment + .segment span {
  border-left: 1px solid var(--line-strong);
}

.segment:hover input:not(:checked) + span {
  background: rgba(114, 47, 20, 0.06);
}

.segment input:checked + span {
  background: var(--primary);
  color: #fff;
}

.segment input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Hold note */

.hold-note {
  margin-top: 2rem;
  padding: 1rem 1.15rem;
  background: rgba(235, 209, 167, 0.4);
  border: 1px solid rgba(132, 89, 44, 0.3);
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.hold-note p {
  margin: 0 0 0.75rem;
}

.hold-note p:last-child {
  margin-bottom: 0;
}

.hold-note-compact {
  margin-top: 1.75rem;
}

/* Actions */

.form-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.5rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-deep);
  box-shadow: 0 14px 30px -16px rgba(114, 47, 20, 0.55);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.985);
}

.btn-primary:disabled {
  cursor: progress;
  opacity: 0.85;
}

.btn-primary:disabled:hover {
  transform: none;
  box-shadow: none;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-status {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  text-align: center;
  color: var(--ink-2);
}

.form-status.is-error {
  color: var(--error);
}

/* Footer */

.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.footer-phone {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}

.footer-phone:hover {
  color: var(--primary);
}

/* Success page */

.success {
  flex: 1;
  width: 100%;
  display: grid;
  place-items: center;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 4vw, 2rem);
}

.success-card {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 18px 40px -18px rgba(114, 47, 20, 0.5);
}

.success-badge svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
}

.success-card h1 {
  margin: 1.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.success-status {
  margin: 0.8rem auto 0;
  max-width: 46ch;
  font-size: 1.05rem;
  color: var(--ink-2);
}

.success-details {
  margin: 2.25rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 1.25rem;
  text-align: left;
}

.success-details dt {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--secondary);
}

.success-details dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.15;
  color: var(--ink);
}

.success-reservation {
  grid-column: 1 / -1;
  text-align: center;
}

.success-reservation dd {
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.success-card .hold-note {
  text-align: left;
}

.btn-secondary {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.9rem 1.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* Motion: light entry only. Reduced-motion users get static layout. */

@media (prefers-reduced-motion: no-preference) {
  .header {
    animation: fade-down 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .intro {
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
  }

  .form-col {
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
  }

  .success-card {
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive collapse */

@media (max-width: 1023px) {
  .booking {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .intro {
    justify-content: center;
  }

  .intro-inner {
    max-width: 560px;
  }

  .form-col {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .form-inner {
    max-width: 560px;
  }
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    padding: 1.5rem 0 1.75rem;
  }

  .intro-inner {
    padding-inline: 1.25rem;
  }

  .intro h1 {
    font-size: 1.8rem;
    line-height: 1.12;
  }

  .intro-lede {
    margin-top: 0.6rem;
    font-size: 0.95rem;
  }

  .intro-media {
    margin: 1.25rem -1.25rem 0;
  }

  .intro-media img {
    border-radius: 0;
    aspect-ratio: 16 / 10;
  }

  .intro-lower {
    grid-template-columns: 1fr;
    justify-items: center;
    margin-top: 1.25rem;
    gap: 0.9rem;
  }

  .intro-small {
    max-width: 200px;
  }

  .details {
    display: none;
  }

  .form-col {
    padding: 2.25rem 1.25rem 2.75rem;
  }

  .success-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .header-inner {
    padding-inline: 1rem;
  }

  .wordmark {
    font-size: 1.2rem;
  }

  .header-phone {
    font-size: 0.82rem;
  }
}
