/* =============================================================================
   Form Modal
   ============================================================================= */

.form-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.form-modal[hidden] {
    display: none;
}

/* Backdrop */
.form-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 10, 26, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Dialog card */
.form-modal__dialog {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 3rem 2.5rem 2.5rem;
    width: 100%;
    max-width: 28rem;
    text-align: center;
    box-shadow: 0 25px 60px rgba(15, 10, 26, 0.25);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button */
.form-modal__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #94a3b8;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.form-modal__close:hover,
.form-modal__close:focus-visible {
    background: #f1f5f9;
    color: #1e293b;
    outline: none;
}

.form-modal__close svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Icon */
.form-modal__icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-modal__icon svg {
    width: 100%;
    height: 100%;
}

/* Title */
.form-modal__title {
    font-size: 1.375rem;
    font-weight: 800;
    color: #0f0a1a;
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

/* Message */
.form-modal__message {
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 2rem;
}

/* CTA button */
.form-modal__btn {
    min-width: 10rem;
}

/* Error state — title turns red */
.form-modal--error .form-modal__title {
    color: #dc2626;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* =============================================================================
   Form field validation errors (shared across all forms)
   ============================================================================= */

.form-field--error,
input.form-field--error,
textarea.form-field--error,
select.form-field--error {
    border-color: #ef4444 !important;
    outline: none;
}

.form-field__error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #ef4444;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 480px) {
    .form-modal__dialog {
        padding: 2.5rem 1.5rem 2rem;
        border-radius: 1rem;
    }
}
