/* VinAsia Reservation Plugin – Public CSS
   Form layout: vertical stack with submit at the very end.
   Customization vars (set inline by render_form):
     --vares-align        text alignment for inputs/labels/messages
     --vares-label-size   font-size of labels
     --vares-input-size   font-size of inputs/selects/textareas
     --vares-button-size  font-size of submit button
*/

.va-shortcode-wrap { max-width: 720px; margin: 0 auto; }

.va-shortcode-wrap,
.va-form,
.va-form__row,
.va-form__group {
    min-width: 0;
}

.va-form--booking.va-form--vertical {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: var(--vares-align, left);
}

.va-form--vertical .va-form__row {
    display: grid;
    gap: 16px;
}

.va-form--vertical .va-form__row--3 {
    grid-template-columns: 1fr;
}

.va-form--vertical .va-form__row--2 {
    grid-template-columns: 1fr;
}

.va-form--vertical .va-form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.va-form__label {
    font-size: var(--vares-label-size, 13px);
    text-align: var(--vares-align, left);
    line-height: 1.3;
}

.va-form__input,
.va-form__select,
.va-form__textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #fff !important;
    border: 1px solid #b9b1a8 !important;
    border-radius: 6px !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.04) !important;
    font-size: var(--vares-input-size, 15px) !important;
    text-align: var(--vares-align, left) !important;
    padding: 10px 12px !important;
    min-height: 46px !important;
}

.va-form__label .required,
.va-form__source-note .required {
    color: #ef4444;
    margin-left: 2px;
}

/* Native date input – modern, single calendar icon on the right.
   Each background-* property is set explicitly with !important so the
   dark-theme shorthand (background: #071415 !important) cannot reset
   `background-repeat` back to its default and tile the icon. */
.va-form__input[type="date"] {
    position: relative;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    -webkit-min-logical-width: 0;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
    padding-right: 42px !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238B1A2B'><path d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 17H5V8h14v12zM7 10h5v5H7z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
    background-origin: padding-box !important;
    background-clip: padding-box !important;
}

.va-form__input[type="date"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: inherit;
}

.va-form__input[type="date"]:required:invalid {
    color: transparent !important;
}

.va-form__input[type="date"]:required:invalid::-webkit-datetime-edit {
    color: transparent !important;
}

.va-form__input[type="date"]:required:invalid::before {
    content: attr(data-placeholder);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b857d;
    pointer-events: none;
}

/* Hide the native browser icon – our SVG above is the single icon shown.
   Keeping the indicator clickable across the field lets the picker open. */
.va-form__input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
}

/* Dark-theme variant: gold icon on dark background. Repeats the entire
   background palette so the parent dark shorthand can't reset us. */
.va-laurent-home .va-form__input[type="date"] {
    background-color: #071415 !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c9923f'><path d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 17H5V8h14v12zM7 10h5v5H7z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
    background-origin: padding-box !important;
    background-clip: padding-box !important;
    color-scheme: dark;
}

.va-laurent-home .va-form__input[type="date"]::-webkit-datetime-edit {
    color: rgba(245, 238, 222, 0.42);
}

.va-laurent-home .va-form__input[type="date"]:required:invalid::before {
    color: rgba(245, 238, 222, 0.42);
}

.va-laurent-home .va-form__input[type="date"]:valid::-webkit-datetime-edit,
.va-laurent-home .va-form__input[type="date"]:focus::-webkit-datetime-edit,
.va-laurent-home .va-form__input[type="date"]:not(:invalid)::-webkit-datetime-edit,
.va-laurent-home .va-form__input[type="date"]:not(:invalid)::-webkit-date-and-time-value {
    color: #f3ead6 !important;
}

.va-form__input:focus,
.va-form__select:focus,
.va-form__textarea:focus {
    border-color: #8B1A2B !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.04), 0 0 0 3px rgba(139,26,43,.12) !important;
}

.va-form-message { margin-top: 4px; text-align: center; }

.va-form__notice {
    font-size: 11px;
    letter-spacing: 0.06em;
    margin: -2px 0 0;
    padding: 7px 12px;
    border-radius: 4px;
    background: rgba(201,146,63,.08);
    color: #c9923f;
    text-align: var(--vares-align, left);
    border-left: 2px solid rgba(201,146,63,.45);
}

