:root {
  --bg: #f7f1e7;
  --bg-accent: #e3d7c3;
  --panel: rgba(255, 250, 241, 0.92);
  --line: rgba(46, 69, 68, 0.16);
  --text: #1f2927;
  --muted: #5f6b68;
  --brand: #1e6a61;
  --brand-strong: #124b44;
  --danger: #a03d3d;
  --success: #295b3c;
  --shadow: 0 20px 50px rgba(46, 69, 68, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(30, 106, 97, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(196, 111, 61, 0.14), transparent 26%),
    linear-gradient(180deg, #fbf7f1, var(--bg));
}

button,
input,
select,
a {
  font: inherit;
}

.page-shell {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.78), rgba(255, 245, 230, 0.92)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.section-kicker,
.guest-index {
  margin: 0;
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero h1,
.section-head h2,
.guest-card-head h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.04;
}

.hero h1 {
  margin-top: 10px;
  max-width: 15ch;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.status-line {
  margin: 18px 0 0;
  color: var(--muted);
}

.hero-copy {
  max-width: 60ch;
  margin: 16px 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.language-switch {
  display: inline-flex;
  gap: 8px;
}

.language-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-strong);
  padding: 8px 12px;
  cursor: pointer;
}

.language-button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fffdf9;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.layout {
  gap: 20px;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  margin-top: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.form-panel {
  padding: 24px;
}

.confirmation-screen {
  min-height: 420px;
  display: grid;
  place-items: center;
}

.confirmation-card {
  width: min(100%, 640px);
  padding: 36px 32px;
  border-radius: 24px;
  border: 1px solid rgba(41, 91, 60, 0.18);
  background:
    radial-gradient(circle at top right, rgba(41, 91, 60, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 250, 245, 0.92));
  box-shadow: 0 24px 48px rgba(41, 91, 60, 0.12);
  text-align: center;
}

.confirmation-card h2 {
  margin: 10px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.confirmation-copy {
  max-width: 44ch;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.output-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-block {
  padding: 22px;
  border: 1px solid rgba(46, 69, 68, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
}

.section-block + .section-block {
  margin-top: 18px;
}

.form-submit-bar {
  margin-top: 24px;
  padding: 22px 24px;
  border: 1px solid rgba(46, 69, 68, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-submit-bar h2 {
  margin: 0;
  font-size: 1.15rem;
}

.form-submit-bar .field-hint {
  margin: 6px 0 0;
}

.section-block.compact {
  padding: 18px;
}

.section-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.section-head p,
.guest-card-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 10px;
}

.short-grid {
  max-width: 260px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

label span {
  font-size: 0.95rem;
}

.field-hint {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.field-error-message {
  color: var(--danger);
  font-size: 0.84rem;
  line-height: 1.35;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid rgba(46, 69, 68, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

input:disabled,
select:disabled {
  background: rgba(239, 234, 224, 0.95);
  color: var(--muted);
  cursor: not-allowed;
}

input.field-error-input,
select.field-error-input,
.field-has-error .signature-canvas-wrap {
  border-color: rgba(160, 61, 61, 0.7);
  box-shadow: 0 0 0 3px rgba(160, 61, 61, 0.12);
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid rgba(30, 106, 97, 0.25);
  outline-offset: 2px;
}

.checkbox-field {
  justify-content: end;
}

.checkbox-field input {
  width: 22px;
  min-height: 22px;
  padding: 0;
}

.checkbox-field.wide {
  grid-column: 1 / -1;
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button.primary {
  background: linear-gradient(135deg, var(--brand), #297d72);
  color: white;
}

.button.secondary {
  background: rgba(30, 106, 97, 0.1);
  color: var(--brand-strong);
}

.button.tertiary {
  background: rgba(31, 41, 39, 0.08);
  color: var(--text);
}

.guest-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guest-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(46, 69, 68, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(252, 246, 235, 0.75));
}

.guest-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.guest-card-head.simple {
  justify-content: start;
}

.share-preferences {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  margin-bottom: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(46, 69, 68, 0.18);
  background: rgba(247, 241, 231, 0.7);
}

.share-chip {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.signature-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(46, 69, 68, 0.18);
}

.signature-head h4 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
}

.signature-head p {
  margin: 6px 0 0;
}

.signature-canvas-wrap {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(46, 69, 68, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 240, 230, 0.92));
  overflow: hidden;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
  cursor: crosshair;
}

.signature-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.signature-actions p {
  margin: 0;
}

.remove-guest-button {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  padding: 8px 10px;
}

.error-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.error-list li {
  color: var(--danger);
}

.error-list .success-item {
  color: var(--success);
}

.saved-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.saved-files p {
  margin: 0;
  color: var(--muted);
}

.saved-files a {
  color: var(--brand-strong);
  word-break: break-all;
}

.booking-summary {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(46, 69, 68, 0.12);
  background: rgba(255, 255, 255, 0.78);
}

.booking-summary p {
  margin: 0;
}

.booking-summary p + p {
  margin-top: 8px;
}

.xml-output {
  min-height: 380px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(46, 69, 68, 0.12);
  background: #1b2523;
  color: #eaf1ef;
  font-family: "SFMono-Regular", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

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

  .page-shell {
    width: min(100vw - 20px, 1360px);
    padding-top: 18px;
  }

  .hero,
  .form-panel,
  .output-panel {
    padding: 18px;
  }

  .confirmation-card {
    padding: 28px 22px;
  }

  .hero-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-head {
    flex-direction: column;
  }

  .form-submit-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
