﻿/* ------------------------------------------------------------------ *
 * Public billetterie — a civic ticketing identity.
 *
 * The identity derives from a single --accent, taken from the app's own
 * brand indigo so the public pages stay of a piece with the back-office.
 * The signature is the
 * perforated ticket: choosing seats composes your billet, the tear line
 * is a real punched edge, and references are set in monospace like a
 * printed stub. Scoped under .bp so it never touches the Radzen admin.
 * ------------------------------------------------------------------ */

.bp {
  /* The app's brand indigo (--primary-color). Re-theme the whole flow here. */
  --accent: #2B346B;
  --accent-ink: #ffffff;
  --ink: #14181f;
  --muted: #6b7075;
  --paper: #ffffff;
  --wash: #e9eaec;
  --line: #d7d4cd;
  --line-strong: #b9b5ac;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  position: fixed;
  inset: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% -10%, rgba(43, 52, 107, 0.05), transparent 45%),
    var(--wash);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  padding: clamp(1.25rem, 5vw, 3.5rem) 1rem 3rem;
}

.bp__col {
  width: min(38rem, 100%);
  margin: 0 auto;
}

/* Masthead ------------------------------------------------------------ */
.bp__mast {
  text-align: center;
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
}
.bp__wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.bp__wordmark::after {
  content: "";
  display: block;
  width: 2.2rem;
  height: 3px;
  background: var(--accent);
  margin: 0.5rem auto 0;
}
.bp__eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.7rem;
}

/* The ticket --------------------------------------------------------- */
.ticket {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(20, 24, 31, 0.04), 0 18px 40px -28px rgba(20, 24, 31, 0.5);
  overflow: hidden;
  animation: bp-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ticket + .ticket { margin-top: 1.1rem; }

@keyframes bp-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.ticket__head {
  padding: clamp(1.4rem, 5vw, 2.1rem);
}
.ticket__kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}
.ticket__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}
.ticket__meta {
  margin-top: 1rem;
  display: grid;
  gap: 0.35rem;
}
.ticket__meta-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.95rem;
}
.ticket__meta-row .material-icons {
  font-size: 1.05rem;
  color: var(--accent);
  transform: translateY(2px);
}
.ticket__meta-row time { font-variant-numeric: tabular-nums; }
.ticket__desc {
  margin-top: 1rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}
.ticket__seats {
  margin-top: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(43, 52, 107, 0.07);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.ticket__seats-dot {
  width: 0.45rem; height: 0.45rem; border-radius: 50%;
  background: var(--accent);
}

/* The perforation: a dashed tear line punched by two notch circles.
   The notches are filled with the page wash so they read as cut-outs. */
.ticket__perf {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--line-strong);
  margin: 0 clamp(1.4rem, 5vw, 2.1rem);
}
.ticket__perf::before,
.ticket__perf::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--wash);
  border: 1px solid var(--line);
  transform: translateY(-50%);
}
.ticket__perf::before { left: calc(-1 * clamp(1.4rem, 5vw, 2.1rem) - 13px); }
.ticket__perf::after  { right: calc(-1 * clamp(1.4rem, 5vw, 2.1rem) - 13px); }

.ticket__body {
  padding: clamp(1.4rem, 5vw, 2.1rem);
}
.ticket__section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

