/* Shared by the Optimist apps (OYF.DRAFT.UI): boot screen, focus ring, brand stripe, FormDialog, ChoiceGroup.
   Logo colors: orange #FF4D05, red-orange #C2280C, blue #204EAC. */

/* Boot screen until Blazor starts */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; font-family: Barlow, Roboto, sans-serif; color: #4B5563; }
.boot img { max-width: 60vw; height: auto; animation: boot-pulse 1.6s ease-in-out infinite; }
@keyframes boot-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .boot img { animation: none; } }
/* Still loading after 20 seconds, or the download failed (inline script in each index.html); red-orange with white text is 5.9:1 */
.boot-stalled img { animation: none; }
.boot-reload { min-height: 44px; padding: .6rem 1.75rem; border: 0; border-radius: 8px; background: #C2280C; color: #FFFFFF; font: 600 1rem Barlow, Roboto, sans-serif; cursor: pointer; }

/* Keyboard focus: the logo orange is 3.3:1 on white, enough for a focus indicator (WCAG 2.4.13 needs 3:1) */
:focus-visible { outline: 3px solid #FF4D05; outline-offset: 2px; }
/* Blazor focuses each page's h1 after navigation (for screen readers); that isn't keyboard focus, so no ring */
h1:focus, h1:focus-visible { outline: none; }

/* The football's two halves, as a stripe under the app bar */
.brand-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(180deg, #FF4D05 50%, #C2280C 50%); }
.brand-logo { display: inline-flex; align-items: center; background: #FFFFFF; border-radius: 8px; padding: 2px 6px; }
.brand-logo img { height: 44px; width: auto; display: block; }

/* Edit dialogs (FormDialog): brand stripe, icon tile, scrolling body, sticky actions; a bottom sheet on phones */
.form-dialog { display: flex; flex-direction: column; overflow: hidden; }
.form-dialog::before { content: ""; display: block; flex: none; height: 4px; background: linear-gradient(180deg, #FF4D05 50%, #C2280C 50%); }
.form-dialog .form-dialog-title { padding: 20px 24px 8px; }
.form-dialog .form-dialog-content { flex: 1; overflow-y: auto; padding-top: 8px; padding-bottom: 8px; }
.form-dialog .form-dialog-actions { flex: none; gap: 8px; padding: 12px 24px 16px; border-top: 1px solid var(--mud-palette-lines-default); background: var(--mud-palette-surface); }
.dialog-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: rgba(32, 78, 172, .10); color: var(--mud-palette-primary); }
.form-section + .form-section { margin-top: 20px; }
@media (max-width: 599.98px) {
    .mud-dialog-container .mud-dialog.form-dialog { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; width: 100%; max-width: 100%;
        max-height: 92dvh; border-radius: 16px 16px 0 0; }
    .form-dialog .form-dialog-title { padding: 16px 16px 4px; }
    .form-dialog .form-dialog-content { padding-left: 16px; padding-right: 16px; }
    .form-dialog .form-dialog-actions { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .form-dialog .dialog-primary { flex: 1; }
}

/* ChoiceGroup: tappable cards over native radios */
.choice-group { border: 0; margin: 0; padding: 0; min-width: 0; }
/* The legend looks like an outlined field's raised label, and the cards are as tall as a field. */
.choice-group legend { padding: 0 0 0 4px; margin-bottom: 4px; font-size: .75rem; line-height: 16px; font-weight: 500; color: var(--mud-palette-text-secondary); }
/* DropdownOnWide: cards on phones, a select once the field sits beside others (600px and up). */
.choice-wide { display: none; }
@media (min-width: 600px) { .choice-wide { display: block; } .choice-narrow { display: none; } }
.choice-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 10px 14px; border-radius: 10px; cursor: pointer;
    border: 1.5px solid var(--mud-palette-lines-inputs); background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); font-weight: 600;
    transition: border-color .15s ease, background-color .15s ease; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice .check { margin-left: auto; color: var(--mud-palette-primary); opacity: 0; transition: opacity .15s ease; }
.choice:hover { border-color: var(--mud-palette-primary); }
.choice:has(input:checked) { border-color: var(--mud-palette-primary); background: rgba(32, 78, 172, .08); color: var(--mud-palette-primary); }
.choice:has(input:checked) .check { opacity: 1; }
.choice:has(input:focus-visible) { outline: 3px solid #FF4D05; outline-offset: 2px; }
.choice:has(input[aria-invalid="true"]) { border-color: var(--mud-palette-error); }
.choice-note { margin-top: 4px; font-size: .8125rem; color: var(--mud-palette-text-secondary); }
.choice-error { color: var(--mud-palette-error); }
@media (prefers-reduced-motion: reduce) { .choice, .choice .check { transition: none; } }

.choice:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.choice:has(input:disabled) input { pointer-events: none; } /* so hovering the card shows its tooltip */
.choice-tooltip { display: block; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* FormRenderer: a registration form's sections and fields */
.form-section + .form-section { margin-top: 24px; }
.form-section-title { margin-bottom: 4px; }
.form-section-description { margin: 0 0 12px; color: var(--mud-palette-text-secondary); white-space: pre-line; }
/* Fields sit side by side by their width, on a 6-column grid; when the form itself is narrow (a phone, a phone preview), each takes the row. */
.form-section { container-type: inline-size; }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
.form-field { grid-column: span 6; margin-bottom: 16px; min-width: 0; }
.form-field.w-two-thirds { grid-column: span 4; }
.form-field.w-half { grid-column: span 3; }
.form-field.w-third { grid-column: span 2; }
@container (max-width: 560px) {
    .form-field.w-two-thirds, .form-field.w-half, .form-field.w-third { grid-column: span 6; }
}
.form-heading { font-weight: 700; margin-top: 8px; }
.form-paragraph { margin: 0; white-space: pre-line; }
.form-choices { border: 0; margin: 0; padding: 0; }
.form-choices legend { padding: 0; font-weight: 600; }
.form-waiver-text { max-height: 16rem; overflow-y: auto; white-space: pre-line; margin: 6px 0 2px; padding: 10px 12px; border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; font-size: .875rem; }
.form-help { margin: 2px 0 4px; font-size: .875rem; color: var(--mud-palette-text-secondary); }
.form-error { margin: 4px 0 0; font-size: .75rem; color: var(--mud-palette-error); }
.form-built-in { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--mud-palette-lines-default); border-radius: 8px; color: var(--mud-palette-text-secondary); }