.va-form__notice--error {
    background: rgba(239,68,68,.10);
    color: #ef4444;
    border-left-color: #ef4444;
}

.va-form__input--error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 4px rgba(239,68,68,.08) !important;
}

.va-form__input--error::placeholder { color: #fca5a5; }

.va-form__source-note {
    color: rgba(245,238,222,.58);
    font-size: 12px;
    text-align: var(--vares-align, left);
    margin-top: -4px;
}

.va-form__submit-row {
    display: flex;
    justify-content: stretch;
    margin-top: 8px;
}

.va-form__booking-submit {
    width: 100%;
    min-height: 54px;
    margin: 0;
    font-size: var(--vares-button-size, 14px) !important;
    letter-spacing: 0.16em;
}

/* Dark / Laurent home variant */
.va-laurent-home .va-form__input,
.va-laurent-home .va-form__select,
.va-laurent-home .va-form__textarea {
    background: #071415 !important;
    border-color: rgba(201,146,63,.48) !important;
    border-radius: 0 !important;
    color: #f3ead6 !important;
    box-shadow: none !important;
}

.va-laurent-home .va-form__select:invalid {
    color: rgba(245,238,222,.42) !important;
}

.va-laurent-home .va-form__input::placeholder,
.va-laurent-home .va-form__textarea::placeholder {
    color: rgba(245,238,222,.42) !important;
}

.va-laurent-home .va-form__input:-webkit-autofill,
.va-laurent-home .va-form__textarea:-webkit-autofill {
    -webkit-text-fill-color: #f3ead6 !important;
    caret-color: #f3ead6;
    box-shadow: 0 0 0 1000px #071415 inset !important;
}

.va-laurent-home .va-form__notice {
    background: rgba(201,146,63,.12);
    color: rgba(243,234,214,.85);
}

.va-laurent-home .va-form__notice--error {
    background: rgba(239,68,68,.12);
    color: #fca5a5;
}

@media (max-width: 1024px) {
    .va-form--vertical .va-form__row--3 {
        grid-template-columns: 1fr;
    }
    .va-form--vertical .va-form__row--3 > .va-form__group:first-child {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .va-shortcode-wrap {
        width: 100%;
        max-width: 100%;
    }

    .va-form--booking.va-form--vertical {
        gap: 14px;
    }

    .va-form--vertical .va-form__row {
        gap: 14px;
    }

    .va-form__label {
        line-height: 1.35;
    }

    .va-form__input,
    .va-form__select,
    .va-form__textarea {
        font-size: max(16px, var(--vares-input-size, 15px)) !important;
        min-height: 48px !important;
        padding: 11px 12px !important;
    }

    .va-form__input[type="date"] {
        padding-right: 42px !important;
    }

    .va-form__notice,
    .va-form__source-note,
    .va-form-message {
        overflow-wrap: anywhere;
    }

    .va-form__booking-submit {
        min-height: 52px;
        white-space: normal;
        letter-spacing: 0.08em;
        line-height: 1.25;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}

@media (max-width: 640px) {
    .va-shortcode-wrap {
        width: 100%;
        max-width: 100%;
    }
    .va-form--booking.va-form--vertical {
        gap: 12px;
    }
    .va-form__label {
        font-size: calc(var(--vares-label-size, 13px) - 1px);
    }
    .va-form__input,
    .va-form__select,
    .va-form__textarea {
        font-size: max(16px, var(--vares-input-size, 15px)) !important;
        padding: 11px 12px !important;
        min-height: 48px !important;
        width: 100% !important;
    }
    .va-form__input[type="date"] {
        padding-right: 42px !important;
        background-position: right 12px center !important;
        background-size: 18px 18px !important;
    }
    .va-form--vertical .va-form__row,
    .va-form--vertical .va-form__row--3,
    .va-form--vertical .va-form__row--2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .va-form__booking-submit {
        font-size: calc(var(--vares-button-size, 14px) - 1px) !important;
        min-height: 52px;
        letter-spacing: 0.08em;
        line-height: 1.25;
        white-space: normal;
    }
}

@media (max-width: 380px) {
    .va-form__input,
    .va-form__select,
    .va-form__textarea {
        font-size: 16px !important;
        min-height: 48px !important;
    }
}
