/* --- Captcha Modal Styling --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--apple-card-background, rgba(255, 255, 255, 0.8));
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}


.modal-content h2 {
    margin-top: 0;
    font-size: 22px;
    font-weight: 500;
}

.modal-content p {
    color: var(--apple-text-secondary, #6e6e73);
    margin-bottom: 20px;
}

.captcha-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

#captchaImage {
    border: 1px solid var(--apple-medium-gray, #e5e5ea);
    border-radius: 8px;
    cursor: pointer;
    width: 200px;
    height: 70px;
}

#refreshCaptcha {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    background-color: #e9e9ed;
    color: var(--apple-text-primary, #1d1d1f);
    transition: background-color 0.2s ease;
}
#refreshCaptcha:hover {
    background-color: #dcdce1;
}

#captchaInput {
    width: calc(100% - 24px);
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid var(--apple-medium-gray, #e5e5ea);
    text-align: center;
    margin-bottom: 10px;
}
#captchaInput:focus {
    outline: none;
    border-color: var(--apple-blue, #007aff);
}


.error-message {
    color: var(--apple-red, #ff3b30);
    font-size: 14px;
    height: 20px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

#captchaModal .modal-actions button {
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    min-width: 100px;
    transition: background-color 0.2s ease;
}

#submitCaptcha {
    background-color: var(--apple-blue, #007aff);
    color: white;
}
#submitCaptcha:hover {
    background-color: #0056b3;
}

#closeModal {
    background-color: #e5e5ea;
    color: var(--apple-text-primary, #1d1d1f);
}
#closeModal:hover {
    background-color: #d1d1d6;
}
