/**
 * Newsletter Form Styles
 *
 * Styles for the [formulaire_infolettre] shortcode.
 *
 * @package JMV_Child
 */

.jmv-newsletter-wrapper {
    width: 100%;
    max-width: 400px;
}

.jmv-newsletter-form {
    width: 100%;
}

.jmv-newsletter-fields {
    display: flex;
    gap: 0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.jmv-newsletter-input-wrapper {
    flex: 1;
}

.jmv-newsletter-email {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #fff;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    height: 48px;
}

.jmv-newsletter-email:focus {
    outline: none;
    border-color: #142EA8;
    box-shadow: 0 0 0 3px rgba(20, 46, 168, 0.15);
}

.jmv-newsletter-email::placeholder {
    color: #888;
}

.jmv-newsletter-email.error {
    border-color: #dc3545;
}

.jmv-newsletter-button-wrapper {
    flex-shrink: 0;
}

.jmv-newsletter-submit {
    padding: 12px 20px;
    background: #142EA8;
    border: 2px solid #142EA8;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    min-width: 56px;
}

.jmv-newsletter-submit:hover {
    background: #0d1f7a;
    border-color: #0d1f7a;
}

.jmv-newsletter-submit:active {
    transform: scale(0.98);
}

.jmv-newsletter-submit:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

.jmv-newsletter-submit-icon svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.jmv-newsletter-loading {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: jmv-spin 0.8s linear infinite;
}

.jmv-newsletter-submit.loading .jmv-newsletter-submit-icon {
    display: none;
}

.jmv-newsletter-submit.loading .jmv-newsletter-loading {
    display: block;
}

@keyframes jmv-spin {
    to { transform: rotate(360deg); }
}

.jmv-newsletter-message {
    margin-top: 12px;
    padding: 0;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.jmv-newsletter-message:empty {
    display: none;
}

.jmv-newsletter-message.success {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.5);
    border-radius: 6px;
    font-weight: 500;
}

.jmv-newsletter-message.error {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 6px;
    font-weight: 500;
}

.jmv-newsletter-form.submitted .jmv-newsletter-fields {
    display: none;
}

@media screen and (max-width: 480px) {
    .jmv-newsletter-fields {
        flex-direction: column;
    }

    .jmv-newsletter-email {
        border-right: 2px solid #fff;
        border-bottom: none;
        border-radius: 4px 4px 0 0;
    }

    .jmv-newsletter-submit {
        border-radius: 0 0 4px 4px;
        width: 100%;
    }
}
