/* ==========================================================================
 * Event Studio - Vendors > Registration (Milestone H)
 *
 * views/vendor-registration.js (st-vreg, st-vreg-form / -group / -share /
 * -q, the tables of tiers and codes) and its dialogs
 * (ui/vendor-setup-dialogs.js, st-vreg-dialog). The tier dot and chip are
 * css/vendor-host.css; the invite rows are css/invites.css (st-inv-*).
 * Colours are the kit's tokens; a tier's own colour comes from the data.
 * Nothing here moves, so there is nothing to switch off for reduced motion.
 * ========================================================================== */

.st-vreg { display: flex; flex-direction: column; gap: 16px; max-width: 1120px; }
.st-vreg__notes { display: flex; flex-direction: column; gap: 10px; }
.st-vreg__notes:empty { display: none; }
.st-vreg-card > .st-card__header { align-items: center; }
.st-vreg-warn { color: var(--st-amber); }
.st-vreg-bullets { margin: 0; padding-left: 20px; list-style: disc; font-size: 13.5px; line-height: 1.6; color: var(--st-text-dim); }
.st-vreg-bullets li::marker { color: var(--st-text-muted); }

/* ---------- first time ---------- */
.st-vreg-first { border-color: rgba(124, 92, 255, 0.35); background: linear-gradient(180deg, rgba(109, 92, 255, 0.08), rgba(109, 92, 255, 0) 70%), var(--st-bg-card); }
.st-vreg-first[hidden] { display: none; }
.st-vreg-first .st-card__body > * + * { margin-top: 12px; }
.st-vreg-first__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.st-vreg-first .st-prose { max-width: 76ch; }
.st-vreg-first__steps { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.st-vreg-first__steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--st-text-dim); }
.st-vreg-first__steps li > .st-icon { flex: 0 0 auto; margin-top: 2px; color: var(--st-text-muted); }
.st-vreg-first__steps li strong { color: var(--st-text); }
.st-vreg-first__steps li.is-done > .st-icon { color: var(--st-green); }

/* ---------- the settings form ---------- */
.st-vreg__state:empty { display: none; }
.st-vreg__stateline { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--st-text-dim); }
.st-vreg__stateline[hidden] { display: none; }
.st-vreg-form { display: flex; flex-direction: column; }
.st-vreg-group { display: flex; flex-direction: column; gap: 14px; padding: 18px 0; border-top: 1px solid var(--st-border); min-width: 0; }
.st-vreg-group:first-child { padding-top: 6px; border-top: 0; }
.st-vreg-group__title { display: flex; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; color: var(--st-text); }
.st-vreg-group .st-toggle { align-self: flex-start; max-width: 76ch; }
.st-vreg-group .st-prose { margin: 0; max-width: 76ch; }
.st-vreg-inline { display: flex; align-items: flex-start; gap: 8px; margin: -6px 0 0 46px; font-size: 12.5px; line-height: 1.45; color: var(--st-text-muted); }
.st-vreg-inline[hidden] { display: none; }
.st-vreg-inline .st-icon { flex: 0 0 auto; margin-top: 1px; }
.st-vreg-inline.is-warn { color: var(--st-amber); }
.st-vreg-group > .st-field__error { margin: -6px 0 0 46px; }
.st-vreg-group > .st-field__error[hidden] { display: none; }
.st-vreg-clear { flex: 0 0 auto; background: none; border: 0; padding: 2px 0; cursor: pointer; }
.st-vreg-clear[hidden] { display: none; }
.st-vreg-suffix { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.st-vreg-suffix .st-input { width: 96px; }
.st-vreg__formerror:empty { display: none; }
.st-vreg__formerror { margin-top: 4px; }
/* The unsaved bar: last on the page, sticking to the bottom of the window while the form has unsaved
   changes, so it is in view from every card (the same bar as on Details). */
.st-vreg-barslot { position: sticky; bottom: 16px; z-index: 30; }
.st-vreg-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 10px 12px 10px 16px;
  background: var(--st-bg-pop); border: 1px solid var(--st-border-strong); border-radius: var(--st-r-12); box-shadow: var(--st-shadow-pop);
}
.st-vreg-bar[hidden] { display: none; }
.st-vreg-bar__text { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; min-width: 0; flex: 1 1 240px; }
.st-vreg-bar__state { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.st-vreg-bar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-amber); }
.st-vreg-bar__detail { font-size: 12.5px; color: var(--st-text-muted); min-width: 0; }
.st-vreg-bar__detail:empty { display: none; }
.st-vreg-bar__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }
/* Toasts sit in the same corner as the bar's buttons; lift them clear of it. */
body:has(.st-vreg-bar:not([hidden])) .st-toasts { bottom: 86px; }

