/* The beta form as an overlay (task 3259; Oliver's second frame of 11 Nov 2026): a grey panel over the middle of the
 * page, the provider marks still showing round it. The app's dialog language (tokens.css): its shadow and its quick,
 * confident arrival; fields and controls in the app's sizes. 12 Nov 2026: one panel width for every step, the admin
 * design spec's radii (surface 10, control 7) and spacing scale, fields that keep their line when one shows an error,
 * and a result step that leads with its own heading instead of sitting under the form's. */
:root {
  --dialog: #1f1f1f;
  --dialog-edge: rgb(255 255 255 / 0.07);
  --field: #141414;
  --field-edge: #2e2e2e;
  --field-edge-hover: #3c3c3c;
  --placeholder: #7d7d7d;
  --panel-width: 600px;
  --shadow-overlay: 0 0 0 1px rgb(255 255 255 / 0.04), 0 2px 4px rgb(0 0 0 / 0.24), 0 28px 72px -12px rgb(0 0 0 / 0.65);
}
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: var(--s6) var(--s4); overflow-y: auto; overscroll-behavior: contain; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.32); animation: fade var(--dur) ease-out both; }
.dialog { position: relative; width: min(100%, var(--panel-width)); padding: var(--s6); border-radius: var(--radius-surface);
  background: var(--dialog); box-shadow: var(--shadow-overlay); color: var(--text-body); animation: arrive var(--dur) var(--ease-out) both; }
/* The head carries the title; the close button stands in the corner on the panel's own padding. */
.dialog-head { margin: 0 0 var(--s2); padding-right: var(--s6); }
.dialog-title { margin: 0; color: var(--text); font-size: 20px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.dialog-title:focus, [data-beta-focus]:focus { outline: none; }
.dialog-close { position: absolute; z-index: 1; top: calc(var(--s6) - 6px); right: calc(var(--s6) - 6px); display: grid; place-items: center; width: 32px; height: 32px;
  padding: 0; border: 0; border-radius: var(--radius-control); background: none; color: var(--text-dim); cursor: pointer;
  transition: background var(--dur-fast) ease-out, color var(--dur-fast) ease-out; }
.dialog-close:hover { background: rgb(255 255 255 / 0.06); color: var(--text); }
.dialog-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.dialog-text { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.6; text-wrap: pretty; }
.dialog-text strong { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }

/* A result (received, closed, unreachable) leads with its own heading: the form's title steps out of sight, kept for
 * the dialog's name. */
.dialog:has(> .step-result:not([hidden])) > .dialog-head { margin: 0; padding: 0; }
.dialog:has(> .step-result:not([hidden])) > .dialog-head > .dialog-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.step-result > .result-title { padding-right: var(--s6); }

.step { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); animation: fade var(--dur) ease-out both; }
/* The form: its introduction, then the fields a step further down, then the action a step further again. */
.step > .dialog-text:first-child { margin-bottom: var(--s2); }
.step > .button { margin-top: var(--s2); }
.status { display: flex; align-items: center; gap: var(--s3); margin: var(--s2) 0 0; color: var(--text-dim); font-size: 14px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--s4); }
.field { display: grid; align-content: start; gap: var(--s2); min-width: 0; }
.label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); color: var(--text-body); font-size: 13px; font-weight: 500; line-height: 1.4; }
.optional { color: var(--text-dim); font-size: 12px; font-weight: 400; }
.input { width: 100%; min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--field-edge); border-radius: var(--radius-control); background: var(--field);
  color: var(--text); font: 400 15px/1.4 var(--font); transition: border-color var(--dur-fast) ease-out, box-shadow var(--dur-fast) ease-out; }
textarea.input { display: block; min-height: 96px; padding: 10px var(--s3); line-height: 1.5; resize: vertical; }
.input::placeholder { color: var(--placeholder); opacity: 1; }
.input:hover { border-color: var(--field-edge-hover); }
.input:focus { outline: none; border-color: rgb(111 180 255 / 0.75); box-shadow: 0 0 0 3px rgb(111 180 255 / 0.16); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgb(255 123 114 / 0.12); }
.input[disabled] { opacity: 0.5; }
/* The browser's own fill keeps the field's colours. */
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text); box-shadow: 0 0 0 1000px var(--field) inset; transition: background-color 9999s; }
.error { margin: 0; color: var(--danger); font-size: 13px; line-height: 1.45; }
.error:empty { display: none; }

.check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--s3); align-items: start; color: var(--text-dim); font-size: 13px; line-height: 1.55; cursor: pointer; }
.check a { color: var(--text-body); }
.check input { appearance: none; width: 18px; height: 18px; margin: 1px 0 0; border: 1px solid var(--field-edge-hover); border-radius: 5px; background: var(--field); cursor: pointer;
  transition: background var(--dur-fast) ease-out, border-color var(--dur-fast) ease-out; }
.check input:hover { border-color: #555; }
.check input:checked { border-color: var(--chip); background: var(--chip) center / 12px 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%23161616' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.check input[aria-invalid="true"] { border-color: var(--danger); }
.check input[disabled] { opacity: 0.5; cursor: default; }
/* A field no person sees or fills, kept out of the page and out of the tab order. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s3); width: 100%; min-height: 44px; padding: 0 var(--s4); border: 0;
  border-radius: var(--radius-control); background: var(--chip); color: var(--chip-text); font: 500 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast) ease-out; }
.button:hover { background: var(--chip-hover); }
.button:active { background: var(--chip-press); }
.button[disabled] { opacity: 0.6; cursor: default; }
.spinner { flex: none; width: 16px; height: 16px; border: 2px solid rgb(255 255 255 / 0.18); border-top-color: currentColor; border-radius: 50%; animation: spin 0.8s linear infinite; }
.button .spinner { border-color: rgb(0 0 0 / 0.18); border-top-color: currentColor; }

/* A result: the status mark beside its heading, the words under the heading, then the action across the panel. */
.step-result { grid-template-columns: 20px minmax(0, 1fr); column-gap: var(--s3); row-gap: var(--s2); align-items: start; }
.step-result > * { grid-column: 2; }
.step-result > .result-icon { grid-column: 1; grid-row: 1; margin-top: 3px; }
.step-result > .button, .step-result > .download { grid-column: 1 / -1; }
.step-result > .button { margin-top: var(--s4); }
.result-title { margin: 0; color: var(--text); font-size: 20px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.result-icon { display: block; width: 20px; height: 20px; color: var(--text-body); }
.result-icon svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.result-ok { color: var(--success); }
.result-warn { color: var(--warning); }

@keyframes arrive { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .overlay { place-items: start center; padding: var(--s4); }
  .row { grid-template-columns: minmax(0, 1fr); }
  .dialog { padding: var(--s5); }
  .dialog-close { top: calc(var(--s5) - 6px); right: calc(var(--s5) - 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .scrim, .dialog, .step, .spinner { animation: none; }
  .input, .button, .check input, .dialog-close { transition: none; }
}
