/* Lead Generation Modal Styles */
.lead-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.lead-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lead-modal {
    width: 100%;
    margin: 0;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: white;
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    z-index: 10001; /* Ensure it's above everything */
    font-family: var(--font-primary);
}

.lead-modal-overlay.active .lead-modal {
    transform: scale(1);
    opacity: 1;
}

.lead-modal-header {
    background: linear-gradient(135deg, rgb(74, 115, 111) 0%, rgb(61, 153, 145) 100%);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lead-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

.lead-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 36px;
    height: 36px;

    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lead-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.lead-modal-title {
    color: white;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

.lead-modal-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 10px 0 0;
    position: relative;
    z-index: 1;
}

.lead-modal-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    margin-top: 20px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.lead-modal-progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: left;
}

.lead-modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: auto; /* Allow scrolling if content is too tall */
    min-height: 0;
    /* Ensure content doesn't get covered by fixed nav */
    padding-top: max(40px, calc(80px - var(--modal-header-height, 0px)));

    overflow: hidden;
    min-height: 0;
}

.lead-step {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateX(100%);
    width: 100%;
    max-width: 600px;
    padding: 40px;
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s ease;
    box-sizing: border-box;
    /* Ensure content doesn't extend too high */
    max-height: calc(100vh - 200px); /* Account for header and footer */
    overflow-y: auto;
}

.lead-step.active {
    transform: translate(-50%, -50%) translateX(0);
    opacity: 1;
}

.lead-step.prev {
    transform: translate(-50%, -50%) translateX(-100%);
}

.lead-step.next {
    transform: translate(-50%, -50%) translateX(100%);
}

