/* place2be — démo non officielle. Mobile-first (375px), no external assets. */

:root {
  --accent: #0b6b6f;
  --accent-dark: #084d50;
  --accent-soft: #e3f1f1;
  --ink: #1d2830;
  --muted: #5d6b73;
  --line: #d9e0e4;
  --bg: #f6f8f9;
  --surface: #fff;
  --amber-bg: #fff1c2;
  --amber-ink: #6b4a00;
  --amber-line: #e8b400;
  --green-bg: #dff3e4;
  --green-ink: #14532d;
  --red-bg: #fde4e1;
  --red-ink: #8f1d12;
  --grey-bg: #e8ecee;
  --grey-ink: #46535b;
  --radius: 10px;
  --tap: 44px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main,
.footer {
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  padding-inline: 16px;
}
main {
  flex: 1;
  padding-block: 20px 32px;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 12px;
}
h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 28px 0 10px;
}
p {
  margin: 0 0 12px;
}
a {
  color: var(--accent);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-dark);
}
small,
.small {
  font-size: 0.875rem;
}
.muted {
  color: var(--muted);
}
.lead {
  font-size: 1.125rem;
}
.narrow {
  max-width: 420px;
  margin-inline: auto;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Demo banner, top bar, footer ---------- */
.demo-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--amber-bg);
  color: var(--amber-ink);
  border-bottom: 2px solid var(--amber-line);
  padding: 8px 16px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 4px max(16px, calc((100% - 860px) / 2 + 16px));
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
}
.topbar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
}
.topbar nav a,
button.link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 8px;
  color: var(--accent);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: none;
}
.topbar nav a:hover,
button.link:hover {
  text-decoration: underline;
}
button.link {
  background: none;
  border: 0;
  cursor: pointer;
}
form.inline {
  display: inline;
  margin: 0;
}

.footer {
  padding-block: 16px 28px;
  color: var(--muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--line);
}
.footer p {
  margin: 0;
}

/* ---------- Buttons ---------- */
.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 10px 20px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.button:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.button.primary {
  background: var(--accent);
  color: #fff;
}
.button.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}
.button.danger {
  border-color: var(--red-ink);
  color: var(--red-ink);
}
.button.danger:hover {
  background: var(--red-bg);
}
form.stack > .button,
.narrow .button {
  width: 100%;
}

