:root {
    --apple-blue: #0071e3;
    --apple-dark: #1d1d1f;
    --apple-gray: #86868b;
    --apple-bg: rgba(255, 255, 255, 0.8);
    --glass: rgba(255, 255, 255, 0.75);
    --radius-lg: 20px;
    --radius-sm: 12px;
}

/* 1. Background Overlay (Frosted Glass) */
.quote-modal-overlay, .success-overlay {
    display: none; 
    position: fixed; 
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    z-index: 99999; 
    align-items: center; 
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
}

/* 2. The Modal Card */
.quote-card {
    background: var(--apple-bg);
    width: 100%;
    max-width: 540px;
    border-radius: var(--radius-lg);
    padding: 48px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: appleSpring 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes appleSpring {
    0% { transform: scale(0.9) translateY(30px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* 3. Typography & Close Button */
.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: #e8e8ed;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--apple-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.close-modal-btn:hover { background: #d2d2d7; }

.quote-header h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--apple-dark);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.quote-header p {
    color: var(--apple-gray);
    font-size: 17px;
    margin-bottom: 32px;
}

/* 4. Ultra Pro Service Selectors */
.section-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--apple-gray);
    margin-bottom: 16px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.cb-item {
    background: #fff;
    padding: 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    border: 1.5px solid #d2d2d7;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cb-item:hover { border-color: var(--apple-blue); }
.cb-item input[type="checkbox"] {
    accent-color: var(--apple-blue);
    width: 18px;
    height: 18px;
}

/* 5. Modern Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.input-grid input {
    background: #fff;
    border: 1.5px solid #d2d2d7;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--apple-dark);
    transition: 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.input-grid input:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

/* 6. Apple Action Button */
.primary-btn {
    width: 100%;
    padding: 18px;
    background: var(--apple-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn:hover {
    background: #0077ed;
    transform: scale(1.015);
    box-shadow: 0 4px 15px rgba(0, 113, 227, 0.3);
}

.primary-btn:active { transform: scale(0.98); }

/* 7. WhatsApp Design */
.wa-divider { margin-top: 24px; text-align: center; }
.wa-link {
    color: #24d366;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Success Card UI */
.success-card {
    background: white;
    padding: 50px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: #f2f2f7;
    color: var(--apple-blue);
    line-height: 72px;
    border-radius: 50%;
    margin: 0 auto 24px;
    font-size: 32px;
}

/* Mobile Responsiveness */
@media (max-width: 580px) {
    .quote-card { padding: 30px 20px; }
    .checkbox-group, .input-grid { grid-template-columns: 1fr; }
    .quote-header h3 { font-size: 26px; }
}

/* Updated Overlay with scroll support */
.quote-modal-overlay {
    display: none; 
    position: fixed; 
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 99999; 
    align-items: center; 
    justify-content: center;
    padding: 10px; /* Reduced outer padding */
    overflow-y: auto; /* Allow scrolling if modal is taller than screen */
}

.quote-card {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 18px;
    padding: 25px; /* TIGHTENED VERTICAL PADDING */
    position: relative;
    max-height: 95vh; /* Ensure it doesn't go off-screen */
    overflow-y: auto; /* Internal scroll if content is long */
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Tightened Header */
.quote-header h3 { font-size: 24px; margin-bottom: 5px; }
.quote-header p { font-size: 14px; margin-bottom: 20px; }

/* Tightened Grid */
.checkbox-group { gap: 8px; margin-bottom: 15px; }
.cb-item { padding: 10px; font-size: 13px; }

.input-grid { gap: 10px; margin-bottom: 15px; }
.input-grid input { padding: 10px 14px; font-size: 14px; }

textarea { 
    padding: 10px; 
    font-size: 14px; 
    margin-bottom: 15px; 
    resize: vertical; 
}

.primary-btn { padding: 14px; font-size: 16px; }

/* Mobile optimization */
@media (max-width: 480px) {
    .quote-card { padding: 20px 15px; }
    .input-grid { grid-template-columns: 1fr; }
}