/* Main Form Styles */
.bco-form-container { max-width: 800px; margin: 2rem auto; padding: 2rem; border: 1px solid #e0e0e0; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

/* --- NEW: Progress Bar --- */
.bco-progress-bar-container { width: 100%; background-color: #eee; border-radius: 5px; margin-bottom: 1rem; }
.bco-progress-bar { width: 33.33%; height: 10px; background-color: #0073aa; border-radius: 5px; transition: width 0.4s ease-in-out; }
/* --- END NEW --- */

.bco-form-step { display: none; }
.bco-form-step.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.bco-form-container label { display: block; font-weight: bold; margin-bottom: 0.5rem; }
.bco-form-container input[type="text"], .bco-form-container input[type="email"], .bco-form-container input[type="tel"], .bco-form-container input[type="number"], .bco-form-container input[type="date"], .bco-form-container select, .bco-form-container textarea {
    width: 100%;
    padding: 0.25rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.20rem 0 0.20rem 0.5rem;
    font-size: medium;
    font-weight: 600;
}
.bco-form-container input.invalid { border-color: red; }

/* MODIFIED: Back to 3 steps */
#bco-form-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 2rem; text-align: center; }
.step {
    padding-bottom: 10px;
    color: #aaa;
    border-bottom: 2px solid #eee;
    font-size: 0.9em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    line-height: 1.3;
}
.step .dashicons {
    font-size: 28px;
    height: 28px;
    width: 28px;
    margin-bottom: 5px;
}
.step.current { color: #0073aa; border-bottom-color: #0073aa; font-weight: bold; }

/* Buttons */
button { background: #0073aa; color: white; padding: 12px 20px; border: none; cursor: pointer; border-radius: 4px; font-size: 16px; margin-top: 1rem; }
.bco-prev-btn { background: #6c757d; margin-right: 10px; }

/* --- NEW: Modal Popup Styles --- */
.bco-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.bco-modal-content { background: #fff; padding: 2rem; border-radius: 8px; width: 90%; max-width: 700px; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.bco-modal-close { position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; }
.bco-modal-close:hover { color: #333; }
.bco-modal-actions { text-align: right; margin-top: 1.5rem; border-top: 1px solid #eee; padding-top: 1rem; }
#bco-preview-content h3 { margin-top: 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid #ddd; padding-bottom: 0.5rem; color: #0073aa; }
#bco-preview-content h3:first-child { margin-top: 0; }
.preview-dl { display: grid; grid-template-columns: 200px 1fr; gap: 10px 20px; }
.preview-dl dt { font-weight: bold; color: #555; }
.preview-dl dd { margin: 0; word-wrap: break-word; }

/* ============================================================
   FLATPICKR CALENDAR OVERRIDES
   Fix: Year input hidden by aggressive theme CSS resets
   (e.g. BeTheme, some Divi/Avada configs reset input widths)
   ============================================================ */

/* Isolate the flatpickr calendar from all theme & plugin resets */
.flatpickr-calendar,
.flatpickr-calendar * {
    box-sizing: border-box !important;
}

/* The month/year header bar */
.flatpickr-current-month {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    width: 75% !important;
    left: 12.5% !important;
    padding: 7.48px 0 0 0 !important;
    line-height: 1 !important;
    height: 34px !important;
    text-align: center !important;
}

/* The year number input wrapper */
.flatpickr-current-month .numInputWrapper {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 7ch !important;
    position: relative !important;
    height: auto !important;
}

/* The year <input> itself — this is what themes break */
.flatpickr-current-month input.cur-year {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-width: 4ch !important;
    padding: 0 0 0 0.5ch !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: 300 !important;
    line-height: inherit !important;
    vertical-align: initial !important;
    -webkit-appearance: textfield !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    cursor: text !important;
    /* Undo any theme box-shadow or outline that might collapse the element */
    box-shadow: none !important;
    outline: none !important;
}

/* Prevent bco-form-container's input[type="number"] rule from
   collapsing the year input (it's inside .flatpickr-calendar, not
   .bco-form-container, but some themes re-apply global resets) */
.flatpickr-calendar input[type="number"],
.flatpickr-calendar input[type="number"]:focus,
.flatpickr-calendar input[type="number"]:hover {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 0 0 0.5ch !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Arrow up/down spinners inside the year wrapper */
.flatpickr-current-month .numInputWrapper span {
    display: block !important;
    visibility: visible !important;
    opacity: 0;           /* keep default: shown on hover */
    position: absolute !important;
    right: 0 !important;
    width: 14px !important;
    padding: 0 4px 0 2px !important;
    height: 50% !important;
    cursor: pointer !important;
    border: 1px solid rgba(57,57,57,0.15) !important;
    box-sizing: border-box !important;
}
.flatpickr-current-month .numInputWrapper:hover span {
    opacity: 1 !important;
}

/* Month dropdown */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: inherit !important;
    font-family: inherit !important;
    height: auto !important;
    line-height: inherit !important;
    width: auto !important;
    cursor: pointer !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
    padding: 0 0 0 0.5ch !important;
    vertical-align: initial !important;
}

/* ============================================================
   END FLATPICKR OVERRIDES
   ============================================================ */

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .bco-form-container {
        padding: 1.5rem 1rem;
        margin: 1rem 0;
        border: none;
    }
    .step { font-size: 11px; padding-bottom: 5px; word-break: break-word; }
    .step .dashicons {
        font-size: 22px;
        height: 22px;
        width: 22px;
    }
}
/* ── Flatpickr year input fix ──────────────────────────────────────────────
   Many themes globally set input { width:100% } which collapses the year
   spinbox inside the flatpickr calendar header on desktop.
   These overrides restore the correct narrow width with !important. */
.flatpickr-current-month .numInputWrapper {
    width: 7ch !important;
    min-width: 7ch !important;
    display: inline-block !important;
}
.flatpickr-current-month input.cur-year {
    width: 100% !important;
    min-width: 0 !important;
    display: inline-block !important;
    font-size: 14px !important;
    padding: 0 0 0 4px !important;
    box-sizing: border-box !important;
}
.flatpickr-current-month .numInputWrapper span {
    display: block !important;
}
