/**

 * Estilos para el frontend del Email Collector

 */



/* Contenedor principal del formulario */

.email-collector-form-wrapper {

    margin: 20px 0;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

}



/* Formulario */



/* Título del formulario */

.ec-form-title {

    margin: 0 0 20px 0;

    font-size: 22px;

    font-weight: 600;

    color: #333;

    text-align: center;

}



/* Grupos de campos */

.ec-field-group {

    margin-bottom: 15px;

}



/* Etiquetas */

.ec-label {

    display: block;

    margin-bottom: 5px;

    font-weight: 500;

    color: #555;

    font-size: 14px;

}



/* Asterisco requerido */

.ec-required {

    color: #d63638;

}



/* Inputs */

.ec-input {

    width: 100%;

    padding: 12px 15px;

    border: 2px solid #ddd;

    border-radius: 6px;

    font-size: 16px;

    transition: border-color 0.3s ease, box-shadow 0.3s ease;

    box-sizing: border-box;

}



.ec-input:focus {

    outline: none;

    border-color: #0073aa;

    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);

}



.ec-input::placeholder {

    color: #888;

}



/* Campo GDPR */

.ec-gdpr-field {

    margin: 20px 0;

}



.ec-checkbox-label {

    display: flex;

    align-items: flex-start;

    cursor: pointer;

    font-size: 14px;

    line-height: 1.4;

}



.ec-checkbox {

    margin-right: 10px;

    margin-top: 2px;

    flex-shrink: 0;

}



.ec-checkbox-text {

    color: #555;

}



/* Acciones del formulario */

.ec-form-actions {

    margin-top: 20px;

    text-align: center;

}



/* Botón de envío */

.ec-submit-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 12px 30px;

    background: #0073aa;

    color: #fff;

    border: none;

    border-radius: 6px;

    font-size: 16px;

    font-weight: 500;

    cursor: pointer;

    transition: background-color 0.3s ease, transform 0.2s ease;

    min-width: 140px;

    min-height: 48px;

}



.ec-submit-button:hover {

    background: #005a87;

    transform: translateY(-1px);

}



.ec-submit-button:active {

    transform: translateY(0);

}



.ec-submit-button:disabled {

    background: #ccc;

    cursor: not-allowed;

    transform: none;

}



/* Spinner de carga */

.ec-loading-spinner {

    display: none;

}



.ec-loading-spinner svg {

    animation: ec-spin 1s linear infinite;

}



@keyframes ec-spin {

    from { transform: rotate(0deg); }

    to { transform: rotate(360deg); }

}



/* Mensajes */

.ec-messages {

    margin-top: 15px;

}



.ec-success-message,

.ec-error-message {

    padding: 12px 15px;

    border-radius: 6px;

    font-size: 14px;

    font-weight: 500;

}


.ec-error-message {

    background: #f8d7da;

    color: #721c24;

    border: 1px solid #f5c2c7;

}



/* reCAPTCHA */

.ec-recaptcha-field {

    margin: 20px 0;

    text-align: center;

}



/* Estilos por tipo de formulario */



/* Estilo minimal */

.email-collector-form-wrapper[data-style="minimal"] .email-collector-form {

    border: none;

    box-shadow: none;

    padding: 15px;

    background: transparent;

}



.email-collector-form-wrapper[data-style="minimal"] .ec-form-title {

    font-size: 18px;

    margin-bottom: 15px;

}



.email-collector-form-wrapper[data-style="minimal"] .ec-input {

    border: 2px solid #ddd;

    border-radius: 4px;

    padding: 10px 12px;

}



.email-collector-form-wrapper[data-style="minimal"] .ec-submit-button {

    padding: 10px 25px;

    font-size: 14px;

}



/* Estilo widget */

.email-collector-widget {

    background: #f9f9f9;

    border: 1px solid #e1e1e1;

    border-radius: 8px;

    padding: 20px;

}



.ec-widget-header {

    margin-bottom: 15px;

}



.ec-widget-title {

    margin: 0 0 8px 0;

    font-size: 18px;

    font-weight: 600;

    color: #333;

}



.ec-widget-description {

    margin: 0;

    font-size: 14px;

    color: #666;

    line-height: 1.4;

}



.ec-widget-form .email-collector-form {

    border: none;

    box-shadow: none;

    padding: 0;

    background: transparent;

}



/* Responsive */

@media (max-width: 768px) {

    

    .ec-form-title {

        font-size: 20px;

    }

    

    .ec-input {

        font-size: 16px; /* Evita zoom en iOS */

        padding: 12px;

    }

    

    .ec-submit-button {

        width: 100%;

        padding: 14px;

        font-size: 16px;

    }

    

    .ec-checkbox-label {

        font-size: 13px;

    }

}



@media (max-width: 480px) {

    .email-collector-form-wrapper {

        margin: 10px 0;

    }



    

    .ec-form-title {

        font-size: 18px;

        margin-bottom: 15px;

    }

    

    .ec-input {

        padding: 10px;

        font-size: 16px;

    }

    

    .ec-submit-button {

        padding: 12px;

        font-size: 15px;

    }

}



/* Animaciones */

@keyframes ec-fadeIn {

    from { opacity: 0; transform: translateY(10px); }

    to { opacity: 1; transform: translateY(0); }

}



.ec-success-message,

.ec-error-message {

    animation: ec-fadeIn 0.3s ease;

}



/* Accesibilidad */

.ec-input:focus,

.ec-submit-button:focus,

.ec-checkbox:focus {

    outline: 2px solid #0073aa;

    outline-offset: 2px;

}



/* Estados de validación */

.ec-input:invalid {

    border-color: #d63638;

}



.ec-input:valid {

    border-color: #00a32a;

}



/* Modo oscuro */

@media (prefers-color-scheme: dark) {



    .ec-form-title {

        color: #fff;

    }

    

    .ec-label {

        color: #ddd;

    }

    

    .ec-input {

        background: #2a2a2a;

        border-color: #555;

        color: #fff;

    }

    

    .ec-input::placeholder {

        color: #aaa;

    }

    

    .ec-checkbox-text {

        color: #ddd;

    }

    

    .email-collector-widget {

        background: #1a1a1a;

        border-color: #444;

    }

    

    .ec-widget-title {

        color: #fff;

    }

    

    .ec-widget-description {

        color: #ccc;

    }

}

