/**
 * Estilos para Formulario de Suscripción/Newsletter
 * Diseño limpio sin fondo - Se adapta a cualquier diseño
 * 
 * IMPORTANTE: Estos estilos sobrescriben los estilos globales de Bricks Builder
 */

/* ============================================================================
   OVERRIDE DE BRICKS BUILDER - DEBE IR PRIMERO
   ============================================================================ */

/* Sobrescribir estilos globales de Bricks que afectan a los inputs */
.motai-newsletter-form-wrapper .input,
.motai-newsletter-form-wrapper input:not([type=submit]),
#motai-newsletter-form .input,
#motai-newsletter-form input:not([type=submit]) {
    line-height: 1.5 !important;
    padding: 6px 16px !important;
    height: auto !important;
    min-height: auto !important;
}

/* ============================================================================
   CONTENEDOR PRINCIPAL
   ============================================================================ */

.motai-newsletter-form-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
}

.motai-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================================================
   CAMPOS DE FORMULARIO
   ============================================================================ */

.motai-newsletter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.motai-newsletter-field label {
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    margin: 0;
}

/* Selector de alta especificidad para sobrescribir Bricks Builder */
.motai-newsletter-form-wrapper .motai-newsletter-field input,
.motai-newsletter-form-wrapper .motai-newsletter-field .input,
.motai-newsletter-form-wrapper input[type="text"],
.motai-newsletter-form-wrapper input[type="email"],
.motai-newsletter-form-wrapper input[type="tel"],
#motai-newsletter-form .motai-newsletter-field input,
#motai-newsletter-form .motai-newsletter-field .input,
#motai-newsletter-form input[type="text"],
#motai-newsletter-form input[type="email"],
#motai-newsletter-form input[type="tel"],
#motai-newsletter-form input:not([type=submit]) {
    width: 100% !important;
    padding: 6px 16px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    background-color: #FFFFFF !important;
    color: #2D3748 !important;
    transition: border-color 0.3s ease !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    /* Forzar altura específica: 1.5em (línea de texto) + 12px (padding vertical 6px*2) */
    height: calc(1em * 1.5 + 12px) !important;
    /* Evitar que line-height afecte la altura */
    display: inline-block !important;
    vertical-align: middle !important;
}

.motai-newsletter-form-wrapper .motai-newsletter-field input::placeholder,
#motai-newsletter-form input::placeholder {
    color: #A0AEC0 !important;
}

.motai-newsletter-form-wrapper .motai-newsletter-field input:focus,
#motai-newsletter-form input:focus {
    outline: none !important;
    border-color: #00D4D4 !important;
    /* Mantener altura en focus */
    height: calc(1.5em + 12px) !important;
    padding: 6px 16px !important;
}

/* Estados de validación - Alta especificidad */
.motai-newsletter-form-wrapper .motai-newsletter-field.field-error input,
#motai-newsletter-form .field-error input {
    border-color: #F56565 !important;
    background-color: #FFF5F5 !important;
    padding: 6px 16px !important;
    height: calc(1.5em + 12px) !important;
    line-height: 1.5 !important;
}

.motai-newsletter-form-wrapper .motai-newsletter-field.field-valid input,
#motai-newsletter-form .field-valid input {
    border-color: #48BB78 !important;
    background-color: #F0FFF4 !important;
    padding: 6px 16px !important;
    height: calc(1.5em + 12px) !important;
    line-height: 1.5 !important;
}

.motai-newsletter-field .invalid-feedback {
    display: none;
    font-size: 13px;
    color: #F56565;
    margin-top: 4px;
}

.motai-newsletter-field.field-error .invalid-feedback {
    display: block;
}

/* ============================================================================
   reCAPTCHA v3
   ============================================================================ */

/* reCAPTCHA v3 es invisible, no necesita estilos visuales */
.motai-newsletter-recaptcha {
    display: none;
}

/* ============================================================================
   TÉRMINOS Y CONDICIONES
   ============================================================================ */

.motai-newsletter-legal {
    font-size: 12px;
    line-height: 1.6;
    color: inherit;
    opacity: 0.8;
    text-align: center;
    margin-top: 4px;
}

.motai-newsletter-legal a {
    color: inherit;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.motai-newsletter-legal a:hover {
    opacity: 0.8;
}

/* ============================================================================
   MENSAJES DE RESPUESTA
   ============================================================================ */

.motai-newsletter-message {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    margin-top: 10px;
}

.motai-newsletter-message.success {
    background-color: #C6F6D5;
    color: #22543D;
    border: 1px solid #9AE6B4;
}

.motai-newsletter-message.error {
    background-color: #FED7D7;
    color: #742A2A;
    border: 1px solid #FC8181;
}

.motai-newsletter-message.info {
    background-color: #BEE3F8;
    color: #2C5282;
    border: 1px solid #90CDF4;
}

/* Iconos en mensajes */
.motai-newsletter-message::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.motai-newsletter-message.success::before {
    content: '✓';
    font-weight: bold;
    color: #22543D;
}

.motai-newsletter-message.error::before {
    content: '✕';
    font-weight: bold;
    color: #742A2A;
}

.motai-newsletter-message.info::before {
    content: 'ℹ';
    font-weight: bold;
    color: #2C5282;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 600px) {
    .motai-newsletter-form-wrapper .motai-newsletter-field input,
    .motai-newsletter-form-wrapper input[type="text"],
    .motai-newsletter-form-wrapper input[type="email"],
    .motai-newsletter-form-wrapper input[type="tel"],
    #motai-newsletter-form input[type="text"],
    #motai-newsletter-form input[type="email"],
    #motai-newsletter-form input[type="tel"] {
        padding: 6px 16px !important;
        font-size: 15px !important;
        height: calc(1.5em + 12px) !important;
        line-height: 1.5 !important;
    }

    .motai-newsletter-legal {
        font-size: 11px;
    }
}
