/* --- Booking Form Specific Styles --- */
.booking-section {
    /* padding: 2rem 1rem;
    background-color: var(--secondary);
    margin-top: 2rem;
    margin-bottom: 2rem; */
}

.booking-form-container {
    max-width: 600px;
    margin: 0 auto;
    /* background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); */
}

.booking-form-container h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.6rem;
}

.booking-form-container p {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.form-step {
    margin-bottom: 2rem;
    position: relative; /* for loading placeholder */
}

.form-step>label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Calendar Styles */
#inline-calendar {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px;
    background-color: var(--white);
}

.flatpickr-calendar.inline {
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    border: none;
}

.flatpickr-day.has-availability {
    position: relative;
    font-weight: bold;
    color: var(--primary);
    /* background-color: #e8f5e9; */
    /* Optional lighter bg */
}

.flatpickr-day.has-availability::after {
    content: '●';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--success);
    line-height: 1;
    z-index: 1;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.flatpickr-day.has-availability:hover,
.flatpickr-day.has-availability:focus {
    background-color: var(--secondary);
}

.flatpickr-day.has-availability.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
    box-shadow: 0px 0px 10px var(--primary);
}

.flatpickr-day.has-availability.selected::after {
    color: var(--white);
}

.flatpickr-innerContainer {
    justify-content: center;
}

p.calendar-hint {
    font-size: 0.85rem;
    color: var(--dark);
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.availability-indicator-dot {
    color: var(--success);
    font-weight: bold;
    font-size: 1.2em;
    vertical-align: middle;
    display: inline-block;
    line-height: 1;
}

/* Time Slots */
.time-slots-container {
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 4px;
    min-height: 100px;
    display: grid;
    grid-template-columns: auto auto auto auto;
    gap: 10px;
    align-content: flex-start;
    background-color: var(--light-gray);
    margin-top: 0.5rem;
}

.time-slot-placeholder {
    width: 100%;
    text-align: center;
    color: var(--dark);
    font-style: italic;
    margin: auto 0;
}

.time-slot-placeholder.error-text {
    color: #D8000C;
    /* Error red */
    font-weight: bold;
    font-style: normal;
}

.time-slot-btn {
    background-color: var(--white);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex-grow: 1;
    text-align: center;
}

.time-slot-btn:hover {
    background-color: var(--secondary);
    border-color: var(--primary);
}

.time-slot-btn.selected {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    font-weight: bold;
    box-shadow: 0px 0px 10px var(--primary);
}

.time-slot-btn.disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    border-color: #ccc;
}

/* Contact Fields */
.contact-fields {
    margin-top: 2rem;
    border-top: 1px dashed var(--border);
    padding-top: 1.5rem;
}

.contact-fields>label {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* .form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.form-group input::placeholder { color: var(--dark); opacity: 0.8; }
 .form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 87, 112, 0.2);
} */
/* Booking Submit Button */
/* .booking-submit {
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    margin-top: 1.5rem;
} */
/* Feedback Message Area */
.booking-feedback {
    text-align: center;
    font-weight: bold;
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.booking-feedback.success {
    color: var(--success);
    border: 1px solid var(--success);
    background-color: rgba(76, 175, 80, 0.1);
}

.booking-feedback.error {
    color: #D8000C;
    /* Error red */
    border: 1px solid #D8000C;
    background-color: #FFD2D2;
    /* Light red bg */
}

/* Loading indicator for calendar */
#inline-calendar.loading-availability {
    opacity: 0.6;
    pointer-events: none;
    /* Prevent clicks while loading */
}

/* --- Booking Form Styles (Service Select & Phone Validation Updates) --- */

/* Disabled state for subsequent steps */
.form-step.disabled-step {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

/* Phone Input Styling (using intl-tel-input classes) */
.phone-group .iti {
    /* Target the container div created by the library */
    width: 100%;
    /* Make it full width */
}

.phone-group .iti__tel-input {
    /* Target the actual input within the library */
    width: 100%;
    padding-top: 0.8rem;
    /* Match other inputs */
    padding-bottom: 0.8rem;
    padding-left: 52px;
    /* Adjust based on flag width if needed */
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    height: auto;
    /* Override potential fixed height */
}

.phone-group .iti__tel-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 87, 112, 0.2);
}

/* Style for validation error state */
.phone-group .iti--error .iti__tel-input {
    border-color: #D8000C;
    /* Error red */
}

