/* Boutons, champs, étiquettes, messages */

code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 0.08em 0.38em;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--text-2);
}

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

.muted {
    color: var(--muted);
}

.flashes {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.flash {
    margin: 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 0.94rem;
}

.flash-error {
    border-color: color-mix(in srgb, var(--peak) 45%, transparent);
    background: color-mix(in srgb, var(--peak) 9%, transparent);
}

.tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface-3);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.tag-peak {
    color: var(--peak);
    border-color: color-mix(in srgb, var(--peak) 40%, transparent);
    background: color-mix(in srgb, var(--peak) 10%, transparent);
}

.tag-warn {
    color: var(--hp);
    border-color: color-mix(in srgb, var(--hp) 40%, transparent);
    background: color-mix(in srgb, var(--hp) 10%, transparent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 650;
    color: #fff;
    background: var(--grad);
    box-shadow: 0 8px 22px -8px rgba(224, 58, 210, 0.55);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
}

.btn:hover {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    color: var(--text);
    background: var(--surface-3);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--line-strong);
}

.btn-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text-2);
    font: inherit;
    font-size: 1.2rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn-icon:hover {
    color: var(--peak);
    border-color: color-mix(in srgb, var(--peak) 45%, transparent);
    background: color-mix(in srgb, var(--peak) 10%, transparent);
}

.form {
    display: grid;
    gap: 14px;
}

.form.narrow {
    max-width: 420px;
}

.inline-form {
    grid-template-columns: minmax(0, 340px) auto;
    align-items: end;
    justify-content: start;
}

.grid-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.field.wide {
    grid-column: 1 / -1;
}

.grid-fields.grid-3 {
    grid-template-columns: 1.4fr 1fr 1fr;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.field.short {
    max-width: 260px;
}

.field {
    display: grid;
    gap: 6px;
}

.field > span {
    font-size: 0.84rem;
    color: var(--text-2);
}

select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="datetime-local"],
input[type="search"],
input[type="number"],
input[type="date"],
textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--field-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    color-scheme: dark;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

textarea {
    font-family: var(--mono);
    font-size: 0.86rem;
    resize: vertical;
    line-height: 1.55;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 30%, transparent);
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    cursor: pointer;
}

.check input {
    width: 18px;
    height: 18px;
    accent-color: var(--violet);
}

.fieldset {
    margin: 0;
    padding: 12px 14px;
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.fieldset legend {
    padding: 0 6px;
    font-size: 0.84rem;
    color: var(--text-2);
}

.hint {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
}

html[data-motion="reduce"] .btn:hover {
    transform: none;
}

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

.form-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}

.subsection .hint {
    margin: 0;
}

@media (max-width: 720px) {
    .grid-fields,
    .grid-fields.grid-3 {
        grid-template-columns: 1fr;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }
}
