/* =================================================================== */
/*  Simpro Booking — Form CSS v2.2                                     */
/*  Customise brand colours by overriding the CSS variables below       */
/* =================================================================== */

.apr-booking-wrap {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1a1a1a;
}

/* Header */
.apr-booking-header { text-align: center; margin-bottom: 1.5rem; }
.apr-header-badge {
    display: inline-block;
    background: #F5C518;
    color: #0D1B2A;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.apr-booking-title { font-size: 1.6rem; margin: 0.3rem 0; color: #0D1B2A; }
.apr-booking-subtitle { color: #555; font-size: 0.95rem; margin: 0.3rem 0 0; }

/* Step indicator */
.apr-steps { display: flex; align-items: center; justify-content: center; margin-bottom: 2rem; gap: 0; }
.apr-step {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; color: #999; font-weight: 500;
}
.apr-step-num {
    width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem;
    background: #e8e8e8; color: #999;
    transition: all 0.3s ease;
}
.apr-step.active .apr-step-num { background: #0D1B2A; color: #fff; }
.apr-step.complete .apr-step-num { background: #28a745; color: #fff; }
.apr-step.active .apr-step-label,
.apr-step.complete .apr-step-label { color: #1a1a1a; }
.apr-step-line { width: 40px; height: 2px; background: #ddd; margin: 0 8px; }

/* -------------------------------------------------------------------- */
/*  Company / Individual toggle                                         */
/* -------------------------------------------------------------------- */

.apr-type-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 320px;
}
.apr-type-opt {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    color: #666;
}
.apr-type-opt input[type="radio"] { display: none; }
.apr-type-opt--active {
    background: #0D1B2A;
    color: #fff;
}
.apr-type-fields--hidden { display: none !important; }

/* -------------------------------------------------------------------- */
/*  Form fields                                                         */
/* -------------------------------------------------------------------- */

.apr-section { border: none; padding: 0; margin: 0; }
.apr-section--hidden { display: none; }

.apr-field { margin-bottom: 1rem; }
.apr-field label {
    display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; color: #1a1a1a;
}
.apr-req { color: #D0271D; }
.apr-optional { font-weight: 400; color: #999; font-size: 0.8rem; }

.apr-field input[type="text"],
.apr-field input[type="email"],
.apr-field input[type="tel"],
.apr-field input[type="date"],
.apr-field input[type="url"],
.apr-field select,
.apr-field textarea {
    width: 100%; padding: 10px 12px; font-size: 0.95rem;
    border: 2px solid #ddd; border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff; color: #1a1a1a;
    box-sizing: border-box;
}
.apr-field input:focus,
.apr-field select:focus,
.apr-field textarea:focus {
    border-color: #0D1B2A; box-shadow: 0 0 0 3px rgba(13,27,42,0.08); outline: none;
}
.apr-field textarea { resize: vertical; }
/* Select dropdowns need extra height — text clips with same padding as inputs */
.apr-field select {
    height: auto;
    min-height: 44px;
    padding: 10px 32px 10px 12px;
    line-height: 1.3;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    text-overflow: ellipsis;
}

.apr-invalid { border-color: #D0271D !important; box-shadow: 0 0 0 3px rgba(208,39,29,0.1) !important; }

.apr-hint { display: block; font-size: 0.8rem; color: #888; margin-top: 3px; }

.apr-field-row { display: flex; gap: 1rem; }
.apr-field-row > .apr-field { flex: 1; }
.apr-field-row--thirds > .apr-field--wide { flex: 2; }
.apr-field-row--thirds > .apr-field--narrow { flex: 1; }

/* File input */
.apr-file-input {
    padding: 8px !important;
    border-style: dashed !important;
    cursor: pointer;
}

/* -------------------------------------------------------------------- */
/*  Optional field groups (Site Contact, Additional Contact)            */
/* -------------------------------------------------------------------- */

.apr-optional-group {
    margin: 0.5rem 0 1rem;
    border-top: 1px solid #eee;
    padding-top: 0.8rem;
}
.apr-toggle-link {
    background: none; border: none; padding: 0;
    color: #0D1B2A; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; text-decoration: underline;
    text-underline-offset: 3px;
}
.apr-toggle-link:hover { color: #D0271D; }
.apr-optional-hint { font-weight: 400; color: #888; font-size: 0.8rem; }
.apr-optional-fields { margin-top: 0.8rem; }
.apr-optional-fields--hidden { display: none; }

/* -------------------------------------------------------------------- */
/*  Confirmation step                                                    */
/* -------------------------------------------------------------------- */

.apr-confirm-wrap { text-align: center; }
.apr-confirm-icon { font-size: 2.5rem; margin-bottom: 0.3rem; }
.apr-confirm-title { font-size: 1.3rem; color: #0D1B2A; margin: 0 0 0.3rem; }
.apr-confirm-subtitle { color: #555; font-size: 0.95rem; margin-bottom: 1.2rem; }

.apr-confirm-card {
    background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 1rem 1.2rem; margin: 0.8rem auto; max-width: 400px;
    text-align: left;
}
.apr-confirm-row { font-size: 0.9rem; margin-bottom: 0.3rem; }
.apr-confirm-note { color: #888; font-size: 0.8rem; font-style: italic; margin-top: 0.5rem; }

.apr-confirm-loading { text-align: center; padding: 3rem 1rem; }
.apr-spinner {
    width: 36px; height: 36px; margin: 0 auto 1rem;
    border: 3px solid #e0e0e0; border-top-color: #0D1B2A;
    border-radius: 50%; animation: apr-spin 0.7s linear infinite;
}
@keyframes apr-spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------- */
/*  Buttons                                                              */
/* -------------------------------------------------------------------- */

.apr-section-nav { margin-top: 1.5rem; display: flex; justify-content: flex-end; }
.apr-section-nav--split { justify-content: space-between; }

.apr-btn {
    padding: 12px 24px; font-size: 0.95rem; font-weight: 600;
    border-radius: 6px; border: none; cursor: pointer;
    transition: all 0.2s ease;
}
.apr-btn--primary {
    background: #0D1B2A; color: #fff;
}
.apr-btn--primary:hover { background: #162d4a; }
.apr-btn--ghost {
    background: transparent; color: #555; border: 2px solid #ddd;
}
.apr-btn--ghost:hover { border-color: #0D1B2A; color: #0D1B2A; }

.apr-btn--submit {
    background: #D0271D; color: #fff; font-size: 1.05rem; padding: 14px 32px;
}
.apr-btn--submit:hover { background: #b5221a; }
.apr-btn--submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* -------------------------------------------------------------------- */
/*  Trust bar                                                            */
/* -------------------------------------------------------------------- */

.apr-trust-bar {
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
    margin: 1.5rem 0; padding: 1rem; background: #f8f9fa; border-radius: 8px;
}
.apr-trust-item { font-size: 0.85rem; color: #444; font-weight: 500; }

/* Time note */
.apr-time-note {
    display: flex; gap: 12px; align-items: flex-start;
    background: #eff8ff; border: 1px solid #b8daff; border-radius: 8px;
    padding: 1rem; margin-bottom: 1.5rem; font-size: 0.9rem;
}
.apr-time-note-icon { font-size: 1.4rem; flex-shrink: 0; }

/* -------------------------------------------------------------------- */
/*  Error / Success                                                      */
/* -------------------------------------------------------------------- */

.apr-error {
    background: #fff3f3; border: 1px solid #f5c2c7; color: #842029;
    padding: 12px 16px; border-radius: 6px; font-size: 0.9rem; margin-bottom: 1rem;
}

.apr-success { text-align: center; padding: 2rem 1rem; }
.apr-success-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem;
    background: #28a745; color: #fff; font-size: 2rem; font-weight: 700;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
/* Build 56-b item 4 — failure-state variant. Applied by JS when the
   submission was lead-routed by silent backend failure (no lead_id
   returned), so the customer sees a warning style rather than a green
   tick that implies "all good". */
.apr-success.apr-success--warning .apr-success-icon {
    background: #d97706; /* amber-600 */
}
.apr-success.apr-success--warning .apr-success-title { color: #92400e; }
.apr-success-title { color: #0D1B2A; font-size: 1.4rem; margin-bottom: 0.5rem; }
.apr-success-msg { color: #555; font-size: 1rem; }
.apr-success-next {
    background: #f8f9fa; border-radius: 8px; padding: 1.2rem;
    display: inline-block; text-align: left; margin-top: 1.5rem;
}
.apr-success-next ol { margin: 0.5rem 0 0 1.2rem; padding: 0; line-height: 1.8; }
.apr-success-phone { margin-top: 1.5rem; color: #666; font-size: 0.9rem; }
.apr-success-phone a { color: #0D1B2A; font-weight: 600; text-decoration: none; }

/* -------------------------------------------------------------------- */
/*  Google Places Autocomplete                                           */
/* -------------------------------------------------------------------- */

.pac-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    border-radius: 0 0 6px 6px;
    border: 2px solid #0D1B2A;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 99999;
}
.pac-item {
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
}
.pac-item:hover, .pac-item-selected {
    background: #f0f4f8;
}
.pac-icon { display: none; }
.pac-item-query { font-weight: 600; color: #0D1B2A; }

/* -------------------------------------------------------------------- */
/*  Responsive                                                           */
/* -------------------------------------------------------------------- */

@media (max-width: 600px) {
    .apr-field-row { flex-direction: column; gap: 0; }
    .apr-field-row--thirds { flex-direction: row; flex-wrap: wrap; }
    .apr-field-row--thirds > .apr-field--wide { flex: 1 1 100%; }
    .apr-field-row--thirds > .apr-field--narrow { flex: 1 1 calc(50% - 0.5rem); }
    .apr-trust-bar { flex-direction: column; align-items: center; gap: 0.5rem; }
    .apr-steps { gap: 4px; }
    .apr-step-label { display: none; }
    .apr-step-line { width: 24px; }
    .apr-section-nav--split { flex-direction: column-reverse; gap: 0.5rem; }
    .apr-section-nav--split .apr-btn { width: 100%; text-align: center; }
    .apr-type-toggle { max-width: 100%; }
    .apr-confirm-card { max-width: 100%; }
}

/* ================================================================== */
/*  Slot picker                                                        */
/* ================================================================== */

.apr-slot-heading { margin: 0 0 16px; font-size: 1.15em; }
.apr-slot-heading-note { font-size: 0.78em; font-weight: 400; color: #666; margin-left: 6px; white-space: nowrap; }

.apr-slot-status { padding: 20px; text-align: center; color: #666; }
.apr-slot-status--empty { background: #f9f9f9; border-radius: 8px; border: 1px dashed #ddd; }
.apr-slot-status--empty p:first-child { font-size: 1em; margin-bottom: 4px; }
.apr-slot-empty-hint { font-size: 0.85em; color: #999; }

.apr-spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid #ddd; border-top-color: #F5A623; border-radius: 50%; animation: apr-spin 0.7s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes apr-spin { to { transform: rotate(360deg); } }

.apr-slot-group-label { font-size: 0.85em; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.05em; margin: 12px 0 6px; }
.apr-slot-group-label:first-child { margin-top: 0; }

.apr-slot-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.apr-slot-btn {
    padding: 10px 16px; border: 2px solid #E8E8E8; border-radius: 8px; background: #fff;
    font-size: 0.95em; font-weight: 500; cursor: pointer; transition: all 0.15s;
    min-width: 120px; text-align: center; color: #333;
}
.apr-slot-btn:hover:not(:disabled) { border-color: #F5A623; background: #FFF8F0; color: #333; }
.apr-slot-btn--selected { border-color: #F5A623; background: #F5A623; color: #fff !important; }
.apr-slot-btn--selected:hover { background: #E59A1F; border-color: #E59A1F; color: #fff !important; }
.apr-slot-btn--loading { opacity: 0.6; cursor: wait; }
.apr-slot-btn--taken { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; border-color: #ddd; }
.apr-slot-btn:disabled:not(.apr-slot-btn--selected):not(.apr-slot-btn--taken) { opacity: 0.5; cursor: not-allowed; }

.apr-slot-held-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: #F0FAF0; border: 1px solid #C6E6C6; border-radius: 8px;
    padding: 12px 16px; margin-top: 16px;
}
.apr-slot-held-info { display: flex; align-items: center; gap: 8px; }
.apr-slot-held-check { color: #00A32A; font-size: 1.2em; }
.apr-slot-held-timer { font-size: 0.9em; color: #666; }
.apr-slot-held--urgent { background: #FFF3F0; border-color: #FFBFB0; }
.apr-slot-held--urgent .apr-slot-held-timer { color: #D63638; }

@media (max-width: 600px) {
    .apr-slot-btn { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
    .apr-slot-held-bar { flex-direction: column; gap: 8px; text-align: center; }
}

/* Surcharge slots */
.apr-slot-surcharge-info {
    font-size: 0.85em; color: #856404; background: #fff3cd; border: 1px solid #ffc107;
    border-radius: 6px; padding: 8px 12px; margin-bottom: 12px;
}
.apr-slot-btn--surcharge { border-color: #F5A623; background: #FFF8F0; color: #333; }
.apr-slot-btn--surcharge:hover:not(:disabled) { background: #FFF0DB; border-color: #E59A1F; color: #333; }
.apr-slot-btn--surcharge .apr-slot-time { display: block; font-weight: 600; color: #333; }
.apr-slot-btn--surcharge .apr-slot-surcharge { display: block; font-size: 0.75em; color: #B8860B; margin-top: 2px; }
.apr-slot-btn--surcharge.apr-slot-btn--selected { background: #F5A623; border-color: #E59A1F; color: #fff !important; }
.apr-slot-btn--surcharge.apr-slot-btn--selected .apr-slot-time { color: #fff; }
.apr-slot-btn--surcharge.apr-slot-btn--selected .apr-slot-surcharge { color: rgba(255,255,255,0.85); }

/* Terms & Conditions */
.apr-terms { margin: 16px 0; }
.apr-terms-label { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9em; color: #555; line-height: 1.4; cursor: pointer; }
.apr-terms-label input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; width: 18px; height: 18px; }
.apr-terms-label a { color: #0073aa; text-decoration: underline; }
.apr-terms-label strong { color: #333; }
/* Helper text under the consent line; aligned to consent text, not the checkbox. */
.apr-terms-helper { margin: 4px 0 10px 28px; font-size: 13px; font-style: italic; color: #6b7280; line-height: 1.4; }
/* Optional discount checkbox below the consent block. Same indent as the helper. */
.apr-terms-discount-label { display: flex; align-items: flex-start; gap: 10px; margin-left: 28px; font-size: 0.9em; color: #555; line-height: 1.4; cursor: pointer; }
.apr-terms-discount-label input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; width: 18px; height: 18px; }

/* Day navigator */
.apr-day-nav { display: flex; align-items: center; gap: 4px; margin-bottom: 20px; }
.apr-day-arrow { width: 36px; height: 60px; border: 1px solid #ddd; border-radius: 8px; background: #fff; font-size: 22px; font-weight: 700; color: #666; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.apr-day-arrow:hover:not(:disabled) { background: #f5f5f5; border-color: #bbb; color: #333; }
.apr-day-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.apr-day-strip { display: flex; gap: 6px; flex: 1; overflow: hidden; justify-content: center; }
.apr-day-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: 8px 6px; border: 2px solid #e8e8e8; border-radius: 10px; background: #fff; cursor: pointer; transition: all 0.15s; flex: 1; max-width: 80px; }
.apr-day-btn:hover:not(.apr-day-btn--selected) { border-color: #F5A623; background: #FFF8F0; }
.apr-day-btn--selected { border-color: #F5A623; background: #F5A623; }
.apr-day-btn--selected .apr-day-name,
.apr-day-btn--selected .apr-day-num,
.apr-day-btn--selected .apr-day-month { color: #fff; }
.apr-day-name { font-size: 11px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.apr-day-num { font-size: 20px; font-weight: 700; color: #333; line-height: 1.2; }
.apr-day-month { font-size: 11px; color: #999; }
@media (max-width: 500px) {
    .apr-day-btn { min-width: 48px; padding: 6px 4px; }
    .apr-day-num { font-size: 17px; }
    .apr-day-arrow { width: 30px; height: 50px; font-size: 18px; }
}

/* ═══ Build 43: New form fields ═══ */

/* Checkbox labels */
.apr-checkbox-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 12px 0; line-height: 1.5; font-size: 14px; color: #333; }
.apr-checkbox-label input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; width: 18px; height: 18px; accent-color: #F5A623; }
.apr-checkbox-label--required { background: #FFF8F0; border: 1px solid #F5A623; border-radius: 8px; padding: 14px 16px; }

/* Conditional fields (shown when checkbox ticked) */
.apr-conditional-fields { padding: 12px 0 0 28px; }

/* Radio groups */
.apr-radio-group { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.apr-radio-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 10px 14px; border: 1px solid #e8e8e8; border-radius: 8px; transition: all 0.15s; font-size: 14px; line-height: 1.4; }
.apr-radio-label:hover { border-color: #F5A623; background: #FFF8F0; }
.apr-radio-label input[type="radio"] { margin-top: 3px; flex-shrink: 0; accent-color: #F5A623; }

/* Info panel */
.apr-info-panel { background: #f0f7ff; border: 1px solid #b8d4f0; border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; color: #333; }
.apr-info-panel p { margin: 0; }

/* Lead redirect message */
.apr-lead-redirect-msg { background: #FFF8F0; border-left: 4px solid #F5A623; border-radius: 0 8px 8px 0; padding: 12px 16px; margin-top: 10px; }
.apr-lead-redirect-msg p { margin: 0; font-size: 14px; color: #333; }

/* Parking notice */
.apr-parking-notice { margin-bottom: 12px; }

/* Optional hint text (inside labels) */
.apr-optional-hint { color: #999; font-size: 13px; }

/* POP upload conditional block */
.apr-pop-group { margin-top: 12px; }
.apr-pop-panel { background: #FFF8F0; border-left: 4px solid #F5A623; border-radius: 0 8px 8px 0; padding: 12px 16px; margin-bottom: 10px; }
.apr-pop-panel p { margin: 0; font-size: 14px; color: #333; }
