/* Lead Capture Popup Styles */
.lead-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

/* Success modal should have higher z-index */
#lead-success-modal {
    z-index: 10001 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lead-popup-container {
    background: #ffffff;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    /* Enable smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* Ensure scrollable area */
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lead-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: rgba(62, 46, 31, 0.6);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.lead-popup-close:hover {
    background: rgba(62, 46, 31, 0.1);
    color: var(--text-dark);
}

.lead-popup-content {
    padding: 50px 40px 40px;
    /* Ensure content can scroll fully */
    min-height: min-content;
    /* Add padding bottom to ensure button is visible */
    padding-bottom: 60px;
}

.lead-popup-header {
    text-align: center;
    margin-bottom: 40px;
}

.lead-popup-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 3.5vw, 36px);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.3;
}

.lead-popup-description {
    font-family: 'Inter', sans-serif;
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.6;
    color: rgba(62, 46, 31, 0.75);
}

.lead-popup-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    padding: 12px 16px;
    border: 1.5px solid rgba(62, 46, 31, 0.2);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group input::placeholder {
    color: rgba(62, 46, 31, 0.4);
}

.form-group small {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: rgba(62, 46, 31, 0.6);
    margin-top: -4px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: rgba(62, 46, 31, 0.85);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-label:hover {
    background: rgba(62, 46, 31, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4A90E2;
}

.checkbox-label span {
    flex: 1;
}

.btn-lead-submit {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 600;
    padding: 16px 32px;
    background: #4A90E2;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-lead-submit:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.3);
}

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

.btn-lead-submit:disabled {
    background: rgba(62, 46, 31, 0.3);
    cursor: not-allowed;
    transform: none;
}

/* Success Modal */
.lead-success-container {
    max-width: 600px;
    text-align: center;
}

.lead-success-content {
    padding: 60px 40px;
}

.lead-success-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.lead-success-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 3.5vw, 36px);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.lead-success-message {
    font-family: 'Inter', sans-serif;
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.8;
    color: rgba(62, 46, 31, 0.8);
    margin-bottom: 32px;
}

.btn-lead-success {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 32px;
    background: var(--text-dark);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-lead-success:hover {
    background: var(--brown-medium);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(62, 46, 31, 0.25);
}

/* Mobile Responsive - Premium Experience */
@media (max-width: 768px) {
    .lead-popup-overlay {
        padding: 15px;
        align-items: flex-start;
        padding-top: 5vh;
        /* Ensure overlay allows scrolling */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lead-popup-container {
        max-width: 100%;
        max-height: 85vh;
        min-height: auto;
        border-radius: 16px;
        margin: 0 auto;
        /* Ensure container scrolls properly */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        /* Add bottom margin for scroll space */
        margin-bottom: 20px;
    }

    .lead-popup-content {
        padding: 50px 28px 60px; /* Increased bottom padding */
        /* Ensure content is fully scrollable */
        min-height: min-content;
    }

    .lead-popup-header {
        margin-bottom: 32px;
    }

    .lead-popup-title {
        font-size: clamp(22px, 5vw, 28px);
        margin-bottom: 12px;
    }

    .lead-popup-description {
        font-size: clamp(14px, 3.5vw, 16px);
        line-height: 1.6;
    }

    .lead-popup-form {
        gap: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-group {
        gap: 10px;
    }

    .form-group label {
        font-size: 14px;
    }

    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
        min-height: 48px; /* Better touch target */
    }

    .checkbox-group {
        gap: 14px;
        margin-top: 12px;
    }

    .checkbox-label {
        font-size: 15px;
        padding: 12px;
        min-height: 48px; /* Better touch target */
        align-items: flex-start;
    }

    .checkbox-label input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .btn-lead-submit {
        font-size: 16px;
        padding: 16px 24px;
        width: 100%;
        min-height: 52px; /* Better touch target */
        margin-top: 12px;
    }

    .lead-popup-close {
        top: 16px;
        right: 16px;
        font-size: 32px;
        width: 44px;
        height: 44px;
    }

    .lead-success-content {
        padding: 50px 28px 40px;
    }

    .lead-success-title {
        font-size: clamp(22px, 5vw, 28px);
    }

    .lead-success-message {
        font-size: clamp(14px, 3.5vw, 16px);
        line-height: 1.7;
    }

    .btn-lead-success {
        font-size: 15px;
        padding: 14px 28px;
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .lead-popup-overlay {
        padding: 10px;
        padding-top: 3vh;
        /* Ensure overlay allows scrolling */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lead-popup-container {
        max-height: 92vh;
        border-radius: 12px;
        /* Ensure container scrolls properly */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        /* Add bottom margin for scroll space */
        margin-bottom: 15px;
    }

    .lead-popup-content {
        padding: 40px 20px 80px; /* Increased bottom padding for button visibility */
        /* Ensure content is fully scrollable */
        min-height: min-content;
    }

    .lead-popup-title {
        font-size: 22px;
    }

    .lead-popup-description {
        font-size: 14px;
    }

    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 14px;
    }

    .checkbox-group {
        gap: 12px;
    }

    .checkbox-label {
        font-size: 14px;
        padding: 10px;
    }

    .checkbox-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .btn-lead-submit {
        font-size: 15px;
        padding: 14px 20px;
    }

    .lead-success-content {
        padding: 40px 20px 32px;
    }

    .lead-success-icon {
        font-size: 56px;
        margin-bottom: 20px;
    }

    .lead-success-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .lead-success-message {
        font-size: 14px;
        margin-bottom: 28px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .lead-popup-overlay {
        padding-top: 2vh;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lead-popup-container {
        max-height: 95vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 10px;
    }

    .lead-popup-content {
        padding: 30px 24px 60px; /* Increased bottom padding */
        min-height: min-content;
    }

    .lead-popup-header {
        margin-bottom: 20px;
    }

    .lead-popup-title {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .lead-popup-description {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .lead-popup-form {
        gap: 16px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-lead-submit:active,
    .btn-lead-success:active {
        transform: scale(0.98);
    }

    .checkbox-label:active {
        background: rgba(62, 46, 31, 0.1);
    }
}
