/**
 * Styles pour le formulaire de newsletter Listmonk
 */

/* Container principal */
.listmonk-newsletter-widget,
.listmonk-newsletter-shortcode {
    margin: 20px 0;
}

/* Formulaire */
.listmonk-newsletter-form {
    max-width: 100%;
}

/* Champs */
.listmonk-field {
    margin-bottom: 15px;
}

.listmonk-field input[type="text"],
.listmonk-field input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.listmonk-field input[type="text"]:focus,
.listmonk-field input[type="email"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.listmonk-field input.error {
    border-color: #dc3545;
}

.listmonk-field input.valid {
    border-color: #28a745;
}

/* Bouton submit */
.listmonk-submit {
    width: 100%;
    padding: 12px 20px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.listmonk-submit:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.listmonk-submit:active {
    transform: translateY(0);
}

.listmonk-submit:disabled,
.listmonk-submit.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation de chargement */
.listmonk-submit.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: listmonk-spin 0.8s linear infinite;
}

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

/* Messages */
.listmonk-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.listmonk-message.show {
    display: block;
    animation: listmonk-fadeIn 0.3s;
}

.listmonk-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.listmonk-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes listmonk-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Listes de choix */
.listmonk-lists {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.listmonk-lists label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 5px;
    border-radius: 3px;
}

.listmonk-lists label:hover {
    background-color: #e9ecef;
}

.listmonk-lists input[type="checkbox"] {
    margin-right: 8px;
}

/* Privacy checkbox */
.listmonk-privacy {
    margin: 15px 0;
}

.listmonk-privacy label {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.listmonk-privacy input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    flex-shrink: 0;
}

.listmonk-privacy small {
    line-height: 1.4;
}

/* Styles spécifiques pour différents designs */

/* Style minimal */
.listmonk-style-minimal .listmonk-field input {
    border: none;
    border-bottom: 2px solid #ddd;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
}

.listmonk-style-minimal .listmonk-field input:focus {
    border-bottom-color: #007cba;
    box-shadow: none;
}

.listmonk-style-minimal .listmonk-submit {
    background-color: transparent;
    color: #007cba;
    border: 2px solid #007cba;
}

.listmonk-style-minimal .listmonk-submit:hover {
    background-color: #007cba;
    color: white;
}

/* Style arrondi */
.listmonk-style-rounded .listmonk-field input,
.listmonk-style-rounded .listmonk-submit {
    border-radius: 25px;
    padding-left: 20px;
    padding-right: 20px;
}

/* Style inline */
.listmonk-style-inline .listmonk-newsletter-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.listmonk-style-inline .listmonk-field {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.listmonk-style-inline .listmonk-field:last-of-type {
    flex: 0 0 auto;
}

.listmonk-style-inline .listmonk-submit {
    width: auto;
    white-space: nowrap;
}

.listmonk-style-inline .listmonk-message {
    width: 100%;
    margin-top: 10px;
}

.listmonk-style-inline .listmonk-privacy {
    width: 100%;
    margin-top: 10px;
}

/* Style dark */
.listmonk-style-dark {
    background-color: #2c3e50;
    padding: 25px;
    border-radius: 8px;
}

.listmonk-style-dark .listmonk-field input {
    background-color: #34495e;
    border-color: #34495e;
    color: white;
}

.listmonk-style-dark .listmonk-field input::placeholder {
    color: #95a5a6;
}

.listmonk-style-dark .listmonk-field input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 1px #3498db;
}

.listmonk-style-dark .listmonk-submit {
    background-color: #3498db;
    border: none;
}

.listmonk-style-dark .listmonk-submit:hover {
    background-color: #2980b9;
}

.listmonk-style-dark .listmonk-privacy label {
    color: #ecf0f1;
}

/* Responsive */
@media (max-width: 480px) {
    .listmonk-style-inline .listmonk-newsletter-form {
        flex-direction: column;
    }
    
    .listmonk-style-inline .listmonk-field {
        width: 100%;
        min-width: 100%;
        margin-bottom: 10px;
    }
    
    .listmonk-style-inline .listmonk-submit {
        width: 100%;
    }
}

/* Widget WordPress sidebar */
.widget .listmonk-newsletter-widget .listmonk-field input {
    width: 100%;
}

.widget .listmonk-newsletter-widget .listmonk-submit {
    width: 100%;
}

/* Animations supplémentaires */
.listmonk-shake {
    animation: listmonk-shake 0.5s;
}

@keyframes listmonk-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Accessibilité */
.listmonk-field input:focus-visible,
.listmonk-submit:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Lien de désinscription */
.listmonk-unsubscribe-link {
    color: #666;
    text-decoration: underline;
    font-size: 12px;
}

.listmonk-unsubscribe-link:hover {
    color: #333;
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
    .listmonk-newsletter-widget,
    .listmonk-newsletter-shortcode {
        color: #e0e0e0;
    }
    
    .listmonk-field input {
        background-color: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .listmonk-field input::placeholder {
        color: #999;
    }
    
    .listmonk-lists {
        background-color: #2a2a2a;
        border-color: #444;
    }
}