.phone-validation-error {
    color: #D8000C;
    font-size: 0.85em;
    display: block;
    /* Show on new line */
    margin-top: 4px;
}

/* General feedback message styling */
.feedback-message {
    font-size: 0.85em;
    margin-top: 5px;
    display: none;
    /* Hide initially */
}

.feedback-message.error {
    color: #D8000C;
}

.feedback-message.info {
    color: var(--dark);
}

/* (Keep all other existing booking form styles) */

/* Container for Radio Buttons */
.service-radio-group {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem;
    /* Add some internal padding */
    background-color: var(--light-gray);
}

.service-radio-group .service-placeholder {
    padding: 0.5rem;
    text-align: center;
    color: var(--dark);
    font-style: italic;
    margin-bottom: 0;
}


    .service-radio-option input[type="radio"] {
        display: none;
    }

    .service-radio-option input[type="radio"]:not(:disabled) ~ label {
        cursor: pointer;
    }

    .service-radio-option input[type="radio"]:disabled ~ label {
        color: rgba(188, 194, 191, 1);
        border-color: rgba(188, 194, 191, 1);
        box-shadow: none;
        cursor: not-allowed;
    }

    .service-radio-option  label {
        display: block;
        background: white;
        color: var(--primary);
        border: 2px solid var(--primary);
        border-radius: 20px;
        padding: 1rem 1rem 1rem 3.5rem;
        margin-bottom: 1rem;
        text-align: left;
        box-shadow: 0px 3px 10px -2px rgba(161, 170, 166, 0.5);
        position: relative;
    }

    .service-radio-option  input[type="radio"]:checked+label {
        background: var(--primary);
        color: rgba(255, 255, 255, 1);
        box-shadow: 0px 0px 20px var(--primary);
    }

    .service-radio-option  input[type="radio"]:checked+label::after {
        color: rgba(61, 63, 67, 1);
        font-family: FontAwesome;
        border: 2px solid var(--primary);
        content: "\f00c";
        font-size: 20px;
        position: absolute;
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        height: 35px;
        width: 35px;
        line-height: 35px;
        text-align: center;
        border-radius: 50%;
        background: white;
        box-shadow: 0px 2px 5px -2px rgba(0, 0, 0, 0.25);
    }


/* Loading state */

.form-step.loading::after {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
    color: var(--primary);
    font-style: italic;
    white-space: nowrap;
}

/* Add loading indicator */
.service-step.loading::after {
    content: '⏳ Loading Services...';
}

.date-step.loading::after {
    content: '⏳ Loading Dates...';
}

.time-step.loading::after {
    content: '⏳ Loading Time Slots...';
}

.service-step.loading .service-radio-group {
    opacity: 0.5;
    cursor: wait;
    position: relative;
    /* Needed for overlay or indicator */
}

.service-step.loading .service-radio-group > * {
    visibility: hidden;
    /* Hide options while loading */
}

/* --- Multi-Step Form Styles --- */

.pabau-multistep-form .form-step-panel {
    display: none; /* Hide all steps by default */
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.pabau-multistep-form .form-step-panel.active {
    display: block; /* Show the active step */
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.step-label { /* Style for the main label of each step */
    display: block;
    font-size: 1.3rem !important; /* Make step titles slightly larger */
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 1.5rem !important;
}
.step-sub-label {
    font-size: 0.9em;
    color: var(--dark);
    margin-top: -1rem;
    margin-bottom: 1rem;
    display: block;
}

.datetime-section {
    margin-bottom: 1.5rem;
}
.datetime-section .sub-label { /* Label for Date/Time within Step 2 */
     display: block;
     font-weight: bold;
     margin-bottom: 0.5rem;
     font-size: 1rem;
     color: var(--primary);
}


/* Navigation Buttons */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.step-navigation button {
    padding: 0.8rem 1.5rem; /* Slightly smaller padding */
    font-size: 1rem;
}

.cta-button-secondary { /* Style for 'Previous' button */
    background-color: transparent;
    color: var(--primary) !important;
    border: 1px solid var(--primary);
    box-shadow: none;
}
.cta-button-secondary:hover {
    background-color: var(--secondary);
    color: var(--primary) !important;
    border-color: var(--primary);
    transform: none; /* No hover lift */
    box-shadow: none;
}
.cta-button-secondary .arrow.left {
     margin-right: 0.5rem;
     margin-left: 0;
     display: inline-block; /* Ensure visibility */
 }
.cta-button-secondary:hover .arrow.left {
     transform: translateX(-5px);
}

.step-navigation .next-step:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
    border-color: transparent;
    box-shadow: none;
}
.step-navigation .next-step:disabled:hover {
     transform: none;
}

/* Hide previous button on first step */
.form-step-panel[data-step="1"] .previous-step {
    display: none;
}
/* Adjust spacing for single button */
.form-step-panel[data-step="1"] .step-navigation {
    justify-content: flex-end;
}

/* Final Submit Button Styling (Same as Next) */
.final-submit {
    /* Uses .cta-button styles */
}

/* Address Fields */
/* Reuse existing .form-group styles */
/* select[name="booking_country"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--white);
    font-family: inherit;
} */

/* Payment Step */
.booking-summary {
    border: 1px dashed var(--border);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    background-color: var(--light-gray);
}
.booking-summary h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--primary);
}
.booking-summary p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.booking-summary strong {
    color: var(--text);
}

