*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #0d1321;
  --slate: #2a3550;
  --mid: #5a6a8a;
  --muted: #8a99b8;
  --line: #e8ecf4;
  --surface: #f6f8fc;
  --white: #ffffff;
  --blue: #1a3bcc;
  --blue-h: #0f2b99;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --warn-bg: #fff8e6;
  --warn-border: #e8d4a0;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(13, 19, 33, 0.08);
  /* Match landing (forms/landing.css): deep base + one Málaga photo + tint */
  --form-page-bg-deep: #070c18;
  --form-page-bg-photo-opacity: 0.76;
  --form-page-bg-image: url("/imgs/bg/img1.jpg");
  --form-page-bg-enter-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --form-page-bg-enter-dur: 1.15s;
  --form-page-bg-scrim-delay: 0.12s;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--surface);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(26, 59, 204, 0.06) 0%, transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(200, 168, 75, 0.06) 0%, transparent 55%);
  min-height: 100vh;
  color: var(--slate);
}

a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

a:hover { text-decoration: underline; }

.form-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem) clamp(0.75rem, 3vw, 1rem);
}

/* Same ambience as landing slideshow: fixed photo at 0.76 over --deep + gradient scrim */
body.form-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background: var(--form-page-bg-deep);
  background-image: none;
}

body.form-page::before,
body.form-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body.form-page-models {
  --form-page-bg-image: url("/imgs/bg/img8.jpg");
}

body.form-page-fame {
  --form-page-bg-image: url("/imgs/bg/img5.jpg");
}

body.form-page-langdev {
  --form-page-bg-image: url("/imgs/bg/img11.jpg");
}

@keyframes form-page-bg-photo-in {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
  to {
    opacity: var(--form-page-bg-photo-opacity);
    transform: scale(1);
  }
}

@keyframes form-page-bg-scrim-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.form-page::before {
  background: var(--form-page-bg-image) center / cover no-repeat;
  opacity: var(--form-page-bg-photo-opacity);
  transform-origin: center center;
  animation: form-page-bg-photo-in var(--form-page-bg-enter-dur) var(--form-page-bg-enter-ease) both;
}

body.form-page::after {
  background: linear-gradient(
    to bottom,
    rgba(7, 12, 24, 0.5) 0%,
    rgba(7, 12, 24, 0.38) 35%,
    rgba(7, 12, 24, 0.55) 65%,
    rgba(7, 12, 24, 0.92) 100%
  );
  animation: form-page-bg-scrim-in calc(var(--form-page-bg-enter-dur) * 0.85) var(--form-page-bg-enter-ease)
    var(--form-page-bg-scrim-delay) both;
}

@media (prefers-reduced-motion: reduce) {
  body.form-page::before,
  body.form-page::after {
    animation: none;
  }

  body.form-page::before {
    opacity: var(--form-page-bg-photo-opacity);
    transform: none;
  }

  body.form-page::after {
    opacity: 1;
  }
}

body.form-page > * {
  position: relative;
  z-index: 1;
}

body.form-page .page-footer {
  color: rgba(255, 255, 255, 0.55);
}

body.form-page .page-footer a {
  color: rgba(255, 255, 255, 0.88);
}

body.form-page .page-footer a:hover {
  color: #fff;
}

