/* Shared form footer: actions share a row; security and validation stay below it. */
.form-actions {
    position: relative;
    width: 100%;
    min-width: 0;
    margin-block-start: 24px;
}

.form-action-buttons {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
}

/* Override legacy submit-only margins and record-link spacing consistently. */
.form-actions .form-action-buttons > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    text-align: center;
}

.form-actions .form-action-buttons > .btn .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.form-actions-wide .form-action-buttons > .btn {
    flex: 1;
}

.form-actions > .form-security {
    justify-content: flex-start;
    gap: 8px;
    margin: 12px 0 0;
    line-height: 1.6;
    text-align: left;
}

.form-actions-wide > .form-security {
    justify-content: center;
    text-align: center;
}

.form-actions > .form-client-error {
    margin: 12px 0 0;
}

.form-progress:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 0;
    color: #80e9dd;
    font-size: 13px;
    line-height: 1.6;
}
.form-progress::before {
    content: "";
    flex: 0 0 16px;
    height: 16px;
    border: 2px solid #80e9dd40;
    border-top-color: #80e9dd;
    border-radius: 50%;
    animation: form-progress-spin .8s linear infinite;
}
.form-client-error:not([hidden]) {
    padding: 12px 14px;
    border: 1px solid #ffa7ae60;
    border-radius: 10px;
    background: #381e2a;
    color: #ffd2d6;
    line-height: 1.6;
    scroll-margin-block: 100px;
}
.form-client-error:focus-visible { outline: 2px solid #ffa7ae; outline-offset: 3px; }
form[aria-busy="true"] button[type="submit"] { cursor: wait; opacity: .7; }
@keyframes form-progress-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .form-progress::before { animation: none; } }

/* Edit, Cancel and Delete controls in record headers also share one baseline. */
.record-toolbar .record-actions > .btn {
    min-height: 40px;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .form-action-buttons > .btn {
        flex: 1 1 auto;
    }
}