.payment-area h4 {
     margin-bottom: 1rem;
     color: var(--primary);
}
.payment-element-placeholder {
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 4px;
    min-height: 50px; /* Placeholder height */
    background-color: var(--white);
}
.payment-element-placeholder p {
    color: var(--dark);
    font-style: italic;
    margin: 0;
}
.payment-feedback {
     margin-top: 10px;
     /* Uses general feedback styles */
}


/* Progress Indicator (Optional) */
.booking-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    list-style: none;
}

.progress-step {
    flex: 1;
    text-align: center;
    color: var(--dark);
    font-size: 0.85rem;
    position: relative;
    padding-bottom: 5px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.progress-step::after { /* Line underneath */
    content: '';
    position: absolute;
    bottom: -1px; /* Align with border-bottom */
    left: 0;
    height: 3px;
    width: 100%;
    background-color: var(--border);
    transition: background-color 0.3s ease;
}

.progress-step.active {
    font-weight: bold;
    color: var(--primary);
    opacity: 1;
}

.progress-step.active::after {
    background-color: var(--primary);
}
.progress-step.completed {
     color: var(--success);
     opacity: 1;
}
.progress-step.completed::after {
     background-color: var(--success);
}


/* --- Phone Input Length Limit (Requires JS for enforcement, CSS for visual cue) --- */
/* Input type=tel doesn't directly support maxlength well across browsers */
/* The JS validation is the primary method */

/* --- Responsive adjustments for Time Slots --- */
 @media (max-width: 600px) {
    .time-slots-container {
         grid-template-columns: auto auto auto; /* 3 columns on smaller screens */
    }
    .time-slot-btn {
        font-size: 0.85rem; /* Smaller font on mobile */
        padding: 0.5rem 0.8rem;
        min-width: 70px;
    }
 }
  @media (max-width: 450px) {
    .time-slots-container {
         grid-template-columns: auto auto; /* 2 columns on very small screens */
    }
 }

 /* --- Step 4: Age Verification & Address --- */
 .age-verification-group {
    margin-bottom: 1.5rem;
}
.age-verification-group .sub-label {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.radio-group-horizontal {
    display: flex;
    gap: 1.5rem; /* Space between radio options */
    align-items: center;
}

.radio-option {
    display: flex; /* Align radio and text nicely */
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border: 1px solid transparent; /* For focus outline consistency */
    border-radius: 4px;
}
.radio-option input[type="radio"] {
    margin-right: 0.5rem;
    /* Consider custom styling for radio buttons if desired, or rely on browser default */
    accent-color: var(--primary); /* Modern way to color browser default radio */
    width: 1.1em;
    height: 1.1em;
}
.radio-option:hover {
    background-color: var(--secondary);
}
.radio-option input[type="radio"]:focus-visible + span { /* For keyboard navigation */
     /* Outline the text or the whole label on focus */
}
 /* Styling for the wrapper of disabled fields */
.address-fields-wrapper.disabled-fields {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}
.address-fields-wrapper.disabled-fields input {
    background-color: #f0f0f0; /* Visually indicate disabled */
}

.age-validation-error {
    /* Uses .feedback-message.error styles, ensure it's defined */
    display: block; /* Ensure it takes its own line */
    margin-top: 0.5rem;
}

/* Ensure sub-label for address fields has correct margin */
.address-fields-wrapper .step-sub-label {
     margin-top: 0;
     margin-bottom: 1rem;
     font-style: italic;
}

/* --- Booking Form: Accordion Step Styles --- */

.booking-accordion {
    overflow: hidden; /* For rounded corners on items */
}

.accordion-step-item {
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
}
.accordion-step-item:last-child {
    border-bottom: none;
}

.accordion-step-title {
    padding: 1rem 0;
    font-weight: bold;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s ease;
}
.accordion-step-title:hover {
    background-color: var(--light-gray);
}
.accordion-step-title > span:first-child { /* The step number and name */
    flex-grow: 1;
}
.accordion-step-summary { /* For displaying selected service/date */
    font-size: 0.85em;
    color: var(--dark);
    font-weight: normal;
    margin-left: 1rem;
    margin-right: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Adjust as needed */
}


.accordion-step-item.open > .accordion-step-title {
    background-color: var(--secondary);
    /* border-bottom: 1px solid var(--accent); */ /* Optional: Highlight active title more */
}
.accordion-step-item.completed > .accordion-step-title {
    color: var(--success); /* Green for completed steps */
}
.accordion-step-item.completed > .accordion-step-title .accordion-step-summary {
    color: var(--success);
}
.accordion-step-item.completed > .accordion-step-title::before { /* Checkmark for completed */
    content: '✓ ';
    color: var(--success);
    margin-right: 8px;
    font-weight: bold;
}


.accordion-arrow svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    color: var(--primary);
}
.accordion-step-item.open .accordion-arrow svg {
    transform: rotate(180deg);
}

.accordion-step-content {
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    display: none; /* Hidden by default */
    background-color: #fdfdfd; /* Slightly off-white background for content */
}
.accordion-step-item.open .accordion-step-content {
    display: block;
    animation: slideDownAccordion 0.4s ease-out;
}

@keyframes slideDownAccordion {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 1500px; } /* Adjust max-height if content is very tall */
}


