:root {
  --ink: #213b7a;
  --muted: #213b7a;
  --line: #d7dee8;
  --paper: #ffffff;
  --panel: #ffffff;
  --free: #2f8f6b;
  --reserved: #b7791f;
  --taken: #8f3a3a;
  --selected: #213b7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
.home-donation-button,
.back-button,
.help-button,
.help-button::after {
  font-family: inherit;
}

.app {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.home {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  margin: -18px calc(50% - 50vw) 0;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 28px;
  text-align: center;
  padding: 54px 18px 42px;
  overflow: hidden;
  isolation: isolate;
}

.home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("/home-bg.png") center center / cover no-repeat;
  opacity: 0.42;
}

.home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.5);
}

.home[hidden],
.event-page[hidden] {
  display: none;
}

.home-logo {
  width: min(260px, 62vw);
  height: auto;
  display: block;
}

.home h1 {
  max-width: 860px;
}

.event-buttons {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.event-buttons button,
.home-donation-button {
  min-height: 54px;
  padding-inline: 10px;
  white-space: nowrap;
}

.event-buttons .event-button-disabled {
  background: var(--ink);
  color: #fff;
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-thickness: 3px;
  pointer-events: none;
}

.home-donation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.home-message {
  min-height: 30px;
  margin-top: 18px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

@media (min-width: 821px) {
  .event-buttons {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .event-buttons > * {
    grid-column: span 2;
  }

  .event-buttons .home-colis-button {
    grid-column: 2 / span 2;
  }

  .event-buttons .home-simha-button {
    grid-column: 4 / span 2;
  }

  .event-buttons [data-coming-soon="L'arbre du souvenir"] {
    grid-column: 6 / span 2;
  }
}

.event-page {
  position: relative;
  padding-top: 22px;
}

.event-back {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: start;
  padding: 10px 0 22px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: grid;
  gap: 8px;
  grid-column: 2;
  justify-items: center;
  text-align: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
}

.topbar p:last-child {
  margin-top: 10px;
  color: var(--muted);
}

.event-description {
  max-width: 780px;
  font-weight: 800;
  line-height: 1.35;
}

.event-description[hidden] {
  display: none;
}

.event-price-note[hidden] {
  display: none;
}

.status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
  grid-column: 3;
  align-items: center;
}

.status span,
.back-button,
.help-button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
}

.help-button {
  width: 100%;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  text-decoration: none;
  text-align: center;
}

.back-button {
  width: auto;
  font-weight: 700;
  min-width: 96px;
}

.status strong {
  color: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 460px) minmax(0, 1fr);
  gap: 28px;
  padding-top: 28px;
  align-items: start;
}

.post-payment-mode .workspace {
  grid-template-columns: 1fr;
}

.post-payment-mode .panel,
.post-payment-mode .map,
.post-payment-mode .table-choice-actions {
  display: none;
}

.post-payment-mode .main-column {
  width: 100%;
}

.payment-step .workspace {
  grid-template-columns: 1fr;
}

.payment-step .panel,
.payment-step .map,
.payment-step .table-choice-actions {
  display: none;
}

.payment-step .main-column {
  width: 100%;
}

.table-choice-step .workspace {
  grid-template-columns: 1fr;
}

.table-choice-step .main-column {
  display: grid;
}

.table-form-step .workspace {
  grid-template-columns: minmax(320px, 560px);
  justify-content: center;
}

.table-form-step .main-column {
  display: none;
}

.kippour-mode:not(.payment-step):not(.post-payment-mode) .workspace,
.kiddouch-mode:not(.payment-step):not(.post-payment-mode) .workspace {
  display: flex;
  justify-content: center;
}

.kippour-mode:not(.payment-step):not(.post-payment-mode) .main-column,
.kiddouch-mode:not(.payment-step):not(.post-payment-mode) .main-column {
  display: none;
}

.kippour-panel,
.kiddouch-panel {
  max-width: 620px;
  position: static;
  text-align: center;
}

.kippour-mode .status,
.kiddouch-mode .status {
  display: flex;
  grid-column: 2;
  justify-content: center;
  margin-top: 4px;
}

.kippour-mode .status span,
.kiddouch-mode .status span {
  display: none;
}

