* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --border: #d8e0ea;
  --text: #18212f;
  --subtext: #5b6878;
  --primary: #2563eb;
  --primary-soft: #eaf1ff;
  --danger: #b42318;
  --danger-soft: #fdecec;
  --success: #067647;
  --success-soft: #e8f7ef;
  --info: #1c4a7a;
  --info-soft: #e3eef9;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow);
}

.brand h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.brand p {
  margin: 0;
  color: var(--subtext);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 420px);
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel-main {
  padding: 24px;
}

.panel-side {
  padding: 24px;
  position: sticky;
  top: 24px;
}

.panel-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.panel-header p {
  margin: 0;
  color: var(--subtext);
}

.booking-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 28px;
}

.booking-type-card {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-muted);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
  min-height: 130px;
}

.booking-type-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.booking-type-card.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.card-title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-text {
  display: block;
  color: var(--subtext);
  line-height: 1.5;
  font-size: 14px;
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.section-block {
  border-top: 1px solid var(--border);
  padding-top: 22px;
}

.section-block:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section-block h3,
.section-title-row h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.section-title-row p {
  margin: 0 0 20px;
  color: var(--subtext);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 600;
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  padding: 13px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Greyed-out "booked" timeslots in the select dropdown. */
.field select option:disabled {
  color: #9aa3b2;
  font-style: italic;
}

textarea {
  resize: vertical;
  min-height: 130px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.submit-btn {
  appearance: none;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.form-message {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.form-message.success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(6, 118, 71, 0.2);
}

.form-message.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.2);
}

.form-message.info {
  background: var(--info-soft);
  color: var(--info);
  border: 1px solid rgba(28, 74, 122, 0.2);
}

.hidden {
  display: none;
}

.summary-box,
.info-box {
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 18px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--subtext);
  font-weight: 600;
}

.summary-value {
  text-align: right;
  font-weight: 700;
  max-width: 60%;
  word-break: break-word;
}

.info-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 17px;
}

.info-box p {
  margin: 0 0 12px;
  color: var(--subtext);
  line-height: 1.6;
}

.info-box p:last-child {
  margin-bottom: 0;
}

/* Optional debug pre element for dry-run testing. */
.json-preview {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 16px;
}

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

  .panel-side {
    position: static;
  }
}

@media (max-width: 768px) {
  .page-shell {
    padding: 16px;
  }

  .booking-type-grid {
    grid-template-columns: 1fr;
  }

  .form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .brand h1 {
    font-size: 24px;
  }
}
