/**
 * Prospen Call Back Form – styles
 *
 * v2.6.1 – Extracted from the inline <style> block that used to be printed
 * inside prospen_callback_render_form() on every page load. As an inline
 * block it shipped uncached with every request and (if the shortcode or
 * widget appeared more than once on a page) was duplicated verbatim each
 * time. As an external, versioned file it is fetched once and cached by
 * the browser across every page that uses the form.
 *
 * Also adds min-height reservations on the form card to reduce Cumulative
 * Layout Shift (CLS) while web fonts / dynamic content load in.
 */

.prospen-call-back-form-wrapper {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
}

.prospen-call-back-form-wrapper .prospen-callback-form {
    max-width: 100%;
    padding: 20px;
    background: #EEEEEE;
    border-radius: 16px;
    position: relative;
    z-index: 1;
    /* CLS fix: reserve roughly the rendered height of a 2-column form
       (title + 2 field rows + button) so the page doesn't jump once
       fonts/content finish loading. */
    min-height: 420px;
    box-sizing: border-box;
}

.prospen-call-back-form-wrapper .prospen-callback-form h2 {
    text-align: left;
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
    font-size: 24px;
}

.prospen-call-back-form-wrapper .prospen-callback-form .form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.prospen-call-back-form-wrapper .prospen-callback-form .form-group {
    flex: 1 1 calc(50% - 25px);
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    min-width: 0;
}

.prospen-call-back-form-wrapper .prospen-callback-form .form-group.full-width {
    flex: 1 1 100%;
}

.prospen-call-back-form-wrapper .prospen-callback-form label {
    margin-bottom: 8px;
    font-size: 14px;
    color: #444;
    font-weight: 600;
    text-align: left;
}

.prospen-call-back-form-wrapper .prospen-callback-form label.required::after {
    content: " *";
    color: #e74c3c;
    margin-left: 4px;
}

.prospen-call-back-form-wrapper .prospen-callback-form input,
.prospen-call-back-form-wrapper .prospen-callback-form select,
.prospen-call-back-form-wrapper .prospen-callback-form textarea {
    padding: 14px 16px !important;
    border: 1px solid #B8C5D6 !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    background: #F5F8FB !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02) !important;
    transition: all 0.2s ease;
    text-align: left;
    width: 100% !important;
    box-sizing: border-box !important;
}

.prospen-call-back-form-wrapper .prospen-callback-form input:focus,
.prospen-call-back-form-wrapper .prospen-callback-form select:focus,
.prospen-call-back-form-wrapper .prospen-callback-form textarea:focus {
    border-color: #2E6FD6 !important;
    box-shadow: 0 0 0 3px rgba(46, 111, 214, 0.3) !important;
    outline: none !important;
    background: #fff !important;
}

.prospen-call-back-form-wrapper .prospen-callback-form button {
    padding: 16px 32px;
    background-color: #D58037;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: 5px;
}

.prospen-call-back-form-wrapper .prospen-callback-form button:hover {
    background-color: #b2602a;
}

.prospen-call-back-form-wrapper .prospen-callback-form .form-group.full-width.button-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.prospen-call-back-form-wrapper .prospen-callback-form input.invalid,
.prospen-call-back-form-wrapper .prospen-callback-form select.invalid {
    border-color: #e74c3c;
}

.prospen-call-back-form-wrapper .prospen-callback-form .error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 6px;
    text-align: left;
}

.prospen-call-back-form-wrapper .hidden-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

.prospen-call-back-form-wrapper .success-message {
    display: none;
    color: #D58037;
    font-weight: 500;
    font-size: 14px;
    margin-top: 10px;
}

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

.prospen-call-back-form-wrapper .success-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.prospen-call-back-form-wrapper .success-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.prospen-call-back-form-wrapper .success-popup {
    background-color: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: prospenFadeIn 0.3s ease;
}

.prospen-call-back-form-wrapper .success-popup h3 {
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.prospen-call-back-form-wrapper .success-popup p {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
}

.prospen-call-back-form-wrapper .success-popup button {
    padding: 10px 20px;
    background-color: #D58037;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: 0;
}

.prospen-call-back-form-wrapper .success-popup button:hover {
    background-color: #b2602a;
}

/* ================================================================
   LAYOUT CONTROLS
   ================================================================ */

/* TWO-COLUMN LAYOUT (default) */
.prospen-call-back-form-wrapper .prospen-callback-form.layout-two-column .form-group {
    flex: 1 1 calc(50% - 25px) !important;
    max-width: calc(50% - 25px) !important;
}

.prospen-call-back-form-wrapper .prospen-callback-form.layout-two-column .form-group.full-width {
    flex: 1 1 100% !important;
    max-width: 100% !important;
}

/* ONE-COLUMN LAYOUT */
.prospen-call-back-form-wrapper .prospen-callback-form.layout-one-column .form-group {
    flex: 1 1 100% !important;
    max-width: 100% !important;
}

/* One-column form is taller (4 stacked fields + button) — raise the
   CLS reservation to match so switching layouts doesn't reintroduce shift. */
.prospen-call-back-form-wrapper .prospen-callback-form.layout-one-column {
    min-height: 620px;
}

/* Placeholder-only mode: hide visible labels */
.prospen-call-back-form-wrapper .prospen-callback-form.labels-placeholders label.field-label {
    display: none;
}

/* Mobile: always one column */
@media (max-width: 768px) {
    .prospen-call-back-form-wrapper .prospen-callback-form .form-group {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }

    .prospen-call-back-form-wrapper .prospen-callback-form {
        min-height: 620px;
    }
}
