/* Shared booking validation palette and inline alert treatment. */
:root {
    --booking-error: #f52683;
    --booking-error-text: #c41465;
    --booking-error-bg: #fff0f7;
    --booking-error-ring: rgb(245 38 131 / 13%);
}
:is(#booking-widget, #booking-form, #complete-form) :is(.errorClass, input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"]),
#widget-trip #booking-form .main-form .form-control.errorClass,
#widget-trip #simple_form :is(.depart-container, .destination-container):has(.errorClass) {
    border-color: var(--booking-error);
    box-shadow: 0 0 0 3px var(--booking-error-ring);
}
:is(#booking-widget, #booking-form, #complete-form) :is(.widget-status, .form-error-msg-show, .form-error-msg-adresses-show, .phone-errors, .flight-errors, .vehicle-choice-error):not(:empty) {
    position: relative;
    box-sizing: border-box;
    padding: 12px 14px;
    padding-inline-start: 42px;
    border: 1px solid rgb(245 38 131 / 20%);
    border-radius: 12px;
    background: var(--booking-error-bg);
    color: var(--booking-error-text);
    text-align: start;
    line-height: 1.5;
    font-weight: 500;
}
:is(#booking-widget, #booking-form, #complete-form) :is(.widget-status, .form-error-msg-show, .form-error-msg-adresses-show, .phone-errors, .flight-errors, .vehicle-choice-error):not(:empty)::before {
    content: "";
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: var(--booking-error);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6m0 4h.01'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6m0 4h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* The map and route summary are outside the selectable vehicle list. */
#booking-widget .vehicle-choice-error { margin: 12px 0; }
#booking-widget .vehicle-choice-invalid {
    border: 1px solid var(--booking-error);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 0 0 3px var(--booking-error-ring);
}
/* Override the daily form's control styling, including its ID-specific reset. */
#widget-trip #booking-form #hourly_form select.form-control.errorClass,
#widget-trip #booking-form #hourly_form select.form-control[aria-invalid="true"] {
    border-color: var(--booking-error);
    box-shadow: 0 0 0 3px var(--booking-error-ring);
}

/* Date buttons have a more specific base border than ordinary controls. */
#widget-trip #booking-form .main-form .booking-datetime .reportrange.errorClass {
    border-color: var(--booking-error);
    box-shadow: 0 0 0 3px var(--booking-error-ring);
}
/* Match checkout errors to the address controls, overriding the checkout base styles. */
#booking-widget #complete-form .form-control:not([data-address-text]):is(.errorClass, [aria-invalid="true"]),
#booking-widget #complete-form .form-control:not([data-address-text]):is(.errorClass, [aria-invalid="true"]):focus {
    border: 1px solid var(--booking-error);
    box-shadow: 0 0 0 3px var(--booking-error-ring);
}
