/* Lead Gen Modal Styles - Content within Welcome Modal */

.leadgen-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1100px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    z-index: 10001;
}

/* Lead Gen Close Button */
.leadgen-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100002; /* Above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.leadgen-close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Two Panel Layout */
.leadgen-panels {
    display: flex;
    min-height: 500px; /* Reduced from 600px */
    gap: 15px; /* Reduced from 20px */
    padding: 15px; /* Reduced from 20px */
    overflow-x: hidden;
}

/* Left Panel - Form */
.leadgen-left-panel {
    flex: 1;
    padding: 20px; /* Reduced from 30px */
    background: white;
    display: flex;
    flex-direction: column;
    border: 2px solid whitesmoke;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leadgen-left-panel h1 {
    font-size: 22px; /* Reduced from 24px */
    font-weight: bold;
    color: #333;
    margin-bottom: 20px; /* Reduced from 30px */
    text-align: left;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px; /* Reduced from 15px */
    margin-bottom: 15px; /* Reduced from 20px */
}

.form-group {
    margin-bottom: 15px; /* Reduced from 20px */
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 10px 12px; /* Reduced from 12px 15px */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px; /* Reduced from 16px */
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Form validation styles */
.form-group input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

.form-success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.form-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
}

.leadgen-submit-btn {
    width: 100%;
    padding: 12px; /* Reduced from 15px */
    background: #3569a4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px; /* Reduced from 16px */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 15px; /* Reduced from 20px */
}

.leadgen-submit-btn:hover:not(:disabled) {
    background: #2c5a8a;
}

.leadgen-submit-btn:disabled,
.leadgen-submit-btn.disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Email validation states */
.form-group input.email-validating {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffc107' stroke-width='2'%3E%3Cpath d='M21 12a9 9 0 11-6.219-8.56'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

.form-group input.email-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='2'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

.form-group input.email-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

/* Email validation message */
.email-validation-message {
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
    display: block;
}

.email-validation-message.email-validation-validating {
    color: #ffc107;
}

.email-validation-message.email-validation-valid {
    color: #28a745;
}

.email-validation-message.email-validation-invalid {
    color: #dc3545;
}

/* Right Panel - Info & Video */
.leadgen-right-panel {
    flex: 1;
    padding: 20px; /* Reduced from 30px */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Reduced from 20px */
    border: 2px solid whitesmoke;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leadgen-info-box h2 {
    font-size: 18px; /* Reduced from 20px */
    font-weight: bold;
    color: #333;
    margin-bottom: 12px; /* Reduced from 15px */
    font-style: italic;
}

.leadgen-info-box p {
    font-size: 14px; /* Reduced from 16px */
    color: #333;
    line-height: 1.4; /* Reduced from 1.5 */
    margin-bottom: 12px; /* Reduced from 15px */
}

.leadgen-info-box strong {
    font-weight: bold;
}

/* Video Container */
.leadgen-video-container {
    width: 100%;
    margin-bottom: 15px; /* Reduced from 20px */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leadgen-video-container iframe {
    width: 100%;
    height: 280px; /* Reduced from 315px */
    border: none;
    border-radius: 8px;
}

/* Video Placeholder */
.leadgen-video-placeholder {
    background: #333;
    border: 2px solid #000;
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.video-placeholder-content {
    text-align: center;
    color: white;
}

.video-placeholder-content p {
    margin: 5px 0;
    font-size: 16px;
}

/* Video Caption */
.leadgen-video-caption {
    margin-top: 15px; /* Reduced from 20px */
}

.leadgen-video-caption strong {
    font-size: 16px; /* Reduced from 18px */
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 8px; /* Reduced from 10px */
}

.leadgen-video-caption p {
    font-size: 14px; /* Reduced from 16px */
    color: #333;
    line-height: 1.4; /* Reduced from 1.5 */
    margin: 0;
}

/* Ensure vertical scrollbar on leadgen-panels below 1000px */
@media (max-width: 1000px) {
    .leadgen-panels {
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        max-height: calc(90vh - 100px);
    }
    
    .leadgen-panels::-webkit-scrollbar {
        width: 8px;
    }
    
    .leadgen-panels::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .leadgen-panels::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
    
    .leadgen-panels::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

/* Stack panels below 900px with right panel ABOVE left panel */
@media (max-width: 900px) {
    .leadgen-panels {
        flex-direction: column-reverse; /* Reverse order - right panel appears first */
        min-height: auto;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .leadgen-left-panel,
    .leadgen-right-panel {
        flex: 1;
        width: 100%;
    }
    
    .leadgen-panels::-webkit-scrollbar {
        width: 8px;
    }
    
    .leadgen-panels::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .leadgen-panels::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
    
    .leadgen-panels::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .leadgen-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .leadgen-panels {
        flex-direction: column-reverse; /* Maintain reverse order - right panel above left */
        min-height: auto;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .leadgen-left-panel,
    .leadgen-right-panel {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .leadgen-left-panel h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .leadgen-info-box h2 {
        font-size: 18px;
    }
    
    .leadgen-info-box p,
    .leadgen-video-caption p {
        font-size: 14px;
    }
    
    .leadgen-video-placeholder {
        min-height: 150px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .leadgen-left-panel,
    .leadgen-right-panel {
        padding: 15px;
    }
    
    .leadgen-left-panel h1 {
        font-size: 18px;
    }
    
    .leadgen-info-box h2 {
        font-size: 16px;
    }
    
    .leadgen-info-box p,
    .leadgen-video-caption p {
        font-size: 13px;
    }
    
    .leadgen-video-placeholder {
        min-height: 120px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"] {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Hide modal by default */
.leadgen-modal {
    display: none;
}

.leadgen-modal.show {
    display: flex;
}
