dialog.registration-dialog {
  --registration-gutter: 32px;
  width: min(840px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 88px 24px;
  border-radius: 12px;
  scrollbar-color: #7e739d #11172f;
  scrollbar-width: thin;
  font-style: normal;
  font-synthesis: none;
  letter-spacing: 0;
}

.registration-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--registration-gutter);
  background: #121830;
  border-bottom: 1px solid var(--border);
}

.registration-toolbar p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--registration-secondary); }
.registration-toolbar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.registration-toolbar .dialog-close {
  position: static;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 6px;
  color: var(--text);
}

.registration-toolbar .dialog-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.registration-toolbar .dialog-close:hover { background: #c2b9ff14; }
.registration-dialog .button { gap: 12px; font-size: 14px; font-style: normal; line-height: 1.5; letter-spacing: 0; }
.registration-dialog-content { padding: 24px var(--registration-gutter) 32px; }
.registration-dialog h2 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.4; letter-spacing: -.02em; text-wrap: balance; }
.registration-dialog .registration-description { max-width: 65ch; margin: 12px 0 24px; font-size: 14px; line-height: 1.8; }
.registration-dialog { --registration-secondary: var(--reading-secondary, #b8c0d4); }
.registration-event-details { margin: 8px 0 20px; font-size: 14px; color: var(--registration-secondary); }
.registration-event-details > summary, .registration-privacy-details > summary { width: fit-content; min-height: 44px; padding-block: 10px; cursor: pointer; line-height: 1.7; color: var(--lavender); }
.registration-event-details[open] { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.registration-event-details .registration-description { margin-bottom: 12px; color: var(--registration-secondary); }
.registration-event-details .registration-fee-note { margin-bottom: 0; color: var(--registration-secondary); }
.registration-event-details .registration-fee-note p + p { margin-top: 8px; }


.registration-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
  padding: 0 0 24px;
  list-style: none;
  border-bottom: 1px solid var(--border);
}

.registration-progress li { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; line-height: 1.5; text-align: center; color: var(--registration-secondary); }
.registration-progress li > span:last-child { max-width: 100%; overflow-wrap: normal; text-wrap: balance; }
.registration-step-number { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border: 1px solid #7e8cb4; border-radius: 50%; font-size: 12px; font-variant-numeric: tabular-nums; }
.registration-progress [aria-current="step"] { color: var(--text); font-weight: 600; }
.registration-progress [aria-current="step"] .registration-step-number { background: var(--lavender); border-color: var(--lavender); color: #11162c; }
.registration-progress [data-complete="true"] .registration-step-number { border-color: var(--lavender); color: var(--lavender); }
.registration-progress[hidden] { display: none; }
.registration-dialog .registration-step { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.registration-fee-note { margin-bottom: 28px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.registration-fee-note p { margin: 0; }
.registration-fee-note > p { color: var(--text); font-weight: 600; }
.registration-fee-note details { margin-top: 4px; }
.registration-fee-note summary { width: fit-content; padding-block: 8px; color: var(--lavender); cursor: pointer; text-underline-offset: 4px; }
.registration-fee-note summary:hover { text-decoration: underline; }
.registration-fee-note details p { max-width: 70ch; margin-top: 10px; }

.registration-group, .registration-sessions { min-width: 0; padding: 0; margin: 0; border: 0; }
.registration-group + .registration-group, .registration-sessions { margin-top: 32px; }
.registration-group legend, .registration-sessions legend { width: 100%; padding: 0; margin-bottom: 16px; font-size: 16px; font-weight: 600; line-height: 1.6; letter-spacing: 0; text-wrap: balance; color: var(--text); }
.registration-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.registration-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--text); }
.registration-field > span { text-wrap: pretty; }
.registration-fields > .registration-field { display: grid; grid-template-rows: subgrid; grid-row: span 3; padding-bottom: 8px; }
.registration-field-wide { grid-column: 1 / -1; }
.registration-field[hidden] { display: none; }

.registration-field input, .registration-field select, .registration-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #7e8cb4;
  border-radius: 6px;
  background: #090f23;
  color: var(--text);
  caret-color: var(--lavender);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  letter-spacing: 0;
  scroll-margin-block: 96px 24px;
}

.registration-field input:not([type="file"]), .registration-field select { height: 48px; }
.registration-field textarea { resize: vertical; }
.registration-field input:hover, .registration-field select:hover, .registration-field textarea:hover { border-color: #b3b9d6; }
.registration-field input:disabled, .registration-field select:disabled, .registration-field textarea:disabled { opacity: .65; }
.registration-field input::placeholder, .registration-field textarea::placeholder { color: #a6afc8; opacity: 1; }
.registration-field select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e9e5f7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  text-overflow: ellipsis;
  cursor: pointer;
}
.registration-field select option { font-family: Montserrat, Arial, sans-serif; font-size: 16px; font-weight: 400; font-style: normal; }

.registration-dialog :is(input, select, textarea, button, summary):focus-visible { outline: 2px solid var(--lavender); outline-offset: 3px; }
.registration-field small { font-size: 13px; font-weight: 400; line-height: 1.7; color: var(--registration-secondary); }
.discount-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: stretch; }
.discount-code-row .button { min-height: 48px; height: 48px; padding: 11px 20px; }
.discount-status { min-height: 0; margin-top: 2px; padding: 10px 12px; border: 1px solid #b5a2ef3d; border-radius: 6px; background: #b5a2ef0b; color: var(--lavender); line-height: 1.65; white-space: pre-line; }
.discount-status[data-state="pending"] { color: var(--muted); }
.discount-status[data-state="invalid"] { color: #ffb0b8; }
.discount-status:empty { display: none; }
.registration-choice-help { margin: -8px 0 12px; font-size: 14px; line-height: 1.7; color: var(--registration-secondary); }
#registration-connections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 4px; }

.registration-sessions .registration-choice, .payment-confirmation, .registration-invoice-toggle {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding-block: 8px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  cursor: pointer;
}

.registration-choice input, .payment-confirmation input, .registration-invoice-toggle input { width: 20px; height: 20px; min-width: 20px; margin: 2px 0 0; accent-color: var(--lavender); }
.registration-choice > span, .payment-confirmation > span, .registration-invoice-toggle > span { min-width: 0; max-width: 68ch; text-wrap: pretty; }
.registration-choice:has(:checked) { color: var(--lavender); }
#registration-connections-other { margin-top: 16px; }
.registration-privacy-notice { max-width: 68ch; margin: 0 0 16px; font-size: 14px; line-height: 1.8; color: var(--registration-secondary); text-wrap: pretty; }
.registration-privacy-details { margin: -8px 0 8px; font-size: 14px; }
#registration-privacy-consent { display: grid; gap: 4px; }

.registration-invoice-section { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.registration-invoice-toggle { width: fit-content; font-size: 14px; font-weight: 600; }
.registration-invoice { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.registration-invoice legend { padding: 0; margin-bottom: 16px; font-size: 16px; font-weight: 600; line-height: 1.6; color: var(--text); }
.registration-invoice textarea { min-height: 88px; }
.invoice-lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.invoice-lookup .button { width: auto; min-height: 48px; height: 48px; padding: 11px 20px; }
.invoice-help { margin: 10px 0 16px; font-size: 13px; line-height: 1.8; color: var(--registration-secondary); }
#invoice-lookup-status { color: var(--lavender); }
#invoice-lookup-status:empty { display: none; }
.invoice-fields { grid-template-columns: 1fr; }

.registration-dialog .registration-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.registration-actions .button { width: auto; min-height: 48px; }
.registration-dialog .registration-actions .button { min-height: 48px; padding: 12px 20px; box-shadow: none; }
.registration-form-actions .button { font-size: 14px; white-space: normal; }
.registration-form-actions .button[type="submit"] { margin-left: auto; }
.registration-form-actions #registration-next-label { font: inherit; }

.registration-dialog button:disabled { opacity: .55; cursor: wait; }
.registration-status { margin-top: 20px; font-size: 13px; line-height: 1.8; color: var(--lavender); overflow-wrap: anywhere; }
.registration-status:empty { display: none; }
.registration-dialog h3 { font-size: 22px; line-height: 1.5; }
#payment-summary { max-width: 65ch; font-size: 14px; line-height: 1.8; }
.payment-attendee { margin: 12px 0 20px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.payment-attendee span + span::before { content: ' · '; }
.payment-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 24px; }
.payment-qr { display: block; width: 240px; height: 240px; object-fit: contain; background: white; border-radius: 8px; padding: 8px; }
.payment-details { min-width: 0; margin: 0; }
.payment-details > div { padding: 10px 0; border-bottom: 1px solid var(--border); }
.payment-details dt { font-size: 12px; color: var(--muted); }
.payment-details dd { margin: 5px 0 0; font-size: 15px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.payment-details .payment-amount { font-size: 27px; color: var(--lavender); font-variant-numeric: tabular-nums; }
.payment-copy { min-height: 44px; margin-top: 4px; padding: 8px 0; border: 0; background: none; color: var(--lavender); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.payment-exemption { margin-top: 24px; padding: 20px; border: 1px solid var(--border); border-radius: 6px; color: var(--lavender); }
.payment-receipt { margin-top: 24px; }
.payment-receipt input { max-width: 100%; font-size: 14px; }
.payment-receipt input::file-selector-button { margin-right: 10px; padding: 8px 12px; border: 0; border-radius: 3px; background: #c2b9ff; color: #11162c; font: inherit; cursor: pointer; }
.payment-receipt-preview { display: block; max-width: 100%; width: auto; max-height: 260px; margin-top: 14px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; }
.payment-receipt-preview[hidden] { display: none; }
.payment-confirmation { margin-top: 16px; }
.registration-success { padding-block: 12px; }
.registration-success p { max-width: 65ch; margin-top: 18px; font-size: 15px; line-height: 1.9; }

@media (prefers-reduced-motion: no-preference) {
  dialog.registration-dialog[open] { animation: registration-open .24s cubic-bezier(.16, 1, .3, 1); }
  dialog.registration-dialog[open]::backdrop { animation: registration-backdrop .2s ease-out; }
}

@keyframes registration-open { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes registration-backdrop { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 600px) {
  dialog.registration-dialog { --registration-gutter: 20px; width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .registration-toolbar { gap: 8px; padding: 8px var(--registration-gutter); }
  .registration-toolbar p { font-size: 11px; }
  .registration-toolbar-actions { gap: 4px; }
  .registration-dialog-content { padding: 20px var(--registration-gutter) calc(24px + env(safe-area-inset-bottom)); }
  .registration-dialog h2 { font-size: 24px; }
  .registration-event-details { margin-block: 4px 16px; }
  .registration-progress { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; padding-bottom: 20px; }
  .registration-progress li { gap: 8px; font-size: 12px; }
  .registration-step-number { width: 24px; height: 24px; }
  .registration-fields, #registration-connections { grid-template-columns: 1fr; }
  .registration-field input, .registration-field select, .registration-field textarea { font-size: 16px; }
  .discount-code-row { grid-template-columns: 1fr; gap: 8px; }
  .discount-code-row .button { width: 100%; }
  .payment-layout { grid-template-columns: 1fr; gap: 18px; }
  .payment-qr { width: min(260px, 100%); height: auto; aspect-ratio: 1; margin-inline: auto; }
  .registration-dialog .registration-actions { flex-direction: column; }
  .registration-dialog .registration-actions .button { width: 100%; }
  .registration-dialog .registration-form-actions { flex-direction: row; flex-wrap: nowrap; gap: 10px; }
  .registration-dialog .registration-form-actions .button { flex: 1; width: auto; padding-inline: 14px; gap: 12px; }
  .registration-dialog .registration-form-actions #registration-information-back { flex: 0 0 auto; }

}

@media (forced-colors: active) {
  .registration-field select { appearance: auto; background-image: none; padding-right: 12px; }
  .registration-step-number { border-color: CanvasText; }
}

/* Short feedback for actions; content stays usable while transitions run. */
.registration-dialog {
  --registration-ease: cubic-bezier(.16, 1, .3, 1);
}
.registration-dialog .button,
.registration-toolbar .dialog-close {
  transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out, opacity 140ms ease-out;
}
.registration-field :is(input, select, textarea) {
  transition: border-color 140ms ease-out, background-color 140ms ease-out;
}
.registration-field :is(input, select, textarea):focus {
  border-color: var(--lavender);
  background-color: #0d152b;
}
.registration-step-number {
  transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
}
.registration-progress li,
.registration-choice {
  transition: color 160ms ease-out, background-color 160ms ease-out;
}
.registration-choice:has(:checked) { background-color: transparent; }
.registration-event-details > summary,
.registration-privacy-details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}
.registration-event-details > summary::-webkit-details-marker,
.registration-privacy-details > summary::-webkit-details-marker { display: none; }
.registration-event-details > summary::after,
.registration-privacy-details > summary::after {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c5b8f4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.registration-event-details[open] > summary::after,
.registration-privacy-details[open] > summary::after { transform: rotate(180deg); }
.registration-event-details[data-disclosure-expanded="false"] > summary::after,
.registration-privacy-details[data-disclosure-expanded="false"] > summary::after { transform: rotate(0); }
details[data-disclosure-expanded="false"] > summary > .disclosure-mark::after { transform: rotate(0); }
.registration-dialog button[aria-busy="true"]::before,
.registration-dialog[aria-busy="true"] .registration-actions .button-primary::before {
  content: '';
  width: 14px;
  height: 14px;
  flex: none;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .registration-dialog .button,
  .registration-toolbar .dialog-close,
  .hero-register { transition: transform 140ms var(--registration-ease, ease-out), background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out, opacity 140ms ease-out; }
  .registration-dialog .button:not(:disabled):active,
  .hero-register:active { transform: translateY(0) scale(.985); }
  .registration-toolbar .dialog-close:active { transform: scale(.94); }
  .registration-event-details > summary::after,
  .registration-privacy-details > summary::after { transition: transform 180ms var(--registration-ease); }
  .registration-dialog button[aria-busy="true"]::before,
  .registration-dialog[aria-busy="true"] .registration-actions .button-primary::before { animation: registration-working .8s linear infinite; }
}
@keyframes registration-working { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .registration-dialog .button:not(:disabled):hover,
  .hero-register:hover { transform: none; }
}