/* Back to registration landing (forms/index.html) — above card, on dark backdrop */
.form-back-wrap {
  width: 100%;
  max-width: min(920px, 100%);
  margin-bottom: 0.65rem;
  animation: rise 0.5s 0.02s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.form-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.2rem;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(0.78rem, 2.2vw, 0.875rem);
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.form-back:hover {
  color: #fff;
  text-decoration: none;
}

.form-back:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

.form-back-icon {
  font-size: 1.05em;
  line-height: 1;
  opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
  .form-back-wrap {
    animation: none;
  }
}

.card {
  width: 100%;
  max-width: min(920px, 100%);
  overflow: hidden;
  border: 1px solid rgba(232, 236, 244, 0.86);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.uma-logo {
  display: block;
  flex-shrink: 1;
  width: auto;
  height: clamp(28px, 9vw, 38px);
  max-width: clamp(140px, 55vw, 220px);
  min-width: 0;
  object-fit: contain;
}

.card-head h1 {
  flex-shrink: 0;
  color: var(--mid);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-body {
  padding: clamp(1.35rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 2.25rem);
}

.models-header-banner-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.models-header-banner {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.intro {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--mid);
  font-size: clamp(0.78rem, 2.5vw, 0.82rem);
  line-height: 1.65;
}

.intro strong {
  color: var(--slate);
  font-weight: 700;
}

.form-section { margin-bottom: 1.75rem; }

.form-section:last-of-type { margin-bottom: 0; }

.form-section h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  color: var(--slate);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-section h2.section-kicker {
  margin-bottom: 0.5rem;
  padding-bottom: 0;
  border: none;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ─── Unified phone input ─────────────────────────────────── */

.phone-input {
  display: flex;
  align-items: stretch;
  min-height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.phone-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 59, 204, 0.12);
}

.phone-cc-wrap {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.2rem;
  padding: 0 0.65rem 0 0.8rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.phone-plus {
  color: var(--mid);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

/* Phone inputs are excluded from the global .field input rule (see below).
   Styled here directly with no cascade conflict. */
.phone-cc-input {
  width: 4ch;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(0.8125rem, 2.4vw, 0.875rem);
  font-weight: 400;
}

.phone-cc-input:focus,
.phone-nat-input:focus {
  outline: none;
  box-shadow: none;
}

.phone-nat-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem 0.55rem 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(0.8125rem, 2.4vw, 0.875rem);
  font-weight: 400;
}

.field { margin-bottom: 1rem; }

.field-grid .field,
.field:last-child { margin-bottom: 0; }

.field label,
.field .label-text,
.label-text {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--slate);
  font-size: clamp(0.8125rem, 2.4vw, 0.875rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field .optional {
  color: var(--muted);
  font-weight: 400;
}

/* Required field indicator — red asterisk (tracks [required] on the next sibling control, including when toggled in JS) */
abbr.req-mark,
.req-mark {
  color: var(--danger);
  font-weight: 800;
  text-decoration: none;
  cursor: help;
}

.field > .field-label-line:has(~ input[required]) > label:first-of-type::after,
.field > .field-label-line:has(~ select[required]) > label:first-of-type::after,
.field > .field-label-line:has(~ textarea[required]) > label:first-of-type::after,
.field > label:has(+ input[required])::after,
.field > label:has(+ select[required])::after,
.field > label:has(+ textarea[required])::after {
  content: " *";
  color: var(--danger);
  font-weight: 800;
}

label.checkbox-row.legal-block:has(> input[required]) > span::before {
  content: "* ";
  color: var(--danger);
  font-weight: 800;
}

.field input[type="text"]:not(.phone-cc-input):not(.phone-nat-input),
.field input[type="email"],
.field input[type="tel"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-size: clamp(0.8125rem, 2.4vw, 0.875rem);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field input[type="file"] {
  padding: 0.48rem 0.65rem;
}

.field input::placeholder,
.field textarea::placeholder,
.phone-cc-input::placeholder,
.phone-nat-input::placeholder {
  color: var(--muted);
  font-weight: 400;
  opacity: 1;
}


.field select {
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 59, 204, 0.12);
}

.field textarea {
  min-height: 4rem;
  resize: vertical;
}

.field.has-error input[type="text"]:not(.phone-cc-input):not(.phone-nat-input),
.field.has-error input[type="email"],
.field.has-error input[type="tel"],
.field.has-error input[type="file"],
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
  background: var(--danger-bg);
}

/* Phone inputs share the container's error state — don't redecorate them individually */
.field.has-error .phone-cc-input,
.field.has-error .phone-nat-input {
  border-color: transparent;
  background: transparent;
}

.field.has-error .phone-input {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.field.has-error .phone-input:focus-within {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.field.has-error .phone-cc-wrap {
  background: transparent;
}

.field.has-error input[type="text"]:not(.phone-cc-input):not(.phone-nat-input):focus,
.field.has-error input[type="email"]:focus,
.field.has-error input[type="tel"]:focus,
.field.has-error input[type="file"]:focus,
.field.has-error select:focus,
.field.has-error textarea:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

/* Label row: label + validation share one row (grid: label wraps in col 1, message col 2). */
.field-label-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.field-label-line > label,
.field-label-line > .label-text {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
  min-width: 0;
}

.field-error {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--danger);
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 600;
  text-align: right;
  box-sizing: border-box;
}

.field-label-line > .field-error {
  grid-column: 2;
  grid-row: 1;
  max-width: min(22rem, 46vw);
  justify-self: end;
}

/* Fieldsets cannot wrap <legend>; place message beside long legends (extra paper). */
fieldset.field.fieldset-clean:has(> .hint) {
  position: relative;
}

fieldset.field.fieldset-clean:has(> .hint) > .field-error {
  position: absolute;
  top: 0;
  right: 0;
  max-width: min(44%, 15rem);
}

fieldset.field.fieldset-clean:has(> .hint):has(> .field-error:not(:empty)) > legend {
  padding-right: min(46%, 15.5rem);
}

/* Short / sr-only legend (e.g. ACM opt-in): keep message in flow above radios. */
fieldset.field.fieldset-clean:not(:has(> .hint)) > .field-error {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0 0 0.35rem;
  text-align: right;
}

/* Agreement checkboxes: message under the text, right-aligned in the text column. */
label.checkbox-row.legal-block {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  row-gap: 0.35rem;
  align-items: start;
}

label.checkbox-row.legal-block > input {
  grid-column: 1;
  grid-row: 1 / span 2;
  margin-top: 0.2rem;
}

label.checkbox-row.legal-block > span:not(.field-error) {
  grid-column: 2;
  grid-row: 1;
}

label.checkbox-row.legal-block > .field-error {
  grid-column: 2;
  grid-row: 2;
  max-width: 100%;
  text-align: right;
}

.hint {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.hint-emphasis { color: var(--slate); }

.hint-block { margin-bottom: 1rem; color: var(--mid); }

.authorship-hint-list {
  padding-left: 1.2rem;
  list-style-type: disc;
  list-style-position: outside;
}

.authorship-hint-list li {
  margin-top: 0.5rem;
  padding-left: 0.2rem;
}

.authorship-hint-list li:first-child {
  margin-top: 0;
}

/* Visibility: native `hidden` attribute only (see setVisible in form scripts). */
.conditional {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 1rem;
}

.warning-panel {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}

/* File (and other) controls on warm panels: avoid pure white floating on yellow */
.warning-panel .field input[type="file"] {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--warn-border);
}

.warning-panel .field input[type="file"]::file-selector-button {
  margin-right: 0.65rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--warn-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--slate);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.warning-panel .field input[type="file"]::file-selector-button:hover {
  background: #fff;
  border-color: var(--mid);
}

.warning-panel .field input[type="file"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 59, 204, 0.12);
}

.warning-panel .field.has-error input[type="file"] {
  border-color: var(--danger);
  background: rgba(255, 244, 242, 0.92);
}

.warning-panel .field.has-error input[type="file"]:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.checkbox-row,
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  color: var(--mid);
  font-size: clamp(0.8125rem, 2.4vw, 0.875rem);
  line-height: 1.45;
}

.checkbox-row:last-child,
.radio-row:last-child { margin-bottom: 0; }

.radio-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.checkbox-row input,
.radio-row input {
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.legal-block {
  margin-bottom: 1rem;
  color: var(--mid);
  font-size: 0.78rem;
  line-height: 1.6;
}

.legal-block strong { color: var(--slate); }

.policy-list {
  margin: 0 0 1rem 1.1rem;
  color: var(--mid);
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 1rem;
  padding: 1rem 0;
}

.total-row .lbl {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.total-row .val {
  color: var(--blue);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.price-summary {
  margin: 1.25rem 0 1rem;
}

.price-summary > .total-row {
  margin-top: 0;
  padding-top: 0.85rem;
}

.price-breakdown {
  padding: 0.65rem 0 0.15rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.price-bd-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.28rem 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--slate);
}

.price-bd-row-muted {
  color: var(--mid);
  font-size: 0.8rem;
}

.price-bd-row-muted .price-bd-label {
  color: var(--mid);
}

.price-bd-row-muted .price-bd-val {
  text-align: right;
  font-weight: 500;
  max-width: 70%;
  color: var(--mid);
}

.price-bd-label {
  flex: 1;
  min-width: 0;
  color: var(--ink);
}

.price-bd-val {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--slate);
}

.price-bd-row-subtotal {
  margin-top: 0;
  padding-top: 0.45rem;
  font-weight: 700;
}

.price-bd-row-discount {
  color: var(--slate);
  font-weight: 600;
}

.field.has-success input[type="text"]:not(.phone-cc-input):not(.phone-nat-input),
.field.has-success input[type="email"],
.field.has-success select,
.field.has-success textarea {
  border-color: #1a7a52;
  background: #eef8f3;
}

.field.has-success input[type="text"]:not(.phone-cc-input):not(.phone-nat-input):focus,
.field.has-success input[type="email"]:focus,
.field.has-success select:focus,
.field.has-success textarea:focus {
  box-shadow: 0 0 0 3px rgba(26, 122, 82, 0.15);
}

.field-ok {
  display: block;
  margin: 0;
  padding: 0;
  color: #0d5c3d;
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 600;
  text-align: right;
  box-sizing: border-box;
}

.field-label-line > .field-ok {
  grid-column: 2;
  grid-row: 1;
  max-width: min(22rem, 46vw);
  justify-self: end;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--blue-h);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.15s;
}

.btn:hover {
  background: var(--blue);
  text-decoration: none;
}

.btn:active {
  background: var(--blue-h);
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn-pay {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-pay.is-pay-loading:disabled {
  opacity: 1;
  cursor: wait;
}

.btn-pay-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* At least spinner box (1.25rem) so swapping label ↔ spinner does not change button height */
  min-height: 1.5rem;
}

.btn-pay-spinner {
  display: none;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 3.5px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-pay-spin 1.5s linear infinite;
}

.btn-pay.is-pay-loading .btn-pay-label {
  display: none;
}

.btn-pay.is-pay-loading .btn-pay-spinner {
  display: block;
}

@keyframes btn-pay-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-secondary {
  border: 2px solid var(--blue-h);
  background: var(--white);
  color: var(--blue-h);
}

.btn-secondary:hover {
  border-color: var(--blue);
  background: var(--surface);
  color: var(--blue);
}

.btn.btn-saved {
  border-color: #1a7a45;
  background: #f0faf4;
  color: #1a7a45;
  animation: btn-pulse-green 0.35s ease;
}

.btn.btn-save-error {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
  animation: btn-pulse-red 0.35s ease;
}

@keyframes btn-pulse-green {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.035); }
  100% { transform: scale(1); }
}

@keyframes btn-pulse-red {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-4px); }
  40%  { transform: translateX(4px); }
  60%  { transform: translateX(-3px); }
  80%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.autosave-status {
  margin-top: 0.55rem;
  min-height: 1.1rem;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: right;
  transition: opacity 0.4s;
}

.autosave-status:empty { opacity: 0; }

.autosave-status.autosave-ok   { color: #1a7a45; }
.autosave-status.autosave-fail { color: var(--danger); }

.notice {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
  text-align: center;
}

.page-footer {
  margin-top: auto;
  padding: 1.25rem 1rem;
  color: var(--muted);
  font-size: clamp(0.7rem, 2vw, 0.78rem);
  text-align: center;
}

.form-page .page-footer {
  margin-top: 1.5rem;
  padding: 0 0.5rem;
  animation: rise 0.55s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--blue);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover { color: var(--blue-h); }

/* Closed <dialog> must stay display:none — do not set display:flex on dialog without [open]. */
dialog.terms-dialog {
  display: none;
}

dialog.terms-dialog[open] {
  display: flex;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(0.75rem, 3vw, 1.25rem);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

dialog.terms-dialog::backdrop {
  background: rgba(13, 19, 33, 0.45);
}

.terms-dialog .dialog-panel {
  width: 100%;
  max-width: min(720px, 94vw);
  max-height: 76vh;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(13, 19, 33, 0.18);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.terms-dialog .dialog-inner {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.2rem 1.5rem 1.2rem;
}

.terms-dialog .dialog-inner h2 {
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.terms-dialog .dialog-inner ol {
  padding-left: 1.25rem;
  color: var(--mid);
  font-size: 0.85rem;
  line-height: 1.65;
}

.terms-dialog .dialog-inner li { margin-bottom: 0.75rem; }

.dialog-close {
  margin-top: 1.25rem;
  width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.fieldset-clean {
  padding: 0;
  border: none;
}

.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.25rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 0.75rem; }
.mb-lg { margin-bottom: 1rem; }
.flush-bottom { margin-bottom: 0; }

@media (min-width: 640px) {
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 480px) {
  .btn-row { flex-direction: row; }
  .btn-row .btn { flex: 1; }
}

@media (max-width: 360px) {
  .card-head {
    gap: 0.5rem;
    padding: 0.8rem 1rem;
  }

  .card-head h1 {
    font-size: 0.62rem;
    letter-spacing: 0.07em;
  }
}

.turnstile-field {
  margin-top: 1rem;
}

#turnstileMount {
  min-height: 65px;
}
