/* Cabane à sucre Erabilis — modern reservation UI */
:root {
  --cream: #faf6ef;
  --cream-dark: #f0e6d4;
  --paper: #fffdf8;
  --maple: #b45309;
  --maple-deep: #9a3412;
  --maple-soft: #fed7aa;
  --forest: #3f6212;
  --forest-soft: #d9f99d;
  --ink: #292524;
  --muted: #78716c;
  --line: #e7e0d4;
  --dispo: #65a30d;
  --dispo-bg: #ecfccb;
  --insuf: #ea580c;
  --insuf-bg: #ffedd5;
  --complet: #b91c1c;
  --complet-bg: #fee2e2;
  --passe: #a8a29e;
  --passe-bg: #e7e5e4;
  --shadow: 0 10px 40px rgba(41, 37, 36, 0.08);
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #fed7aa66, transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, #d9f99d44, transparent),
    var(--cream);
  line-height: 1.5;
}

a {
  color: var(--maple);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--maple-deep);
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f59e0b, var(--maple-deep));
  box-shadow: 0 6px 16px rgba(180, 83, 9, 0.35);
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* WordPress iframe (?embed=1). The site header already shows the logo. */
html.embed-in-wp header.brand {
  display: none;
}

.layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 840px) {
  .layout {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.step {
  border-bottom: 1px solid var(--line);
}
.step:last-child {
  border-bottom: none;
}

.step-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}
.step-header:hover {
  background: var(--cream);
}
.step.is-open .step-header {
  background: linear-gradient(90deg, #fff7ed, transparent);
}
.step.is-done .step-header {
  opacity: 0.95;
}
.step.is-locked .step-header {
  cursor: default;
  opacity: 0.55;
}

.step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--cream-dark);
  color: var(--muted);
  flex-shrink: 0;
}
.step.is-open .step-num {
  background: var(--maple);
  color: white;
}
.step.is-done .step-num {
  background: var(--forest);
  color: white;
}

.step-title {
  flex: 1;
}
.step-title strong {
  display: block;
  font-size: 1.05rem;
}
.step-title span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.step-body {
  display: none;
  padding: 0 1.15rem 1.25rem 1.15rem;
  animation: fadeIn 0.25s ease;
}
.step.is-open .step-body {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.field-grid {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 560px) {
  .field-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field label .req {
  color: var(--complet);
  font-weight: 700;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--maple);
  box-shadow: 0 0 0 3px #fed7aa88;
}
.field input[readonly] {
  background: var(--cream);
  color: var(--muted);
}
.field .hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
.field .label-note {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
}
/* Fainter sample phone placeholders */
.input-placeholder-faint::placeholder {
  color: #d6d3d1;
  opacity: 1;
}
.input-placeholder-faint::-webkit-input-placeholder {
  color: #d6d3d1;
}
.cal-table th.cal-month {
  text-align: left;
  padding-left: 0.65rem;
  font-weight: 700;
  color: var(--maple-deep);
  white-space: nowrap;
}

.qty-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.qty-row .label {
  font-weight: 600;
}
.qty-row .sub {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}
.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.qty-controls button {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream);
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}
.qty-controls button:hover {
  background: var(--maple-soft);
  border-color: var(--maple);
}
.qty-controls input {
  width: 3.2rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem;
  font: inherit;
  font-weight: 700;
  /* The − / + buttons are the controls. Hide the browser spinner. */
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty-controls input::-webkit-outer-spin-button,
.qty-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Locked party size (date-change mode) — clearly not editable */
#partySizeBlock.is-locked {
  opacity: 0.72;
  pointer-events: none;
  filter: grayscale(0.35);
}
#partySizeBlock.is-locked .qty-row {
  background: var(--cream);
  border-color: var(--line);
  box-shadow: none;
}
#partySizeBlock.is-locked .qty-controls button {
  opacity: 0.35;
  cursor: not-allowed;
  background: #e7e5e4;
}
#partySizeBlock.is-locked .qty-controls input {
  background: #e7e5e4;
  color: var(--muted);
  border-color: #d6d3d1;
  font-weight: 600;
}

.month-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.month-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.month-chip:hover {
  border-color: var(--maple);
  background: #fff7ed;
}
.month-chip.is-selected {
  background: var(--maple);
  border-color: var(--maple);
  color: #fff;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  display: inline-block;
}
.swatch.dispo {
  background: var(--dispo);
}
.swatch.insufisant {
  background: var(--insuf);
}
.swatch.complet {
  background: var(--complet);
}
.swatch.passe,
.swatch.aucun {
  background: var(--passe);
}