.kippour-mode .help-button,
.kiddouch-mode .help-button {
  width: auto;
  min-width: 190px;
}

.complete-banner {
  margin-top: 34px;
  padding: 34px 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: clamp(36px, 7vw, 76px);
  line-height: 1;
  font-weight: 900;
  text-align: center;
}

.complete-banner[hidden],
.workspace[hidden] {
  display: none;
}

.main-column {
  display: grid;
  gap: 18px;
}

.table-choice-actions {
  display: grid;
  gap: 12px;
  width: min(560px, 100%);
  justify-self: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.table-choice-actions[hidden] {
  display: none;
}

.price-note {
  font-weight: 800;
}

.panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  position: sticky;
  top: 18px;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel[hidden],
#reservationForm[hidden],
#kippourPanel[hidden] {
  display: none;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  min-width: 0;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

input[readonly] {
  background: #eef2fb;
  cursor: not-allowed;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  min-width: 0;
}

input:focus {
  outline: 2px solid rgba(33, 59, 122, 0.28);
  outline-offset: 1px;
}

button {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.selection,
.message {
  min-height: 22px;
  color: var(--muted);
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message.error {
  color: var(--taken);
}

.message.success {
  color: var(--free);
}

.helper-text {
  line-height: 1.45;
  color: var(--muted);
}

.choice-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-buttons[hidden] {
  display: none;
}

.kippour-block {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.kippour-block[hidden] {
  display: none;
}

.kippour-main-note {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fc;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.kippour-warning {
  margin: 0;
  color: #b3261e;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.kippour-selected .helper-text {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fc;
  color: var(--ink);
  font-weight: 800;
}

.kippour-full-block {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 24px 18px;
  border: 2px solid #b3261e;
  border-radius: 8px;
  background: #fff6f5;
  color: #b3261e;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 900;
  line-height: 1.35;
}

.kippour-full-block[hidden] {
  display: none;
}

.kippour-full-block p {
  margin: 0;
  display: grid;
  gap: 8px;
  text-align: center;
}

.kippour-zone {
  display: grid;
  gap: 8px;
}

.kippour-zone label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kippour-participants-head,
.kippour-participant-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kippour-participants-head {
  font-size: 16px;
}

.kippour-participants-head span,
.kippour-total {
  font-weight: 800;
  color: var(--ink);
}

.kippour-participants {
  display: grid;
  gap: 14px;
}

.kippour-buyer-card,
.kippour-participant {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.kippour-buyer-card,
.kippour-participant,
.kippour-panel label,
.kippour-panel legend {
  text-align: left;
}

.kippour-buyer-card h2 {
  font-size: 18px;
  color: var(--ink);
  justify-self: start;
  text-align: left;
}

.kippour-participant-title strong {
  font-size: 16px;
}

.kippour-remove-participant,
.secondary-button {
  background: #eef2fb;
  color: var(--ink);
}

.kippour-remove-participant {
  width: auto;
  min-height: 0;
  padding: 7px 10px;
  font-size: 13px;
}

.kippour-zone-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.kippour-zone-options label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kippour-results {
  display: grid;
  gap: 12px;
}

.kippour-result {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.kippour-result:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #f6f8fc;
}

.kippour-existing-form {
  display: grid;
  gap: 12px;
}

.kippour-existing-form[hidden] {
  display: none;
}

.kiddouch-options {
  display: grid;
  gap: 10px;
  text-align: left;
}

.kiddouch-options label,
.kiddouch-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kiddouch-options label[hidden] {
  display: none;
}

.kiddouch-full-option {
  color: #8f3a3a;
  text-decoration: line-through;
}

.kiddouch-extra {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fc;
  color: var(--ink);
  line-height: 1.45;
  text-align: left;
}

.kiddouch-extra[hidden],
#kiddouchOccasionBlock[hidden],
#kiddouchMontantLibreBlock[hidden],
#kiddouchNoteElabore[hidden] {
  display: none;
}

.contact-info {
  font-weight: 800;
  line-height: 1.45;
}

.map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}

.payment {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.payment[hidden] {
  display: none;
}

.payment-header {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.post-payment .payment-header {
  padding: 24px;
}

.post-payment .payment-header h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
}

.post-payment .payment-header p {
  font-size: clamp(20px, 2.4vw, 32px);
}

.payment-header p {
  color: var(--muted);
  line-height: 1.45;
}

.payment-actions {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.donation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.donation-option {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.donation-option h3 {
  margin: 0;
  padding: 14px;
  color: var(--ink);
  font-size: 18px;
  text-align: center;
  line-height: 1.25;
}

#iframe_assoconnect,
#iframe_don_assoconnect,
#iframe_repas_assoconnect {
  display: block;
  min-height: 720px;
  width: 100%;
}

.table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}

.table.rectangle-layout {
  padding: 18px 10px;
}

.round-table {
  position: relative;
  width: min(100%, 250px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.rectangle-table {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 2.15;
  margin: 0 auto;
}

.seats {
  position: absolute;
  inset: 0;
}

.table-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #f6f8fc;
  border: 2px solid rgba(33, 59, 122, 0.18);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  padding: 10px;
}

.rectangle-table .table-center {
  width: 88%;
  height: 40%;
  aspect-ratio: auto;
  border-radius: 8px;
}

.seat {
  position: absolute;
  left: calc(50% + var(--seat-x));
  top: calc(50% + var(--seat-y));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(38px, 18%, 48px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef8f3;
  color: var(--free);
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.rect-seat {
  left: var(--seat-left);
  top: var(--seat-top);
  width: clamp(34px, 15.2%, 44px);
}

.seat.reservee {
  background: #fff7e6;
  color: var(--reserved);
  cursor: pointer;
}

.seat.prise {
  background: #fdecec;
  color: var(--taken);
  cursor: not-allowed;
}

.seat.selected {
  background: #edf3ff;
  border-color: var(--selected);
  color: var(--selected);
  box-shadow: inset 0 0 0 2px var(--selected);
}

@media (max-width: 820px) {
  .event-buttons {
    grid-template-columns: 1fr;
  }

  .event-buttons [data-coming-soon] {
    grid-column: auto;
  }

  .event-buttons .home-simha-button {
    grid-column: auto;
  }

  .event-buttons [data-event-button="rosh-hachana"] {
    order: 1;
  }

  .event-buttons [data-event-button="kippour"] {
    order: 2;
  }

  .event-buttons [data-event-button="souccot-1"] {
    order: 3;
  }

  .event-buttons [data-event-button="souccot-2"] {
    order: 4;
  }

  .event-buttons .home-loulavim-button {
    order: 5;
  }

  .event-buttons .home-simha-button {
    order: 6;
  }

  .event-buttons .home-don-button {
    order: 7;
  }

  .event-buttons [data-event-button="kiddouch"] {
    order: 8;
  }

  .event-buttons .home-repas-button {
    order: 9;
  }

  .event-buttons .home-colis-button {
    order: 10;
  }

  .event-buttons [data-coming-soon="L'arbre du souvenir"] {
    order: 11;
  }

  .topbar,
  .workspace {
    display: grid;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding-top: 54px;
  }

  .kippour-mode .event-back,
  .kiddouch-mode .event-back {
    top: 0;
    width: calc(50% - 8px);
    height: 52px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
  }

  .kippour-mode .topbar,
  .kiddouch-mode .topbar {
    padding-top: 72px;
  }

  .kippour-mode .brand,
  .kiddouch-mode .brand {
    text-align: center;
    justify-items: center;
  }

  .kippour-mode .status,
  .kiddouch-mode .status {
    position: absolute;
    right: 0;
    top: 0;
    width: calc(50% - 8px);
    height: 52px;
    margin-top: 0;
  }

  .kippour-mode .help-button,
  .kiddouch-mode .help-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    min-width: 0;
    padding-inline: 8px;
    font-size: 0;
    font-weight: 700;
    line-height: 1.2;
  }

  .kippour-mode .help-button::after,
  .kiddouch-mode .help-button::after {
    content: attr(data-mobile-label);
    font-size: 16px;
  }

  .brand,
  .status {
    grid-column: 1;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .panel {
    position: static;
  }

  .status {
    justify-content: center;
  }

  .donation-grid {
    grid-template-columns: 1fr;
  }
}
