:root {
    --popup-bg: #F2E9DC;       /* Light Beige */
    --popup-text: #111C28;     /* Dark Navy */
    --popup-accent: #C74B44;   /* Brick Red */
    --input-bg: #F5F7FA;       /* Soft Light Blue/Grey */
    --input-border: #CBD5E1;   /* Faint Border */
    --font-heading: 'Rosario', sans-serif;
    --font-body: 'Jost', sans-serif;
}

/* Popup Overlay */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 28, 40, 0.6); /* Dark Navy with opacity */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: flex-start; /* Prevent clipping at top/bottom, enable overlay scroll */
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    font-family: var(--font-body);
    padding: 40px 20px;
    box-sizing: border-box;
    overflow-y: auto;
}
.custom-popup-overlay {
  overflow-y: auto;

  /* Firefox */
  scrollbar-width: none;

  /* IE and Edge */
  -ms-overflow-style: none;
}

/* Chrome, Safari, Opera */
.custom-popup-overlay::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.custom-popup-overlay.popup-open {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.custom-popup-container.popup-form-only {
    background: var(--popup-bg);
    border: 1px solid var(--popup-text); /* Black/navy border from target screenshot */
    border-radius: 20px; /* Rounded corners */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 660px; /* Matches layout width */
    position: relative;
    overflow: hidden;
    margin: auto 0; /* Centered vertically if short, scrollable if tall */
    transform: scale(0.9) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.custom-popup-overlay.popup-open .custom-popup-container {
    transform: scale(1) translateY(0);
}

/* Header Banner - Full Width */
.cppf-header-banner {
/*     background-color: var(--popup-accent); */
    padding: 26px 20px 16px;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
}

.cppf-header-title {
    margin: 0;
    color: #111C28;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cppf-header-subtitle {
    margin: 6px 0 0 0;
    color: #111C28;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Close Button (Gold square with border in top-right) */
.custom-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #000000 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 101;
    width: 24px;
    height: 24px;
    line-height: 20px !important;
    text-align: center;
    padding: 0 !important;
    border-radius: 0 !important; /* Square */
    display: flex;
    align-items: center;
	border: none !important;
    justify-content: center;
}

.custom-popup-close:hover {
    background: transparent !important;
    color: #C74B44 !important;
    transform: scale(1.05);
}

/* Form Section Wrapper */
.custom-popup-left {
    width: 100%;
    padding: 10px 32px 32px 32px; /* Adjusted spacing for the banner */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background-color: var(--popup-bg);
}

.custom-popup-content-inner {
    width: 100%;
}

/* Grid layout for fields */
.custom-popup-form .elementor-form-fields-wrapper {
    display: grid !important;
    grid-template-columns: repeat(30, 1fr) !important;
    gap: 14px 16px !important;
    width: 100% !important;
}

.custom-popup-form .elementor-column {
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    min-width: 0 !important;
}
.custom-popup-form .elementor-field-group{align-items:start !important}
.custom-popup-form .elementor-col-100 { grid-column: span 30 !important; width: 100% !important; }
.custom-popup-form .elementor-col-50 { grid-column: span 15 !important; width: 100% !important; }
.custom-popup-form .elementor-col-33 { grid-column: span 10 !important; width: 100% !important; }
.custom-popup-form .elementor-col-30 { grid-column: span 9 !important; width: 100% !important; }
.custom-popup-form .elementor-col-20 { grid-column: span 6 !important; width: 100% !important; }

/* Section Labels */
.ppc-form-label {
    font-family: var(--font-heading);
    color: var(--popup-text);
    font-size: 13px;
    font-weight: 700;
    margin: 16px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.elementor-screen-only {
    display: none;
}

/* Input & Select fields styling */
.elementor-field-textual,
.elementor-field,
.custom-popup-form input[type="file"] {
    font-family: var(--font-body) !important;
    font-size: 14px !important;
    padding: 10px 14px !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 6px !important;
    color: var(--popup-text) !important;
    background-color: var(--input-bg) !important; /* Soft blue-grey from screenshot */
    transition: all 0.25s ease !important;
    outline: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.elementor-field-textual::placeholder,
.custom-popup-form input::placeholder,
.custom-popup-form textarea::placeholder {
    color: #6B7280 !important; /* Darker placeholder color for readability */
    opacity: 1 !important;
}

/* Styled select default empty placeholder option color */
.cppf-select-wrapper select:required:invalid {
    color: #6B7280 !important;
}

.elementor-field-textual:focus,
.elementor-field:focus {
    border-color: var(--popup-accent) !important;
    background-color: #ffffff !important;
}

/* Custom File Upload Styling (Drag & Drop box style) */
.custom-file-upload-wrapper {
    position: relative;
    width: 100%;
}

.elementor-upload-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.custom-file-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: 2px dashed rgba(17, 28, 40, 0.2);
    border-radius: 8px;
    background: #ffffff;
    color: var(--popup-text);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
}

.custom-file-upload-wrapper:hover .custom-file-upload-btn {
    border-color: var(--popup-accent);
    background: rgba(199, 75, 68, 0.02);
}

/* Dropdown select wrapper */
.cppf-select-wrapper {
    position: relative;
    width: 100%;
}

.cppf-select-wrapper select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: none !important; /* Block theme overrides */
    padding-right: 35px !important;
    cursor: pointer;
}

.select-caret-down-wrapper {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    z-index: 10;
}

.select-caret-down-wrapper svg {
    width: 14px;
    height: 14px;
    fill: #9BA8B6; /* Grey filled caret arrow */
    opacity: 0.9;
    transition: transform 0.2s ease;
}

.cppf-select-wrapper select:focus + .select-caret-down-wrapper svg {
    fill: var(--popup-accent);
    transform: rotate(180deg);
}

/* File Upload List Preview */
.file-upload-list-preview {
    margin-top: 8px;
    font-size: 13px;
    color: var(--popup-text);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(17, 28, 40, 0.05);
    padding: 6px 12px;
    border-radius: 4px;
    width: fit-content;
    animation: fadeIn 0.2s ease;
}

.file-preview-item svg {
    flex-shrink: 0;
    color: var(--popup-accent);
}

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

/* Submit Button Wrapper & Button */
.custom-popup-form .e-form__buttons {
    grid-column: span 30 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
}

.custom-popup-submit-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 14px 24px !important; /* Taller submit button */
    font-family: var(--font-body) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    background: var(--popup-accent) !important; /* Flat brick-red color */
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    box-shadow: none !important; /* Flat style to match screenshot */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}

.custom-popup-submit-btn:hover {
    background: #b03f39 !important; /* Darker brick red */
}

.custom-popup-submit-btn:active {
    transform: translateY(1px) !important;
}

.custom-popup-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Response Message Banner */
.custom-popup-response-message {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.4;
    font-family: var(--font-body);
}

.custom-popup-response-message.success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.custom-popup-response-message.error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .custom-popup-left {
        padding: 24px 24px;
    }
    
    .cppf-header-title {
        font-size: 20px;
    }
    
    .cppf-header-subtitle {
        font-size: 12px;
    }
    
    .custom-popup-container.popup-form-only {
        max-width: 580px;
    }
	.custom-popup-form .elementor-form-fields-wrapper{
display:flex !important;
}
    /* Make Section 1 fields span 100% on tablet */
    .custom-popup-form .elementor-col-33 {
        grid-column: span 30 !important;
    }
}

@media (max-width: 520px) {
    .custom-popup-form .elementor-col-100,
    .custom-popup-form .elementor-col-50,
    .custom-popup-form .elementor-col-33,
    .custom-popup-form .elementor-col-30,
    .custom-popup-form .elementor-col-20 {
        grid-column: span 30 !important;
        width: 100% !important;
    }
    
    .custom-popup-left {
        padding: 20px 20px;
    }
}
