/* MALCCO - AJAX form states (loader, success, errors). Used with assets/js/forms.js */

form[data-ajax-form] { position: relative; }

/* honeypot - kept off-screen, never display:none (bots skip those) */
.mf-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ---- loader overlay shown while the form is being submitted ---- */
.mf-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255, 255, 255, .88);
    border-radius: 10px;
    text-align: center;
    padding: 20px;
    animation: mf-fade .2s ease;
}
.mf-overlay__text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #03205A;
}
.mf-overlay__bar {
    width: min(260px, 70%);
    height: 6px;
    border-radius: 3px;
    background: #E3E8EF;
    overflow: hidden;
    display: none;
}
.mf-overlay__bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: #FF5E14;
    transition: width .15s linear;
}

.mf-spinner,
.mf-btn-spinner {
    display: inline-block;
    border-radius: 50%;
    border: 3px solid rgba(3, 32, 90, .15);
    border-top-color: #FF5E14;
    animation: mf-spin .8s linear infinite;
}
.mf-spinner { width: 46px; height: 46px; }
.mf-btn-spinner {
    width: 16px; height: 16px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, .45);
    border-top-color: #fff;
    margin-right: 10px;
    vertical-align: -3px;
}

form[data-ajax-form] button[type="submit"].is-loading {
    pointer-events: none;
    opacity: .85;
}
form[data-ajax-form] button[type="submit"].is-loading .btn-icon { display: none; }

@keyframes mf-spin { to { transform: rotate(360deg); } }
@keyframes mf-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .mf-spinner, .mf-btn-spinner { animation-duration: 2s; }
}

/* ---- error state ---- */
.mf-alert {
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid #F1B8B2;
    background: #FDF1EF;
    color: #8F2A1F;
}
.mf-alert ul { margin: 8px 0 0; padding-left: 18px; }
.mf-invalid {
    border-color: #D64533 !important;
    box-shadow: 0 0 0 3px rgba(214, 69, 51, .12);
}
.mf-field-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #B63322;
}

/* ---- file pickers ---- */
.upload-btn .mf-file-name {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #03205A;
    word-break: break-all;
}
.upload-btn.has-file { border-style: solid !important; border-color: #03205A !important; background: #F4F7FB; }

/* ---- success card ---- */
.mf-success {
    max-width: 820px;
    text-align: center;
    padding: 46px 30px 40px;
    border: 1px solid #E3E8EF;
    border-top: 4px solid #FF5E14;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(3, 32, 90, .07);
    animation: mf-fade .35s ease;
}
.mf-success__icon {
    width: 72px; height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #E8F6EE;
    display: flex; align-items: center; justify-content: center;
}
.mf-success__icon svg { width: 36px; height: 36px; }
.mf-success h3 { margin: 0 0 10px; color: #03205A; }
.mf-success p { margin: 0 auto 8px; max-width: 560px; }
.mf-success__ref {
    display: inline-block;
    margin: 14px 0 6px;
    padding: 8px 18px;
    border-radius: 6px;
    background: #F4F7FB;
    border: 1px dashed #9FB0C7;
    font-weight: 700;
    letter-spacing: .5px;
    color: #03205A;
}
.mf-success__again {
    margin-top: 18px;
    background: none;
    border: 0;
    color: #FF5E14;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}