/* ---------- Cards ---------- */
.cards {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
.card h2 {
  margin: 0 0 4px;
}

/* ---------- Forms ---------- */
form.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}
/* :where() keeps specificity at 0 so component rules (e.g. .qty input) win. */
:where(input:not([type="radio"], [type="checkbox"], [type="hidden"]), select, textarea) {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid #aab6bd;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* >= 16px: no iOS zoom */
  font-weight: 400;
}
input[type="radio"] {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  flex: none;
}
fieldset {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
legend {
  padding: 0 6px;
  font-weight: 700;
}
.choice {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.qty {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
}
.qty > span {
  flex: 1;
  min-width: 0;
}
.qty input {
  width: 88px;
  flex: none;
  text-align: right;
}
.field-error {
  color: var(--red-ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.flash {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  font-weight: 600;
}
.flash-ok {
  background: var(--green-bg);
  border-color: #8fcea0;
  color: var(--green-ink);
}
.flash-error {
  background: var(--red-bg);
  border-color: #eba39b;
  color: var(--red-ink);
}
.busy {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
}
.busy summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}
.busy ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

/* ---------- Quote & amounts ---------- */
.quote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 4px 16px 12px;
}
.quote h2 {
  margin-top: 12px;
}
table.amounts {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  background: var(--surface);
}
table.amounts td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.amounts tr.total td {
  font-weight: 700;
  font-size: 1.0625rem;
  border-top: 2px solid var(--ink);
  border-bottom: 0;
}
.quote table.amounts {
  margin-bottom: 8px;
  background: none;
}
abbr.demo {
  color: var(--amber-ink);
  font-weight: 700;
  text-decoration: none;
  cursor: help;
  margin-left: 2px;
  padding: 0 2px;
  border-radius: 3px;
  background: var(--amber-bg);
}

/* ---------- Badges & warnings ---------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--grey-bg);
  color: var(--grey-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-pending {
  background: var(--amber-bg);
  color: var(--amber-ink);
}
.badge-confirmed {
  background: var(--green-bg);
  color: var(--green-ink);
}
.badge-refused {
  background: var(--grey-bg);
  color: var(--grey-ink);
}
.badge-conflict {
  background: var(--red-bg);
  color: var(--red-ink);
}
.warning {
  background: var(--red-bg);
  border: 1px solid #eba39b;
  border-left: 5px solid var(--red-ink);
  border-radius: var(--radius);
  color: var(--red-ink);
  padding: 12px 14px;
  margin: 0 0 16px;
}
.warning ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.warning a {
  color: inherit;
}

/* ---------- Requests list (dashboard) ---------- */
ul.requests {
  list-style: none;
  margin: 12px 0 8px;
  padding: 0;
  display: grid;
  gap: 10px;
}
li.request > a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: var(--tap);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--grey-ink);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
li.request > a:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
}
li.request.status-pending > a {
  border-left-color: var(--amber-line);
}
li.request.status-confirmed > a {
  border-left-color: #2e9e57;
}
.req-date {
  font-size: 0.875rem;
  color: var(--muted);
}
.req-who {
  font-weight: 700;
}
.req-meta {
  font-size: 0.9375rem;
  color: var(--muted);
}
.req-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* ---------- Booking detail ---------- */
dl.summary {
  margin: 0 0 16px;
  padding: 4px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
dl.summary dt {
  margin-top: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
dl.summary dd {
  margin: 2px 0 10px;
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}
.actions form {
  margin: 0;
}
.actions .button {
  width: 100%;
}

/* ---------- Outbox ---------- */
ul.outbox {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
ul.outbox li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
ul.outbox li.placeholder {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}
.outbox-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}
ul.outbox pre {
  margin: 10px 0;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font: 0.875rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Calendar ---------- */
.calendar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 6px 10px;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cal-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 10px;
  font-weight: 600;
  text-decoration: none;
}
.cal-title {
  text-transform: capitalize;
  text-align: center;
}
.calendar table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.calendar th {
  padding: 4px 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.calendar td {
  height: 64px;
  padding: 2px;
  border: 1px solid var(--line);
  vertical-align: top;
  overflow: hidden;
}
.calendar td.pad {
  background: var(--bg);
  border-color: transparent;
}
.calendar td.today {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.day {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
}
.today .day {
  color: var(--accent-dark);
}
a.chip {
  display: block;
  margin-top: 2px;
  padding: 1px 2px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-pending {
  background: var(--amber-bg);
  color: var(--amber-ink);
  border: 1px solid var(--amber-line);
}
.chip-confirmed {
  background: var(--green-bg);
  color: var(--green-ink);
  border: 1px solid #5dbb7b;
}

/* ---------- Wider screens ---------- */
@media (min-width: 600px) {
  main {
    padding-block: 32px 48px;
  }
  h1 {
    font-size: 1.875rem;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .actions {
    flex-direction: row;
    align-items: flex-start;
  }
  .actions > form {
    flex: 1;
  }
  .actions .button {
    width: auto;
    min-width: 160px;
  }
  li.request > a {
    display: grid;
    grid-template-columns: 11rem 1fr auto;
    grid-template-areas: "date who badges" "date meta badges";
    column-gap: 16px;
    align-items: center;
  }
  .req-date {
    grid-area: date;
  }
  .req-who {
    grid-area: who;
  }
  .req-meta {
    grid-area: meta;
  }
  .req-badges {
    grid-area: badges;
    margin-top: 0;
    justify-content: flex-end;
  }
  .calendar td {
    height: 84px;
    padding: 4px;
  }
  .day,
  .calendar th {
    font-size: 0.875rem;
  }
  a.chip {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
.qty small {
  display: block;
}

/* ---------- M2: hall cards, tags ---------- */
.card > p {
  margin-bottom: 8px;
}
.card > .button {
  width: 100%;
  margin-top: 4px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.tags:empty {
  display: none;
}
.tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid #9cc9ca;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

/* ---------- M2: grouped tariffs, address row ---------- */
.rate-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rate-group + .rate-group {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.rate-group-title {
  margin: 0;
  line-height: 1.35;
}
.rate-group-title small {
  display: block;
}
.choice > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.row > label {
  min-width: 0;
}
.row .zip {
  flex: 0 0 5.5rem;
}
.row .grow {
  flex: 1 1 0;
}

/* ---------- M2: notices and messages ---------- */
.notice {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border: 1px solid #9cc9ca;
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-dark);
  font-size: 0.9375rem;
}
.notice.warning,
.notice-warning {
  background: var(--amber-bg);
  border-color: var(--amber-line);
  border-left-color: var(--amber-line);
  color: var(--amber-ink);
}
p.ok {
  color: var(--green-ink);
  font-weight: 600;
}
ul.messages {
  list-style: none;
  margin: 8px 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}
ul.messages li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9375rem;
}
ul.messages li.placeholder {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}

/* ---------- M2: invoice and deposit panels ---------- */
.panels {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.invoice-box,
.deposit {
  min-width: 0;
  padding: 4px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--grey-ink);
  border-radius: var(--radius);
}
.invoice-box {
  border-left-color: var(--accent);
}
.invoice-box h2,
.deposit h2 {
  margin: 12px 0 8px;
  font-size: 1.0625rem;
}
.invoice-box .button,
.deposit .button {
  width: 100%;
  text-align: center;
}
.deposit form {
  margin: 0 0 8px;
}
.deposit > :last-child,
.invoice-box > :last-child {
  margin-bottom: 0;
}
.deposit-paid {
  border-left-color: #2e9e57;
  background: #f3fbf5;
}
.deposit-unpaid {
  border-left-color: var(--amber-line);
  background: #fffaea;
}
.deposit-none {
  border-left-color: #aab6bd;
  background: var(--bg);
  color: var(--muted);
}

/* ---------- M2: amounts below the invoice total ---------- */
table.amounts tr.separate td {
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
table.amounts tr.total + tr.separate td {
  padding-top: 14px;
}
table.amounts tr.separate:last-child td {
  border-bottom: 0;
}

/* ---------- M2: calendar hall filter ---------- */
.cal-filter {
  margin: 4px 4px 10px;
}
.cal-filter label {
  font-size: 0.875rem;
  color: var(--muted);
}
.cal-filter select {
  width: 100%;
  color: var(--ink);
}

/* ---------- M2: deposit badges ---------- */
.badge-deposit-paid {
  background: var(--green-bg);
  color: var(--green-ink);
}
.badge-deposit-unpaid {
  background: var(--amber-bg);
  color: var(--amber-ink);
}
.badge-deposit-none {
  background: var(--grey-bg);
  color: var(--grey-ink);
}

@media (min-width: 600px) {
  .panels {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .card > .button {
    width: auto;
  }
  .cal-filter {
    max-width: 320px;
  }
}

/* Breathing room for amount tables that sit directly on the page background. */
section > table.amounts td:first-child {
  padding-left: 12px;
}
section > table.amounts td:last-child {
  padding-right: 12px;
}
section > table.amounts {
  border: 1px solid var(--line);
}
dl.summary dd > .badge + small {
  display: block;
  margin-top: 4px;
}

/* ---------- M3: deposit refund ---------- */
.badge-deposit-refunded {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.refund {
  margin: 16px 0;
}
.refund .button {
  width: 100%;
}

/* ---------- M3: regional portal ---------- */
.portal-search {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.portal-search input[type="search"],
.portal-search select {
  width: 100%;
}
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.filters label:last-child {
  grid-column: 1 / -1;
}
ul.portal-list {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.portal-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.portal-item.bookable {
  border-color: var(--accent);
  border-left-width: 4px;
}
.portal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.portal-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.portal-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.badge-bookable {
  background: var(--green-bg);
  color: var(--green-ink);
}
.badge-not-yet {
  background: var(--grey-bg);
  color: var(--grey-ink);
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.partners,
.cta {
  margin: 24px 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.cta {
  border-style: solid;
  background: var(--accent-soft);
}
.htmx-request #results,
#results.htmx-request {
  opacity: 0.6;
}

/* ---------- M3: onboarding ---------- */
ol.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 12px 0 20px;
  padding: 0;
  counter-reset: none;
}
.step {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  border-bottom: 4px solid var(--line);
  color: var(--muted);
}
.step-done {
  border-color: var(--accent);
  color: var(--accent-dark);
}
.step-current {
  border-color: var(--amber-line);
  color: var(--ink);
}
ul.drafts,
ul.plain,
ul.demo-accounts {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: grid;
  gap: 8px;
}
.done {
  text-align: center;
}
.done .button {
  width: 100%;
}

@media (min-width: 600px) {
  .portal-search {
    grid-template-columns: 1fr;
  }
  .filters {
    grid-template-columns: repeat(3, 1fr);
  }
  .filters label:last-child {
    grid-column: auto;
  }
}
