/* ============================================
   POPUP STYLES - popup.css
   Crevate Technologies
   Version: 2.0.0
   ============================================ */

/* ============================================
   CSS VARIABLES FOR POPUPS
   ============================================ */
:root {
    --popup-primary: #2563eb;
    --popup-primary-dark: #1e40af;
    --popup-success: #22c55e;
    --popup-success-dark: #16a34a;
    --popup-error: #ef4444;
    --popup-warning: #f59e0b;
    --popup-text: #1e293b;
    --popup-text-muted: #64748b;
    --popup-border: #e2e8f0;
    --popup-bg: #ffffff;
    --popup-overlay: rgba(0, 0, 0, 0.6);
    --popup-radius: 20px;
    --popup-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
}

/* ============================================
   FREE QUOTE SIDE BUTTON (LEFT SIDE)
   ============================================ */
.free-quote-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--popup-primary) 0%, var(--popup-primary-dark) 100%);
    color: #fff;
    border: none;
    padding: 10px 14px 10px 10px;
    border-radius: 0 24px 24px 0;
    cursor: pointer;
    box-shadow: 4px 4px 20px rgba(37, 99, 235, 0.35);
    transition: all 0.3s ease;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 600;
    font-size: 13px;
}

.free-quote-btn:hover {
    padding-left: 16px;
    box-shadow: 6px 6px 25px rgba(37, 99, 235, 0.45);
}

.free-quote-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.quote-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.quote-btn-icon svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

.quote-btn-text {
    white-space: nowrap;
}

/* Pulse animation */
@keyframes quotePulse {
    0%, 100% {
        box-shadow: 4px 4px 20px rgba(37, 99, 235, 0.35);
    }
    50% {
        box-shadow: 6px 6px 30px rgba(37, 99, 235, 0.5);
    }
}

.free-quote-btn {
    animation: quotePulse 2.5s ease-in-out infinite;
}

.free-quote-btn:hover {
    animation: none;
}

/* Mobile - Side Button */
@media (max-width: 768px) {
    .free-quote-btn {
        top: auto;
        bottom: 90px;
        padding: 8px 10px 8px 8px;
        font-size: 11px;
        border-radius: 0 20px 20px 0;
    }
    
    .quote-btn-icon {
        width: 28px;
        height: 28px;
    }
    
    .quote-btn-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .quote-btn-text {
        display: none;
    }
}

/* ============================================
   POPUP OVERLAY (Shared)
   ============================================ */
.popup-overlay,
.welcome-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--popup-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active,
.welcome-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   POPUP CONTAINER (Shared)
   ============================================ */
.popup,
.welcome-popup {
    background: var(--popup-bg);
    border-radius: var(--popup-radius);
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--popup-shadow);
    transform: scale(0.9) translateY(20px);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-overlay.active .popup,
.welcome-popup-overlay.active .welcome-popup {
    transform: scale(1) translateY(0);
}

/* Hide scrollbar but keep functionality */
.popup::-webkit-scrollbar,
.welcome-popup::-webkit-scrollbar {
    width: 4px;
}

.popup::-webkit-scrollbar-thumb,
.welcome-popup::-webkit-scrollbar-thumb {
    background: var(--popup-border);
    border-radius: 4px;
}

/* ============================================
   POPUP CLOSE BUTTON (Shared)
   ============================================ */
.popup-close,
.welcome-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: var(--popup-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
}

.popup-close:hover,
.welcome-popup-close:hover {
    background: #e2e8f0;
    color: var(--popup-text);
    transform: rotate(90deg);
}

.popup-close svg,
.welcome-popup-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================
   POPUP CONTENT
   ============================================ */
.popup-content,
.welcome-popup-content {
    padding: 32px 24px;
}

.popup-content.hide,
.welcome-popup-content.hide {
    display: none;
}

/* ============================================
   POPUP HEADER
   ============================================ */
.popup-header,
.welcome-popup-header {
    text-align: center;
    margin-bottom: 24px;
}

/* Popup Icon */
.popup-icon,
.welcome-popup-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--popup-primary) 0%, #7c3aed 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.popup-icon svg,
.welcome-popup-icon svg {
    width: 32px;
    height: 32px;
    stroke: #fff;
    stroke-width: 1.5;
    fill: none;
}

/* Popup Badge */
.popup-badge,
.welcome-popup-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.popup-badge {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--popup-primary-dark);
}

.welcome-popup-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

/* Popup Title */
.popup-header h3,
.welcome-popup-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--popup-text);
    margin: 0 0 8px 0;
    font-family: 'Poppins', sans-serif;
}

.popup-header p,
.welcome-popup-header p {
    color: var(--popup-text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   BENEFITS LIST (Welcome Popup)
   ============================================ */
.popup-benefits,
.welcome-popup-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: #166534;
    font-weight: 500;
}

.benefit-icon {
    color: var(--popup-success);
    font-weight: 700;
    font-size: 14px;
}

/* ============================================
   POPUP FORM
   ============================================ */
.popup-form,
.welcome-popup-form {
    margin-bottom: 20px;
}

.popup-form .form-group,
.welcome-popup-form .form-group {
    margin-bottom: 14px;
}

.popup-form .form-row,
.welcome-popup-form .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.popup-form label,
.welcome-popup-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.popup-form input,
.popup-form select,
.welcome-popup-form input,
.welcome-popup-form select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--popup-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.25s ease;
    background: var(--popup-bg);
    color: var(--popup-text);
}