/* Tarif rows --------------------------------------------------------- */
.tarif {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}
.tarif:first-of-type { border-top: 0; }
.tarif.is-picked { position: relative; }
.tarif.is-picked::before {
  content: "";
  position: absolute;
  left: -0.9rem; top: 50%;
  width: 3px; height: 1.6rem;
  background: var(--accent);
  transform: translateY(-50%);
  border-radius: 3px;
}
.tarif__name {
  font-weight: 600;
  font-size: 1rem;
}
.tarif__price {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.tarif__price.is-free {
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* Stepper ------------------------------------------------------------ */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.stepper__btn {
  appearance: none;
  border: 0;
  background: transparent;
  width: 2.3rem; height: 2.3rem;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.stepper__btn:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.stepper__btn:disabled { color: var(--line-strong); cursor: not-allowed; }
.stepper__val {
  min-width: 2.1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  border-inline: 1px solid var(--line);
  align-self: stretch;
  display: grid;
  place-items: center;
}

/* Radzen inputs, dressed for the ticket ------------------------------ *
 * The form controls stay Radzen (consistency, accessibility, the team's
 * stack); only their skin is aligned to the ticket — accent focus, the
 * paper fill, the rounded edge. */
.bp .rz-textbox,
.bp .rz-numeric input {
  font-family: var(--sans);
  color: var(--ink);
  background: #fbfbfa;
}
.bp .rz-form-field {
  --rz-input-focus-border: var(--accent);
  --rz-primary: var(--accent);
}
.bp .rz-form-field.rz-variant-outlined .rz-form-field-content {
  border-radius: 8px;
}
.bp .rz-form-field.rz-state-focused .rz-form-field-label { color: var(--accent); }

/* The quantity stepper. */
.bp-numeric {
  width: 6.2rem;
  --rz-input-background-color: var(--paper);
}
.bp-numeric.rz-numeric {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}
.bp-numeric .rz-numeric-input {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.bp-numeric .rz-button.rz-button-icon-only:hover { background: var(--accent); color: var(--accent-ink); }

/* Legacy plain-input styles kept for any bespoke field. */
.bp-field { display: block; margin-top: 0.9rem; }
.bp-field__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.bp-input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fbfbfa;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.bp-input::placeholder { color: #a7a49c; }
.bp-input:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 52, 107, 0.14);
}
.bp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 30rem) { .bp-grid-2 { grid-template-columns: 1fr; } }

.bp-attendees { margin-top: 1.4rem; }

/* Total + pay -------------------------------------------------------- */
.ticket__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  border-top: 2px dashed var(--line-strong);
}
.ticket__total-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticket__total-amount {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Pay / download — a RadzenButton in ticket clothes. High specificity so
   it wins over Radzen's .rz-button defaults. */
.bp .rz-button.bp-pay,
.bp-pay {
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.95rem 1.2rem;
  min-height: 3rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: none;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.bp .rz-button.bp-pay .rz-button-text { font: inherit; letter-spacing: inherit; }
.bp-pay .material-icons { font-size: 1.15rem; }
.bp .rz-button.bp-pay:hover:not(:disabled),
.bp-pay:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.bp .rz-button.bp-pay:active:not(:disabled),
.bp-pay:active:not(:disabled) { transform: translateY(1px); }
.bp .rz-button.bp-pay:disabled,
.bp-pay:disabled { opacity: 0.55; cursor: progress; }
.bp .rz-button.bp-pay--inline { max-width: 22rem; margin-inline: auto; }

.bp-secure {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  justify-content: center;
}
.bp-secure .material-icons { font-size: 0.95rem; }

/* Stamp (confirmation / ready) --------------------------------------- */
.stamp {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  transform: rotate(-7deg);
  opacity: 0.85;
}

.ticket--state { position: relative; text-align: center; }
.ticket--state .ticket__head { padding-bottom: clamp(1.6rem, 5vw, 2.3rem); }
.state__icon {
  width: 3.4rem; height: 3.4rem;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 1rem;
  background: rgba(43, 52, 107, 0.09);
  color: var(--accent);
}
.state__icon .material-icons { font-size: 1.9rem; }
.state__ref {
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: var(--wash);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  display: inline-block;
  margin: 0.4rem 0 0.2rem;
}
.state__msg { color: var(--muted); line-height: 1.55; margin-top: 0.8rem; }
.state__msg strong { color: var(--ink); }

/* Pending pulse — a ticket being printed. */
.state__icon.is-waiting { background: transparent; }
.pulse {
  position: relative;
  width: 3.4rem; height: 3.4rem;
  margin: 0 auto 1rem;
}
.pulse__ring {
  position: absolute; inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: bp-pulse 1.6s ease-out infinite;
}
.pulse__ring:nth-child(2) { animation-delay: 0.5s; }
.pulse__core {
  position: absolute; inset: 32%;
  border-radius: 50%;
  background: var(--accent);
}
@keyframes bp-pulse {
  0%   { transform: scale(0.5); opacity: 0.55; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* Alert (unavailable) ------------------------------------------------- */
.bp-alert {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  color: var(--ink);
  line-height: 1.5;
}

/* Loading ------------------------------------------------------------ */
.bp-loading {
  display: grid; place-items: center;
  min-height: 40vh; gap: 0.9rem;
  color: var(--muted);
}
.bp-loading .pulse { margin: 0; }

/* Reçu — the donation variant of the stub. Here the artefact is a tax
   receipt rather than a ticket: the amount is the hero, set large in the
   printed-stub monospace, and the details read like a receipt's foot. */
.receipt__amount {
  margin: 1.1rem 0 0.2rem;
}
.receipt__amount-num {
  font-family: var(--mono);
  font-size: clamp(2.3rem, 11vw, 3.1rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.receipt__amount-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.receipt__lines {
  margin: 0;
  text-align: left;
  border-top: 1px solid var(--line);
}
.receipt__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.receipt__line dt {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  flex: none;
}
.receipt__line dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-word;
  color: var(--ink);
}

.receipt__next {
  margin: 1.4rem 0 0;
  display: grid;
  gap: 0.8rem;
  text-align: left;
}
.receipt__next-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}
.receipt__next-row .material-icons {
  font-size: 1.05rem;
  color: var(--accent);
  transform: translateY(1px);
  flex: none;
}

/* A row of actions (cancel page): the primary keeps the paid look, the
   ghost recedes to an outline so the retry reads as the main path. */
.bp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.bp-actions .bp-pay { width: auto; margin-top: 0; flex: 1 1 12rem; }

.bp .rz-button.bp-pay--ghost,
.bp-pay--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line-strong);
}
.bp .rz-button.bp-pay--ghost:hover:not(:disabled),
.bp-pay--ghost:hover:not(:disabled) {
  background: rgba(43, 52, 107, 0.06);
  filter: none;
}

/* Keyboard focus. The bespoke buttons drop Radzen's outline, so give it
   back explicitly — visible on paper, drawn in the accent. */
.bp .rz-button.bp-pay:focus-visible,
.bp-pay:focus-visible,
.bp a:focus-visible,
.bp button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Invitation — the carton and its reply coupon.
 *
 * The billetterie's artefact is a ticket you buy. An invitation's is a
 * printed carton addressed to one person, with a detachable coupon you
 * return with your answer. Same paper, same perforation, different
 * artefact: above the tear the carton names its addressee, below it the
 * coupon carries the reply and, once answered, wears its stamp.
 * ------------------------------------------------------------------ */

/* The addressee line, set where the tear will separate "who this is for"
   from "what you answer". This is what an invitation has that a ticket
   does not: a name on it. */
.carton__addressee {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.carton__addressee-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.carton__addressee-name {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

/* Reply coupon ------------------------------------------------------- */
.reply__question {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.35;
  margin: 0 0 1.1rem;
  color: var(--ink);
}
/* Stacked, not side by side: confirming and declining are not two halves of
   a toggle. The primary takes the full width, the decline recedes below it —
   and the uppercase labels stop breaking mid-phrase. */
.reply__actions { flex-direction: column; }
.reply__actions .bp-pay { flex: 0 0 auto; width: 100%; margin-top: 0; }

/* On a phone the tracking is what breaks the label across two lines; tighten
   it rather than shortening a label that has to stay unambiguous. */
@media (max-width: 26rem) {
  .bp .rz-button.bp-pay,
  .reply__actions .bp-pay { letter-spacing: 0.07em; font-size: 0.78rem; }
}

/* A standing condition the reader needs before choosing — the event is
   full, so confirming means the waiting list. Stated, not discovered. */
.reply__note {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0 0 1.1rem;
  padding: 0.8rem 0.9rem;
  background: var(--wash);
  border-left: 3px solid var(--line-strong);
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
}
.reply__note .material-icons {
  font-size: 1.05rem;
  color: var(--muted);
  flex: none;
  transform: translateY(1px);
}

.reply__error {
  margin: 1.1rem 0 0;
  padding: 0.8rem 0.9rem;
  border-left: 3px solid #b91c1c;
  background: rgba(185, 28, 28, 0.06);
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #7f1d1d;
}

/* The returned coupon: the answer on record, stamped. */
.reply__recorded {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.reply__recorded-text {
  flex: 1 1 14rem;
  line-height: 1.55;
  color: var(--muted);
}
.reply__recorded-text strong { color: var(--ink); }

.stamp--inline {
  position: static;
  flex: none;
  align-self: flex-start;
}

/* Changing your mind is allowed until the event starts; say so rather
   than leaving two buttons to be guessed at. */
.reply__change {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin-top: 1.1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reply__change:hover { text-decoration-thickness: 2px; }

/* What confirming earns you: the joining link, and the date in your own
   calendar. Both belong to the confirmed state only. */
.reply__next {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line-strong);
  display: grid;
  gap: 0.7rem;
}
.reply__next-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.reply__next-item .material-icons { font-size: 1.1rem; flex: none; }
.reply__next-item:hover { text-decoration: underline; text-underline-offset: 3px; }
.reply__next-item span:not(.material-icons) { word-break: break-word; }

@media (prefers-reduced-motion: reduce) {
  .ticket { animation: none; }
  .pulse__ring { animation: none; opacity: 0; }
  .pulse__core { inset: 30%; }
}