/* Navigation within accordion content */
.step-navigation-accordion {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.step-navigation-accordion button {
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
}
.accordion-previous-step { /* Reuses .cta-button-secondary */
    /* Styles inherited */
}
.accordion-next-step { /* Reuses .cta-button */
    /* Styles inherited */
}

/* Remove progress bar as accordion titles serve a similar purpose */
.booking-progress {
    display: none;
}

/* Adjust form step labels for accordion context */
.accordion-step-content .form-step > label:first-child,
.accordion-step-content .step-label,
.accordion-step-content .datetime-section .sub-label {
    font-size: 1.1rem; /* Slightly smaller main labels inside accordion */
    margin-bottom: 0.75rem;
}
.accordion-step-content .contact-fields > label:first-child {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}


/* Ensure input groups and elements within accordion content have proper spacing */
.accordion-step-content .form-group {
    margin-bottom: 1rem;
}
.accordion-step-content .datetime-section {
    margin-bottom: 1rem;
}
.accordion-step-content .age-verification-group {
    margin-bottom: 1rem;
}
.accordion-step-content .address-fields-wrapper {
    margin-top: 1rem;
}

/* Disable accordion items that are not the current step */
.accordion-step-item:not(.open) .accordion-step-title {
    /* background-color: #f9f9f9; */ /* Optional: slightly different bg for inactive */
}
.accordion-step-item.disabled-accordion-step .accordion-step-title {
    color: var(--dark);
    cursor: not-allowed;
    background-color: #f8f8f8; /* More muted */
}
.accordion-step-item.disabled-accordion-step .accordion-step-title:hover {
    background-color: #f8f8f8; /* No hover effect */
}
.accordion-step-item.disabled-accordion-step .accordion-arrow svg {
    opacity: 0.5;
}
/* Styling for sub-sections within a step */
.accordion-step-content .sub-step {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border);
}
.accordion-step-content .sub-step:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Label for sub-steps */
.accordion-step-content .sub-label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.75rem;
    font-size: 1rem; /* Slightly smaller than main step label */
    color: var(--primary);
}

/* Disabled state for sub-steps (e.g., date/time before service selected) */
.sub-step.disabled-sub-step {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}
.sub-step.disabled-sub-step .sub-label {
    color: var(--light-text); /* Mute label */
}

/* Ensure feedback messages within sub-steps are positioned correctly */
.sub-step .feedback-message {
    /* Styles already defined should work */
}

/* Adjust navigation button margins if needed */
.step-navigation-accordion {
    margin-top: 1rem; /* Might need less margin now */
}

.accordion-step-summary {
    display: none;
}

.float-right {
    float: right;
}