.step-title {
    color: rgb(74, 115, 111);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.step-description {
    color: rgba(0, 0, 0, 0.7);
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    display: block;
    color: rgb(74, 115, 111);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: rgb(61, 153, 145);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(61, 153, 145, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.option-card {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
    position: relative;
    overflow: hidden;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(61, 153, 145, 0.1), transparent);
    transition: left 0.5s ease;
}

.option-card:hover {
    border-color: rgb(61, 153, 145);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(61, 153, 145, 0.15);
}

.option-card:hover::before {
    left: 100%;
}

.option-card.selected {
    border-color: rgb(61, 153, 145);
    background: rgba(61, 153, 145, 0.05);
    transform: scale(1.02);
}

.option-icon {
    font-size: 32px;
    color: rgb(74, 115, 111);
    margin-bottom: 10px;
}

.option-title {
    font-weight: 600;
    color: rgb(74, 115, 111);
    margin-bottom: 5px;
}

.option-description {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
}

.lead-modal-footer {
    padding: 30px 40px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e0e0e0;
}

.modal-button {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.modal-button.secondary {
    background: transparent;
    color: rgba(0, 0, 0, 0.6);
    border: 2px solid #e0e0e0;
}

.modal-button.secondary:hover {
    background: #e0e0e0;
    color: rgba(0, 0, 0, 0.8);
}

.modal-button.primary {
    background: linear-gradient(135deg, rgb(74, 115, 111) 0%, rgb(61, 153, 145) 100%);
    color: white;
    border: 2px solid transparent;
}

.modal-button.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.modal-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(61, 153, 145, 0.3);
}

.modal-button.primary:hover::before {
    left: 100%;
}

.modal-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Contact form step - ensure it doesn't get covered */
.lead-step[data-step="4"] {
    top: 20px; /* Start from top instead of center */
    transform: translate(-50%, 0) translateX(100%);
    height: auto;
    min-height: calc(100vh - 280px); /* Account for header and footer */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.lead-step[data-step="4"].active {
    transform: translate(-50%, 0) translateX(0);
}

.lead-step[data-step="4"].prev {
    transform: translate(-50%, 0) translateX(-100%);
}

.lead-step[data-step="4"].next {
    transform: translate(-50%, 0) translateX(100%);
}


/* Success/Thank You Step */
.success-step {
    text-align: center;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;

}

.success-icon {
    font-size: 64px;
    color: rgb(61, 153, 145);
    margin-bottom: 20px;
    animation: successPulse 2s ease-in-out infinite alternate;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.success-title {
    font-size: 28px;
    color: rgb(74, 115, 111);
    margin-bottom: 15px;
    font-weight: 600;
}

.success-message {
    font-size: 16px;
    color: rgba(0, 0, 0, 0.7);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lead-modal-header {
        padding: 20px;
    }
    
    .lead-modal-body {
        padding: 20px;
        padding-top: 20px; /* Reset for mobile */
    }
    
    .lead-modal {
       
    
    .lead-modal-header,
    .lead-modal-body,
    .lead-modal-footer {
        padding: 20px;
    }
    
    .lead-step {
        padding: 20px;
        max-width: 100%;
        width: calc(100% - 40px);
        max-height: calc(100vh - 160px); /* Adjusted for mobile */
    }
    
    /* Mobile contact form step positioning */
    .lead-step[data-step="4"] {
        top: 10px;
        min-height: calc(100vh - 200px);
        padding: 15px;
    }
    
    .step-title {
        font-size: 20px;
    }
    
    .step-description {
        font-size: 14px;
    }
    
    .option-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .option-card {
        padding: 15px;
    }
    
    .option-icon {
        font-size: 24px;
    }
    
    .option-title {
        font-size: 16px;
    }
    
    .option-description {
        font-size: 13px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-input {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .lead-modal-footer {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .modal-button {
        width: 100%;
        padding: 15px;
    }
    
    .lead-modal-title {
        font-size: 24px;
    }
    
    .lead-modal-subtitle {
        font-size: 14px;
    }
    
    .success-step {
        padding: 40px 20px;
    }
    
    .success-icon {
        font-size: 48px;
    }
    
    .success-title {
        font-size: 24px;
    }
    
    .success-message {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .lead-modal-body {
        padding: 15px;
    }
    
    .lead-step {
        padding: 15px;
        width: calc(100% - 30px);
    }
    
    /* Extra small screen contact form adjustment */
    .lead-step[data-step="4"] {
        top: 5px;
        min-height: calc(100vh - 180px);
        padding: 10px;
    }
    
    .step-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .step-description {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .option-card {
        padding: 12px;
    }
    
    .form-input {
        padding: 10px 12px;
    }
    
    .lead-modal-footer {
        padding: 15px;
    }
}

/* Wipe Animation for Step Transitions with Scanning Glow */
.step-wipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgb(74, 115, 111) 0%, rgb(61, 153, 145) 100%);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 10;
    pointer-events: none;
}

.step-wipe-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    right: -20px;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(61, 153, 145, 0.8) 30%, 
        rgba(255, 255, 255, 0.9) 50%, 
        rgba(61, 153, 145, 0.8) 70%, 
        transparent 100%);
    box-shadow: 
        0 0 20px rgba(61, 153, 145, 0.6),
        0 0 40px rgba(61, 153, 145, 0.4),
        0 0 60px rgba(61, 153, 145, 0.2);
    opacity: 0;
}

.step-wipe-overlay.wiping {
    animation: wipeTransition 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.step-wipe-overlay.wiping::before {
    animation: glowingScan 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes wipeTransition {
    0% { 
        transform: scaleX(0); 
        transform-origin: left; 
    }
    50% { 
        transform: scaleX(1); 
        transform-origin: left; 
    }
    51% { 
        transform: scaleX(1); 
        transform-origin: right; 
    }
    100% { 
        transform: scaleX(0); 
        transform-origin: right; 
    }
}

@keyframes glowingScan {
    0% { 
        opacity: 0;
        right: -20px;
    }
    20% { 
        opacity: 1;
        right: -20px;
    }
    50% { 
        opacity: 1;
        right: -20px;
    }
    80% { 
        opacity: 1;
        right: -20px;
    }
    100% { 
        opacity: 0;
        right: -20px;
    }
}

/* Typography System */
:root {
    --font-primary: "proxima-nova", sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

.lead-modal-content {
    font-family: var(--font-primary);
}

.lead-modal h2 {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-light);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    letter-spacing: 0.5px;
}

.lead-modal p {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.6;
}

.lead-modal label {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lead-modal input,
.lead-modal textarea,
.lead-modal select {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    font-size: 1rem;
}

.lead-modal button {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lead-modal .close-button {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
}

.lead-modal .step-indicator {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lead-modal .progress-text {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    font-size: 0.875rem;
}

.lead-modal .error-message {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: 0.875rem;
}

.lead-modal .success-message {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: clamp(1rem, 1.2vw, 1.125rem);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.modal-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10000;
}

.close:hover {
    color: rgb(74, 115, 111);
}

.form-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    width: 100%;
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button[type="submit"] {
    width: 100%;
    padding: 15px;
    background-color: rgb(74, 115, 111);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
    background-color: rgb(61, 153, 145);
}

/* Ensure modal is visible and full screen on all devices */
@media screen and (max-width: 768px) {
    .modal-content {
        padding: 15px;
    }

    .form-container {
        width: 100%;
        max-width: 100%;
    }

    .close {
        top: 15px;
        right: 15px;
        font-size: 24px;
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .modal, .modal-content {
        height: -webkit-fill-available;
    }
}