/* =========================
   MODAL BASE
========================= */

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}
/* =========================
   MODAL CARD (APPLE STYLE)
========================= */

.modal-content {
    background: #fff;
    max-width: 500px;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    position: relative;
}

/* =========================
   TITLE
========================= */

.modal-content h2 {
    margin: 0 0 18px;
    font-size: 30px;
    font-weight: 600;
    color: #111;
}

.modal-content h3 {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 600;
    color: #111;
}

/* =========================
   FORM
========================= */

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 14px 16px;

    border: 1px solid #e5e5e5;
    border-radius: 14px;

    font-size: 15px;
    outline: none;

    transition: 0.2s;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 4px rgba(0,113,227,0.15);
}

/* =========================
   BUTTON
========================= */

.modal-content button {
    padding: 14px 16px;

    border: none;
    border-radius: 14px;

    background: #0071e3;
    color: #fff;

    font-size: 15px;
    cursor: pointer;

    transition: 0.2s;
}

.modal-content button:hover {
    background: #005fc5;
}

/* =========================
   CLOSE BUTTON
========================= */

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* =========================
   SUCCESS MESSAGE
========================= */

.modal .success-message {
    width: 100%;
    margin-top: 12px;

    padding: 12px 16px;

    background: #e9f9ee;
    color: #1a7f37;

    border: 1px solid #b7ebc6;
    border-radius: 12px;

    font-size: 14px;

    text-align: center;
}

/* =========================
   ANIMATION
========================= */

@keyframes modalFade {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .modal-content {
        max-width: 92%;
        padding: 28px 20px;
        border-radius: 18px;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .close {
        font-size: 32px;
        right: 12px;
        top: 8px;
    }
}


#formMessage {
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}

#formMessage.success {
    color: #1a7f37;
    background: #e9f9ee;
    border: 1px solid #b7ebc6;
    padding: 10px;
    border-radius: 12px;
}

#formMessage.error {
    color: #b42318;
    background: #ffe9e9;
    border: 1px solid #ffb3b3;
    padding: 10px;
    border-radius: 12px;
}

.msg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font-size: 14px;
    color: #555;
}

.msg-spinner {
    width: 16px;
    height: 16px;

    border: 2px solid #ddd;
    border-top-color: #0071e3;
    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}