:root {
  --brand: #85053d;
  --brand-deep: #60011e;
  --ink: #1c1014;
  --muted: #6b5a60;
  --line: #e8d4d8;
  --surface: #fff8f9;
  --card: #ffffff;
  --ok: #1b7a4a;
  --warn: #b45309;
  --danger: #b91c1c;
  --hold: #9ca3af;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(96, 1, 30, 0.08);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #f3d5de 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #ecd4d4 0%, transparent 50%),
    linear-gradient(180deg, #fff8f9 0%, #f7eef0 100%);
}

body {
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  min-height: 100vh;
}

.brand-mark {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 6px;
}

h1 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 5vw, 2.15rem);
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--brand-deep);
}

.sub {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.45;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.panel h2 {
  font-size: 0.95rem;
  margin: 0 0 12px;
  color: var(--brand-deep);
}

.treatments {
  display: grid;
  gap: 8px;
}

.treatment {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.treatment:hover {
  border-color: #c98aa3;
}

.treatment.selected {
  border-color: var(--brand);
  background: #f8e8ee;
}

.treatment input {
  margin-top: 3px;
}

.treatment .meta {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-weight: 600;
}

.days,
.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}

.chip:hover:not(:disabled) {
  border-color: #c98aa3;
}

.chip.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
}

.field input {
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.field input:focus {
  outline: 2px solid #c98aa3;
  border-color: var(--brand);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

button.primary,
a.primary {
  appearance: none;
  border: none;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.ghost,
a.ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hold-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: var(--warn);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 600;
}

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--ok);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

.loading {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

/* Printable QR poster */
.qr-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  text-align: center;
}

.qr-page .poster {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
}

.qr-page h1 {
  margin-bottom: 8px;
}

.qr-canvas-wrap {
  display: grid;
  place-items: center;
  margin: 28px 0 18px;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface);
}

.qr-page .hint {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.45;
}

.qr-page .url {
  word-break: break-all;
  font-size: 0.9rem;
  color: var(--brand-deep);
  margin-bottom: 20px;
}

@media print {
  body {
    background: #fff;
  }

  #app {
    max-width: none;
    padding: 0;
  }

  .no-print {
    display: none !important;
  }

  .qr-page {
    padding: 0;
  }

  .qr-page .poster {
    border: none;
    box-shadow: none;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .qr-canvas-wrap canvas,
  .qr-canvas-wrap img {
    width: 320px !important;
    height: 320px !important;
  }
}
