﻿/* Minimalist inputs with a navy focus ring. */
.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

/* A field that sits in a grid/flex row and shouldn't add its own bottom gap (the row's gap spaces it). */
.field--tight { margin-bottom: 0; }

/* A compact horizontal form: fields sit on the baseline of their inputs and wrap on narrow screens.
   Shared across the race/loft/club pages that had this exact flex row inline. */
.inline-form {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form--center { justify-content: center; }

/* A checkbox + its label on one line. */
.check-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* A scrollable, responsive grid of tickable checkboxes (e.g. "add these members / birds"). */
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: var(--space-xs) var(--space-sm);
    max-height: 16.25rem;
    overflow-y: auto;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}

.field__label {
    font: var(--text-label-md);
    letter-spacing: var(--letter-spacing-label);
    text-transform: uppercase;
    color: var(--on-surface-variant);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius);
    font: var(--text-body-md);
    background: var(--surface-container-lowest);
    color: var(--on-surface);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary-container);
    box-shadow: 0 0 0 2px var(--surface-container-lowest), 0 0 0 4px var(--primary-container);
}

.form-error {
    background: var(--error-container);
    color: var(--on-error-container);
    border-radius: var(--radius);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-body-sm-size);
    margin-bottom: var(--space-md);
}

.form-success {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
    border-radius: var(--radius);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-body-sm-size);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

/* Transient confirmations fade out gently after a moment (see autoDismiss.js). The max-height/margin
   collapse keeps the layout from jumping once the banner is fully faded. Respects reduced-motion. */
.is-dismissing {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    transition: opacity 500ms ease, max-height 500ms ease 200ms,
                margin 500ms ease 200ms, padding 500ms ease 200ms;
}

@media (prefers-reduced-motion: reduce) {
    .is-dismissing { transition: none; }
}

.field__error {
    color: var(--on-error-container);
    font-size: var(--text-label-md-size);
}

.field__error:empty { display: none; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
}

.filter-bar .field { margin-bottom: 0; min-width: 180px; }

/* Split-name fields (first / middle name rows / last). See EditorTemplates/PersonNameInput.cshtml. */
.name-fields__optional {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    color: var(--on-surface-variant);
    opacity: 0.75;
}

.name-fields__middles {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.name-fields__middle {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.name-fields__middle .input { flex: 1 1 auto; }

.name-fields__remove {
    flex: 0 0 auto;
    padding: 6px;
    line-height: 0;
}

.name-fields__add {
    align-self: flex-start;
    margin-top: var(--space-xs);
}

.name-fields__add .material-symbols-outlined,
.name-fields__remove .material-symbols-outlined { font-size: 18px; }

/* Liberation-point picker (ADR-0033 rule 7): the select and, for a new point, the typed box beneath it. */
.race-point-picker { display: flex; flex-direction: column; gap: var(--space-xs); }
.race-point-picker [hidden] { display: none; }
