/* One question at a time, with the same palette as the festival. */
dialog.reg-dialog {
  width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 40px);
  padding: 0; border: 1px solid #c7a4ff30; border-radius: 28px;
  color: var(--text-primary); background: var(--panel-bg);
  box-shadow: 0 32px 120px #0009; overscroll-behavior: contain; scrollbar-width: thin;
}
dialog.reg-dialog::backdrop { background: #080710c9; backdrop-filter: blur(14px); }
html[data-theme="light"] dialog.reg-dialog { background: #fcfaff; border-color: #ded3ed; box-shadow: 0 30px 100px #2e1b4240; }
html[data-theme="light"] dialog.reg-dialog::backdrop { background: #24153166; }
.reg-shell { padding: 28px 38px 22px; }
.reg-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.reg-wordmark { font-size: 13px; font-weight: 650; line-height: 1; letter-spacing: .025em; }
.reg-wordmark span { margin-left: 5px; color: var(--accent-text); font-weight: 450; }
.reg-close { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; flex: 0 0 auto; border: 1px solid var(--border-soft); border-radius: 50%; color: var(--text-secondary); background: var(--panel-raised); transition: color .2s, border-color .2s; }
.reg-close svg { width: 18px; height: 18px; }
.reg-close:hover { color: var(--text-primary); border-color: var(--accent-text); }
.reg-heading h2 { font-size: 19px; font-weight: 500; line-height: 1.3; letter-spacing: -.025em; }
.reg-heading p { margin-top: 6px; color: var(--text-secondary); font-size: 11px; }
.reg-progress { margin: 28px 0 32px; }
.reg-progress-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
[data-reg-count] { color: var(--accent-text); font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.reg-progress-label { color: var(--text-secondary); font-size: 11px; }
.reg-progress-segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.reg-progress-segments>span { position: relative; height: 3px; border-radius: 4px; background: var(--border-soft); transition: background .3s; }
.reg-progress-segments .reg-step-current { background: linear-gradient(90deg, #9063e8, #df9cd2); box-shadow: 0 0 15px #a67de540; }
.reg-progress-segments .reg-step-complete { background: var(--accent-text); opacity: .6; }
.reg-form, .reg-form-fields { min-width: 0; padding: 0; border: 0; margin: 0; }
.reg-stage { position: relative; min-height: 250px; }
.reg-step { min-width: 0; }
.reg-question-head { margin-bottom: 26px; }
.reg-question-head h3 { max-width: 540px; font-size: clamp(29px, 3vw, 36px); font-weight: 500; line-height: 1.13; letter-spacing: -.045em; text-wrap: balance; }
.reg-question-head h3:focus, .reg-success h3:focus { outline: none; }
.reg-question-head h3 .reg-required { color: var(--accent-text); font-size: .65em; vertical-align: top; padding-left: 4px; }
.reg-question-head p { margin-top: 13px; max-width: 480px; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.reg-optional { display: block; margin-top: 10px; color: var(--text-secondary); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.reg-field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.reg-field label:not(.sr-only) { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.reg-field input { width: 100%; min-width: 0; min-height: 70px; border: 1px solid var(--border-soft); border-radius: 14px; padding: 18px 20px; color: var(--text-primary); background: var(--page-bg); font: 400 21px/1.5 Inter, Arial, sans-serif; letter-spacing: -.025em; transition: border-color .2s, box-shadow .2s; }
.reg-field input::placeholder { color: var(--text-secondary); opacity: .65; }
.reg-field input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 4px #9b70e610; }
.reg-field input[aria-invalid="true"] { border-color: #ef79a7; }
.reg-field[data-reg-field$="Other"] { margin-top: 18px; }
.reg-field[data-reg-field$="Other"] input { min-height: 52px; font-size: 16px; padding: 13px 16px; }
.reg-field-error { display: block; margin-top: 8px; color: #f39cbd; font-size: 12px; line-height: 1.5; }
html[data-theme="light"] .reg-field-error { color: #a62053; }
.reg-honeypot { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.reg-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; border: 0; padding: 0; margin: 0; min-width: 0; }
.reg-choice { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 53px; padding: 13px 15px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--page-bg); cursor: pointer; transition: background .2s, border-color .2s; }
.reg-choice input, .reg-track input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.reg-choice-label { font-size: 13px; line-height: 1.4; }
.reg-choice-check, .reg-track-check { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 19px; border: 1px solid var(--border-soft); border-radius: 50%; }
.reg-choice-check svg, .reg-track-check svg { width: 11px; height: 11px; opacity: 0; }
.reg-choice:hover, .reg-track:hover { border-color: #a67de580; }
.reg-choice:has(input:checked), .reg-track:has(input:checked) { border-color: var(--accent-text); background: linear-gradient(110deg, #9759e51c, #ca84ef08), var(--page-bg); }
.reg-choice:has(input:checked) .reg-choice-check, .reg-track:has(input:checked) .reg-track-check { background: #8752d9; border-color: #a37be0; color: #fff; }
.reg-choice:has(input:checked) .reg-choice-check svg, .reg-track:has(input:checked) .reg-track-check svg { opacity: 1; }
.reg-choice:has(input:focus-visible), .reg-track:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.reg-tracks { display: grid; gap: 10px; min-width: 0; border: 0; padding: 0; margin: 0; }
.reg-track { position: relative; display: flex; align-items: center; gap: 15px; padding: 16px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--page-bg); cursor: pointer; transition: border-color .2s, background .2s; }
.reg-track-symbol { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid #a879ee2b; border-radius: 11px; background: #a879ee0f; color: var(--accent-text); }
.reg-track-symbol svg { width: 23px; height: 23px; }
.reg-track-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
.reg-track-copy strong { font-size: 14px; font-weight: 550; line-height: 1.4; }
.reg-track-copy>span { max-width: 370px; color: var(--text-secondary); font-size: 11px; line-height: 1.55; }
.reg-privacy { margin: 18px 0 0; color: var(--text-secondary); font-size: 10px; line-height: 1.75; }
.reg-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border-soft); }
.reg-primary { display: inline-flex; align-items: center; justify-content: center; gap: 24px; min-width: 150px; min-height: 52px; padding: 14px 23px; border: 1px solid #bd90f24a; border-radius: 12px; color: #fff; background: linear-gradient(110deg, #8a4ad9, #6541d0); font-size: 14px; font-weight: 500; line-height: 1.4; box-shadow: inset 0 1px #ffffff18; transition: box-shadow .2s, transform .2s; }
.reg-primary:hover:not(:disabled) { box-shadow: inset 0 1px #ffffff18, 0 5px 25px #7948dc33; transform: translateY(-1px); }
.reg-primary svg { width: 18px; height: 18px; }
.reg-back { display: inline-flex; align-items: center; gap: 10px; padding: 13px 0; margin-right: auto; color: var(--text-secondary); background: transparent; font-size: 13px; }
.reg-back svg { width: 17px; height: 17px; }
.reg-back:hover { color: var(--text-primary); }
.reg-form-fields:disabled { opacity: .65; }
.reg-form-fields:disabled label { cursor: default; }
.reg-primary:disabled, .reg-back:disabled { opacity: .55; cursor: default; }
.reg-form[aria-busy="true"] .reg-submit-icon { width: 14px; height: 14px; border: 1.5px solid #ffffff50; border-top-color: white; border-radius: 50%; animation: reg-spin .8s linear infinite; }
.reg-form[aria-busy="true"] .reg-submit-icon svg { display: none; }
.reg-form-status { margin-top: 14px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.reg-uncertain { padding: 20px; margin-top: 22px; border: 1px solid #b990e74d; border-radius: 14px; background: #9d6cdc0d; }
.reg-uncertain h3 { font-size: 21px; line-height: 1.3; }
.reg-uncertain p { margin-top: 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.reg-source { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; color: var(--accent-text); font-size: 12px; line-height: 1.5; text-decoration: underline; text-underline-offset: 4px; }
.reg-source svg { width: 14px; height: 14px; }
.reg-uncertain>span { display: block; margin-top: 8px; color: var(--text-secondary); font-size: 10px; }
.reg-file { padding: 38px 0 18px; text-align: center; }
.reg-file p { margin-bottom: 24px; color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.reg-success { display: grid; justify-items: center; padding: 44px 14px 18px; text-align: center; }
.reg-success-mark { display: grid; place-items: center; width: 80px; height: 80px; margin-bottom: 26px; border: 1px solid #b990e757; border-radius: 50%; color: var(--accent-text); background: radial-gradient(circle, #ac79e628, #ac79e608); }
.reg-success-mark svg { width: 32px; height: 32px; }
.reg-success h3 { font-size: 33px; line-height: 1.2; }
.reg-success p { max-width: 400px; margin: 16px 0 28px; color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.reg-bottom-note { margin-top: 20px; color: var(--text-secondary); font-size: 10px; text-align: center; }
@keyframes reg-spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  dialog.reg-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 22px; }
  .reg-shell { padding: 18px 22px 20px; }
  .reg-header { margin-bottom: 15px; }
  .reg-heading h2 { font-size: 17px; }
  .reg-heading p { font-size: 10px; }
  .reg-progress { margin: 24px 0 27px; }
  .reg-progress-meta { margin-bottom: 10px; }
  .reg-progress-label { font-size: 10px; }
  .reg-progress-segments { gap: 5px; }
  .reg-stage { min-height: 222px; }
  .reg-question-head { margin-bottom: 22px; }
  .reg-question-head h3 { font-size: 29px; }
  .reg-question-head p { font-size: 12px; margin-top: 11px; }
  .reg-field input { min-height: 62px; font-size: 18px; padding: 15px 16px; }
  .reg-choices { gap: 8px; }
  .reg-choice { gap: 8px; min-height: 55px; padding: 11px 10px; border-radius: 10px; }
  .reg-choice-label { font-size: 12px; }
  .reg-choice-check { width: 16px; height: 16px; flex-basis: 16px; }
  .reg-track { gap: 10px; padding: 14px 12px; }
  .reg-track-symbol { width: 33px; height: 37px; flex-basis: 33px; border-radius: 8px; }
  .reg-track-symbol svg { width: 19px; height: 19px; }
  .reg-track-copy strong { font-size: 13px; }
  .reg-track-copy>span { font-size: 10px; }
  .reg-actions { gap: 14px; margin-top: 24px; padding-top: 20px; }
  .reg-actions .reg-primary { min-width: 138px; padding-inline: 17px; font-size: 13px; gap: 15px; }
  .reg-back { font-size: 12px; }
  .reg-uncertain { padding: 16px; }
  .reg-success { padding-inline: 0; }
  .reg-success h3 { font-size: 28px; }
}
@media (max-width: 350px) {
  .reg-shell { padding-inline: 17px; }
  .reg-question-head h3 { font-size: 27px; }
  .reg-choice { padding-inline: 8px; gap: 6px; }
  .reg-choice-label { font-size: 11px; }
  .reg-track-symbol { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reg-form[aria-busy="true"] .reg-submit-icon { animation: none; }
  .reg-dialog *, .reg-dialog *::before, .reg-dialog *::after { transition: none !important; }
}
html[data-motion="off"] .reg-form[aria-busy="true"] .reg-submit-icon { animation: none; }
html[data-motion="off"] .reg-dialog * { transition: none !important; }
/* Keep choices and navigation together on shorter laptop displays. */
@media (min-width: 561px) and (max-height: 760px) {
  .reg-shell { padding: 20px 34px 18px; }
  .reg-header { margin-bottom: 12px; }
  .reg-progress { margin: 20px 0 24px; }
  .reg-question-head { margin-bottom: 18px; }
  .reg-question-head h3 { font-size: 32px; }
  .reg-question-head p { margin-top: 9px; }
  .reg-stage { min-height: 220px; }
  .reg-choice { min-height: 46px; padding: 10px 13px; }
  .reg-track { padding: 13px 16px; }
  .reg-actions { margin-top: 20px; padding-top: 16px; }
}
.reg-shell:has([data-reg-success]:not([hidden])) .reg-bottom-note { display: none; }

/* Telegram stays within its own question; the bot opens separately without losing the draft. */
.reg-telegram-help { margin-top: 10px; color: var(--text-secondary); font-size: 11px; line-height: 1.6; }
.reg-bot-card { display: flex; align-items: flex-start; gap: 14px; margin-top: 22px; padding: 18px; border: 1px solid var(--border-soft); border-radius: 16px; background: linear-gradient(115deg, #9770ec14, #5896dd08); text-align: left; }
.reg-bot-symbol { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; color: var(--accent-text); background: #9871e81c; }
.reg-bot-symbol svg { width: 21px; height: 21px; }
.reg-bot-card strong { display: block; color: var(--text-primary); font-size: 13px; font-weight: 600; line-height: 1.5; }
.reg-bot-card p { margin: 7px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
.reg-bot-card a { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; margin-top: 7px; color: var(--accent-text); font-size: 12px; font-weight: 600; text-underline-offset: 4px; }
.reg-bot-card a:hover { text-decoration: underline; }
.reg-bot-card a:focus-visible, .reg-return:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; border-radius: 4px; }
.reg-bot-card a svg { width: 14px; height: 14px; }
.reg-success .reg-bot-card { margin-top: 0; width: 100%; max-width: 460px; }
.reg-success .reg-bot-card p { margin: 7px 0 0; font-size: 12px; }
.reg-return { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 12px; color: var(--text-secondary); background: transparent; font-size: 13px; }
.reg-return:hover { color: var(--text-primary); }
.reg-return svg { width: 16px; height: 16px; }
@media (max-width: 560px) {
  .reg-bot-card { gap: 11px; padding: 15px; margin-top: 17px; }
  .reg-bot-symbol { width: 32px; height: 32px; flex-basis: 32px; }
  .reg-bot-card p { font-size: 11px; }
}