.popup-form input:focus,
.popup-form select:focus,
.welcome-popup-form input:focus,
.welcome-popup-form select:focus {
    outline: none;
    border-color: var(--popup-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.popup-form input::placeholder,
.welcome-popup-form input::placeholder {
    color: #94a3b8;
}

.popup-form select,
.welcome-popup-form select {
    cursor: pointer;
    appearance: none;
    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='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Form Validation */
.popup-form input.error,
.popup-form select.error,
.welcome-popup-form input.error,
.welcome-popup-form select.error {
    border-color: var(--popup-error);
    background-color: #fef2f2;
}

.popup-form input.error:focus,
.welcome-popup-form input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ============================================
   POPUP SUBMIT BUTTON
   ============================================ */
.popup-form .btn-submit,
.welcome-popup-form .btn-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--popup-primary) 0%, var(--popup-primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.popup-form .btn-submit:hover,
.welcome-popup-form .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.popup-form .btn-submit:active,
.welcome-popup-form .btn-submit:active {
    transform: translateY(0);
}

.popup-form .btn-submit:disabled,
.welcome-popup-form .btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Button Glow Effect */
.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.btn-submit:hover::before {
    left: 100%;
}

/* Button Spinner */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-submit.loading .btn-spinner {
    display: block;
}

.btn-submit.loading .btn-text {
    opacity: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   POPUP FOOTER
   ============================================ */
.popup-footer,
.welcome-popup-footer {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--popup-border);
}

.popup-footer p,
.welcome-popup-footer p {
    color: var(--popup-text-muted);
    font-size: 13px;
    margin: 0 0 12px 0;
}

/* Contact Buttons */
.popup-contact,
.welcome-popup-contact {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
}

.contact-btn,
.popup-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.contact-btn.whatsapp,
.popup-contact-btn.whatsapp {
    background: #25d366;
    color: #fff;
}

.contact-btn.whatsapp:hover,
.popup-contact-btn.whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
}

.contact-btn.call,
.popup-contact-btn.call {
    background: #f1f5f9;
    color: var(--popup-text);
    border: 1px solid var(--popup-border);
}

.contact-btn.call:hover,
.popup-contact-btn.call:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.contact-btn svg,
.popup-contact-btn svg {
    width: 16px;
    height: 16px;
}

/* Skip Button */
.popup-skip,
.welcome-popup-skip {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    transition: color 0.25s ease;
}

.popup-skip:hover,
.welcome-popup-skip:hover {
    color: var(--popup-text-muted);
    text-decoration: underline;
}

/* ============================================
   POPUP SUCCESS STATE
   ============================================ */
.popup-success,
.welcome-popup-success {
    display: none;
    padding: 48px 24px;
    text-align: center;
}

.popup-success.show,
.welcome-popup-success.show {
    display: block;
    animation: fadeInUp 0.4s ease;
}

/* Success Icon */
.success-icon,
.success-checkmark {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--popup-success) 0%, var(--popup-success-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon svg,
.success-checkmark svg {
    width: 36px;
    height: 36px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
}

/* Success checkmark text fallback */
.success-icon::after {
    content: '✓';
    font-size: 32px;
    color: #fff;
    font-weight: bold;
}

.success-icon svg + *,
.success-checkmark svg + * {
    display: none;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-success h3,
.welcome-popup-success h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--popup-text);
    margin: 0 0 8px 0;
}

.popup-success p,
.welcome-popup-success p {
    color: var(--popup-text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.popup-success .btn-close,
.welcome-popup-success .btn-close {
    padding: 12px 28px;
    background: var(--popup-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.popup-success .btn-close:hover,
.welcome-popup-success .btn-close:hover {
    background: var(--popup-primary-dark);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ============================================
   BODY STATE WHEN POPUP OPEN
   ============================================ */
body.popup-open {
    overflow: hidden;
}

body.popup-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9998;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 576px) {
    .popup-overlay,
    .welcome-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .popup,
    .welcome-popup {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    
    .popup-overlay.active .popup,
    .welcome-popup-overlay.active .welcome-popup {
        transform: translateY(0);
        animation: slideUp 0.35s ease;
    }
    
    .popup-content,
    .welcome-popup-content {
        padding: 28px 20px;
    }
    
    .popup-icon,
    .welcome-popup-icon {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }
    
    .popup-icon svg,
    .welcome-popup-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .popup-header h3,
    .welcome-popup-header h3 {
        font-size: 20px;
    }
    
    .popup-header p,
    .welcome-popup-header p {
        font-size: 13px;
    }
    
    .popup-form input,
    .popup-form select,
    .welcome-popup-form input,
    .welcome-popup-form select {
        padding: 11px 12px;
        font-size: 14px;
    }
    
    .popup-benefits,
    .welcome-popup-benefits {
        flex-direction: column;
    }
    
    .benefit-item {
        justify-content: center;
    }
    
    .popup-contact,
    .welcome-popup-contact {
        flex-direction: column;
    }
    
    .contact-btn,
    .popup-contact-btn {
        width: 100%;
    }
    
    .popup-success,
    .welcome-popup-success {
        padding: 40px 20px;
    }
    
    .success-icon,
    .success-checkmark {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 360px) {
    .popup-content,
    .welcome-popup-content {
        padding: 24px 16px;
    }
    
    .popup-header h3,
    .welcome-popup-header h3 {
        font-size: 18px;
    }
}

/* ============================================
   TABLET & DESKTOP FORM ROW
   ============================================ */
@media (min-width: 480px) {
    .popup-form .form-row,
    .welcome-popup-form .form-row {
        grid-template-columns: 1fr 1fr;
    }
}