/* "Not saved yet" under the on / off switch. */
.st-vreg-pending { font-weight: 600; }

/* A teammate changed the setting the user is editing: said next to it, with the two ways out. */
.st-vreg-conflictslot:empty { display: none; }
.st-vreg-conflict {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; max-width: 76ch;
  padding: 8px 10px 8px 12px; font-size: 12.5px; line-height: 1.45;
  background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.35); border-radius: var(--st-r-10, 10px);
}
.st-vreg-conflict > .st-icon { flex: 0 0 auto; color: var(--st-amber); }
.st-vreg-conflict__text { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.st-vreg-conflict__acts { display: inline-flex; gap: 6px; flex: 0 0 auto; }

/* Invites: registration is off (an invite-only event), and what an invitation holds. */
.st-vreg-inviteonly { color: var(--st-amber); margin-bottom: 10px; }
.st-vreg-invitehold { margin-top: 10px; }
.st-vreg-dialog__note.is-warn { color: var(--st-amber); }

/* the vendor page: QR and link */
.st-vreg-share { display: flex; align-items: center; gap: 20px; min-width: 0; }
.st-vreg-share__qr {
  flex: 0 0 auto; width: 132px; height: 132px; display: grid; place-items: center; padding: 6px;
  border-radius: var(--st-r-10); background: #fff; overflow: hidden;
}
.st-vreg-share__qr-image { display: grid; place-items: center; }
.st-vreg-share__qr canvas { width: 120px; height: 120px; image-rendering: pixelated; }
.st-vreg-share__qr .st-link { padding: 6px; font-size: 12px; color: #4b3df5; text-align: center; }
.st-vreg-share.is-off .st-vreg-share__qr-image { opacity: 0.55; }
.st-vreg-share__links { min-width: 0; }
.st-vreg-share__links .st-muted { max-width: 70ch; line-height: 1.5; }
.st-vreg-share__url { font-size: 15px; font-weight: 600; word-break: break-all; }
.st-vreg-share__note { margin: 0; color: var(--st-text-muted); }
.st-vreg-share__note[data-kind="success"] { color: var(--st-green); }
.st-vreg-share__note[data-kind="warning"] { color: var(--st-amber); }
.st-vreg-share__preview { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--st-border); }
.st-vreg-share__preview .st-muted { margin: 0; }

/* the questions */
.st-vreg-qs { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.st-vreg-qs[hidden] { display: none; }
.st-vreg-q {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 10px 10px 12px;
  border: 1px solid var(--st-border); border-radius: var(--st-r-12); background: var(--st-bg-elev);
}
.st-vreg-q__n { flex: 0 0 22px; padding-top: 9px; font-size: 13px; font-weight: 600; color: var(--st-text-muted); font-variant-numeric: tabular-nums; }
.st-vreg-q__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.st-vreg-q__row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.st-vreg-q__row > .st-input:not(.st-select) { flex: 1 1 260px; min-width: 0; }
.st-vreg-q__row > .st-select { flex: 0 0 150px; width: 150px; }
.st-vreg-q__row > .st-check { flex: 0 0 auto; }
.st-vreg-q__acts { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; margin-left: auto; }
.st-vreg-q__options { display: flex; flex-direction: column; gap: 4px; max-width: 420px; }
.st-vreg-q__options .st-textarea { min-height: 76px; }

/* ---------- the tables: tiers and codes ---------- */
.st-vreg-pad { padding: 4px 20px 16px; }
.st-vreg-scroll { overflow-x: auto; border-top: 1px solid var(--st-border); }
.st-vreg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.st-vreg-tiers .st-vreg-table { min-width: 940px; }
.st-vreg-codes .st-vreg-table { min-width: 780px; }
.st-vreg-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
  color: var(--st-text-muted); padding: 10px 12px; border-bottom: 1px solid var(--st-border); background: var(--st-bg-head);
}
.st-vreg-table td { padding: 10px 12px; border-bottom: 1px solid var(--st-border); vertical-align: middle; }
.st-vreg-table th:first-child, .st-vreg-table td:first-child { padding-left: 20px; }
.st-vreg-table th:last-child, .st-vreg-table td:last-child { padding-right: 14px; }
.st-vreg-table tbody tr:last-child td { border-bottom: 0; }
.st-vreg-table tr.is-dim td:not(.st-vreg-acts) { opacity: 0.62; }
.st-vreg-table th.st-vreg-num, .st-vreg-table td.st-vreg-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The one column that gives way: it takes the room the others leave and cuts its text off. */
.st-vreg-table td.st-vreg-tier, .st-vreg-table td.st-vreg-note { width: 99%; max-width: 0; }
.st-vreg-table td:not(.st-vreg-tier):not(.st-vreg-note) { white-space: nowrap; }
.st-vreg-tier > .st-vh-tier { font-size: 14px; }
.st-vreg-tier > .st-vh-tier .st-vh-tier__name { font-weight: 600; }
.st-vreg-tier > .st-badge { margin-left: 8px; vertical-align: middle; }
.st-vreg-tier__desc { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-vreg-places { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.st-vreg-acts { width: 1%; white-space: nowrap; }
.st-vreg-acts__row { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.st-vreg-foot { margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--st-border); }
.st-vreg-code { display: inline-flex; align-items: center; gap: 4px; }
.st-vreg-code code { font-family: var(--st-mono); font-size: 13px; font-weight: 600; letter-spacing: 0.05em; color: var(--st-text); }
.st-vreg-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- invites ---------- */
.st-vreg-invites > .st-empty { padding-top: 12px; padding-bottom: 12px; }
.st-vreg-inv__tier { flex: 0 1 auto; min-width: 0; max-width: 200px; margin-left: auto; font-size: 13px; }
.st-vreg-invites .st-inv-row__text + .st-vreg-inv__tier + .st-badge { margin-left: 0; }

/* ---------- the dialogs ---------- */
.st-vreg-dialog__error:empty { display: none; }
.st-vreg-dialog__error { margin-top: 14px; }
.st-vreg-dialog__held {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 12px; border-radius: var(--st-r-10);
  font-size: 13px; color: var(--st-text-dim); background: var(--st-bg-elev); border: 1px solid var(--st-border);
}
.st-vreg-dialog__held .st-icon { flex: 0 0 auto; color: var(--st-text-muted); }
.st-vreg-dialog__badge { display: flex; flex-direction: column; gap: 12px; }
.st-vreg-dialog__badge > .st-field { margin-left: 46px; max-width: 280px; }
.st-vreg-dialog__badge > .st-field[hidden] { display: none; }
.st-vreg-dialog__sponsor { display: flex; flex-direction: column; gap: 4px; }
.st-vreg-dialog__sponsor > p { margin: 0 0 0 24px; max-width: 60ch; }
.st-vreg-dialog__code { display: flex; align-items: center; gap: 8px; }
.st-vreg-dialog__code .st-input { flex: 1 1 auto; min-width: 0; }
.st-vreg-code-input { font-family: var(--st-mono); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.st-vreg-code-input::placeholder { font-weight: 400; letter-spacing: 0.04em; }
.st-vreg-dialog__note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--st-text-muted); }
.st-vreg-dialog__note .st-icon { flex: 0 0 auto; margin-top: 2px; }
.st-vreg-dialog .st-field[hidden] { display: none; }

@media (max-width: 720px) {
  .st-vreg-share { flex-direction: column; align-items: flex-start; }
  .st-vreg-inline, .st-vreg-group > .st-field__error { margin-left: 0; }
  .st-vreg-q { flex-direction: column; gap: 4px; }
  .st-vreg-q__n { padding-top: 0; }
  .st-vreg-q__acts { margin-left: 0; }
  .st-vreg-dialog__badge > .st-field { margin-left: 0; }
  .st-vreg-inv__tier { margin-left: 0; }
}
