/**
 * Estilos públicos do Lead Capture Plugin
 * Estilos para o formulário de captura de leads no front-end
 */

/* Reset e base */
.lead-capture-wrapper * {
    box-sizing: border-box;
}

.lead-capture-wrapper {
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
}

/* Header do formulário */
.lead-form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.lead-form-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Mensagens de status */
.lead-form-messages {
    margin: 0;
}

.lead-message {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    border-left: 4px solid;
    margin: 0;
}

.lead-message.lead-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.lead-message.lead-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.lead-message-icon {
    font-weight: bold;
    font-size: 18px;
}

.lead-message-text {
    flex: 1;
}

/* Formulário */
.lead-capture-form {
    padding: 30px;
}

.lead-form-fields {
    margin-bottom: 25px;
}

/* Grupos de campos */
.lead-field-group {
    margin-bottom: 20px;
    position: relative;
}

.lead-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

/* Inputs */
.lead-field-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.4;
    background-color: #fff;
    transition: all 0.3s ease;
    outline: none;
}

.lead-field-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.lead-field-input:hover {
    border-color: #c3c8d1;
}

.lead-field-input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.lead-field-input::placeholder {
    color: #a0a6b0;
}

/* Mensagens de erro dos campos */
.lead-field-error {
    display: block;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    min-height: 16px;
    font-weight: 500;
}

/* Campo honeypot (anti-spam) */
.lead-honeypot {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Seção de privacidade */
.lead-privacy-section {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.lead-privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    line-height: 1.5;
}

.lead-privacy-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    background-color: #fff;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-top: 2px;
}

.checkmark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lead-privacy-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.lead-privacy-checkbox input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.privacy-text {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.privacy-text a {
    color: #667eea;
    text-decoration: none;
}

.privacy-text a:hover {
    text-decoration: underline;
}

/* Botão de envio */
.lead-form-submit {
    text-align: center;
}

.lead-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 140px;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lead-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.lead-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.lead-submit-btn.loading {
    pointer-events: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Informações de segurança */
.lead-security-info {
    text-align: center;
    padding: 20px 30px 25px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.security-text {
    color: #6c757d;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.security-icon {
    font-size: 14px;
}

/* Responsividade */
@media (max-width: 768px) {
    .lead-capture-wrapper {
        margin: 0 15px;
        border-radius: 12px;
    }
    
    .lead-form-header {
        padding: 20px;
    }
    
    .lead-form-title {
        font-size: 20px;
    }
    
    .lead-capture-form {
        padding: 25px 20px;
    }
    
    .lead-field-input {
        font-size: 16px; /* Previne zoom no iOS */
    }
    
    .lead-submit-btn {
        width: 100%;
        padding: 16px 20px;
    }
    
    .lead-security-info {
        padding: 15px 20px 20px;
    }
}

@media (max-width: 480px) {
    .lead-capture-wrapper {
        margin: 0 10px;
    }
    
    .lead-capture-form {
        padding: 20px 15px;
    }
    
    .lead-form-header {
        padding: 18px 15px;
    }
    
    .lead-form-title {
        font-size: 18px;
    }
    
    .lead-field-group {
        margin-bottom: 18px;
    }
    
    .lead-privacy-section {
        padding: 15px;
    }
}

/* Estilo para temas escuros */
@media (prefers-color-scheme: dark) {
    .lead-capture-wrapper {
        background: #2d3748;
        color: #e2e8f0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .lead-field-input {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .lead-field-input:focus {
        border-color: #667eea;
        background-color: #4a5568;
    }
    
    .lead-field-input::placeholder {
        color: #a0aec0;
    }
    
    .lead-privacy-section {
        background-color: #374151;
    }
    
    .checkmark {
        border-color: #718096;
        background-color: #4a5568;
    }
    
    .lead-field-label {
        color: #e2e8f0;
    }
    
    .privacy-text {
        color: #cbd5e0;
    }
    
    .lead-security-info {
        background-color: #374151;
        border-top-color: #4a5568;
    }
    
    .security-text {
        color: #a0aec0;
    }
}

/* Animações de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lead-capture-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

/* Estilos para validação em tempo real */
.lead-field-input.valid {
    border-color: #28a745;
}

.lead-field-input.valid:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Loading overlay para formulário inteiro */
.lead-capture-wrapper.submitting {
    pointer-events: none;
}

.lead-capture-wrapper.submitting::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para usuários de teclado */
.lead-field-input:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.lead-submit-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Estados de hover em dispositivos que suportam */
@media (hover: hover) {
    .lead-privacy-checkbox:hover .checkmark {
        border-color: #667eea;
    }
    
    .lead-field-input:hover {
        border-color: #c3c8d1;
    }
}

/* Estilo personalizado para WordPress */
.wp-block-group .lead-capture-wrapper,
.widget .lead-capture-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Integração com temas populares */
.entry-content .lead-capture-wrapper {
    margin: 2em auto;
}

/* Override de estilos de temas que podem conflitar */
.lead-capture-wrapper input[type="text"],
.lead-capture-wrapper input[type="email"],
.lead-capture-wrapper input[type="tel"],
.lead-capture-wrapper button {
    font-family: inherit;
    box-shadow: none !important;
    text-shadow: none !important;
}

.lead-capture-wrapper button:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}