.cal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.cal-table th,
.cal-table td {
  padding: 0.55rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.cal-table th {
  background: var(--cream);
  font-weight: 700;
  font-size: 0.8rem;
}
.cal-table tr:last-child td {
  border-bottom: none;
}
.cal-table .day-label {
  text-align: right;
  padding-right: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  background: #fffdf8;
}

.slot-btn {
  appearance: none;
  width: 100%;
  min-height: 2.4rem;
  border-radius: 8px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.slot-btn:disabled {
  cursor: default;
  opacity: 0.85;
}
.slot-btn.dispo {
  background: var(--dispo-bg);
  color: var(--forest);
  border-color: #bbf7d0;
}
.slot-btn.dispo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(101, 163, 13, 0.2);
}
.slot-btn.dispo.is-selected {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}
.slot-btn.insufisant {
  background: var(--insuf-bg);
  color: var(--insuf);
}
.slot-btn.complet {
  background: var(--complet-bg);
  color: var(--complet);
}
.slot-btn.passe,
.slot-btn.aucun {
  background: var(--passe-bg);
  color: var(--passe);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.15rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: linear-gradient(145deg, #f59e0b, var(--maple));
  color: #fff;
  box-shadow: 0 6px 16px rgba(180, 83, 9, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(145deg, #fbbf24, var(--maple-deep));
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: var(--cream);
  color: var(--ink);
}

.summary {
  position: sticky;
  top: 1rem;
}
.summary .card-inner {
  padding: 1.15rem;
}
.summary h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--line);
}
.summary-row:last-of-type {
  border-bottom: none;
}
.summary-row .k {
  color: var(--muted);
}
.summary-row .v {
  font-weight: 600;
  text-align: right;
}
.summary .phone {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.summary .empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.check-row input {
  margin-top: 0.25rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin: 0.75rem 0;
}
.alert-error {
  background: var(--complet-bg);
  color: #7f1d1d;
  border: 1px solid #fecaca;
}
.alert-ok {
  background: var(--dispo-bg);
  color: #365314;
  border: 1px solid #bbf7d0;
}
.alert-info {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid var(--maple-soft);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(41, 37, 36, 0.45);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 1rem;
}
.overlay.is-on {
  display: grid;
}
.overlay-box {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  text-align: center;
  max-width: 280px;
  box-shadow: var(--shadow);
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--cream-dark);
  border-top-color: var(--maple);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.confirm-hero {
  text-align: center;
  padding: 1.5rem 1.25rem 0.5rem;
}
.confirm-hero .badge {
  display: inline-block;
  background: var(--dispo-bg);
  color: var(--forest);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.confirm-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}
.confirm-hero p {
  margin: 0;
  color: var(--muted);
}
.detail-list {
  padding: 0.5rem 1.25rem 1.25rem;
}
.detail-list .summary-row {
  padding: 0.55rem 0;
}
.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1.25rem;
}
.qr-wrap canvas,
.qr-wrap img {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.5rem;
  background: #fff;
}

/* Client modify form — single column; gray = locked, green = editable */
.mod-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.mod-fields .field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.mod-fields .input-ro,
.mod-fields .input-edit,
.mod-fields .field input.input-ro,
.mod-fields .field input.input-edit,
.mod-fields .field textarea.input-edit {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
}
/* Gray = locked contact fields */
.mod-fields .input-ro,
.mod-fields .field input.input-ro {
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--muted);
  cursor: default;
}
/* Green = editable (must beat .field input[type=number] { background:#fff }) */
.mod-fields .input-edit,
.mod-fields .field input.input-edit,
.mod-fields .field input[type="number"].input-edit,
.mod-fields .field textarea.input-edit {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: var(--ink);
}
.mod-fields .input-edit:focus,
.mod-fields .field input.input-edit:focus,
.mod-fields .field textarea.input-edit:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px #d9f99d88;
  background: #f0fdf4;
}
.mod-fields textarea.input-edit {
  min-height: 100px;
  resize: vertical;
}
.mod-qty-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 560px) {
  .mod-qty-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.mod-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--cream);
  border: 1px dashed var(--line);
  font-size: 0.95rem;
}
.mod-total strong {
  font-size: 1.15rem;
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.log-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.log-list time {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.rules {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 0.25rem;
}
.rules li {
  margin-bottom: 0.35rem;
}

.footer-note {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.loading-inline {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

@media (max-width: 560px) {
  .app {
    padding: 0.85rem 0.65rem 2.5rem;
  }
  .brand h1 {
    font-size: 1.15rem;
  }
  .cal-table {
    font-size: 0.78rem;
  }
  .slot-btn {
    min-height: 2.1rem;
    font-size: 0.7rem;
    padding: 0.2rem;
  }
}
