/*
 * Shared public-site form fields and buttons (booking form on the home page,
 * Contact Us form, and every public-page button). Floating labels follow Bootstrap 5's .form-floating technique
 * (placeholder=" " + :placeholder-shown), without loading Bootstrap.
 *
 * WCAG 2.2 AA: resting labels/hints #475569 (7.5:1), floated labels teal
 * #0f6b63 (6.4:1) so they read differently from the near-black value
 * (#0f172a, 17.9:1), field borders #6b7a89 (4.4:1, >= 3:1 for UI components),
 * errors and the required * #b91c1c (6.5:1).
 *
 * Markup:
 *   <div class="bk-field">
 *     <div class="bk-floating has-icon">   (has-icon only when an icon is used)
 *       <svg class="bk-icon" aria-hidden="true">…</svg>
 *       <input class="bk-control" id="x" placeholder=" " …>
 *       <label for="x">Label <span class="bk-req" aria-hidden="true">*</span></label>
 *     </div>
 *     <p class="bk-hint">…</p>  <p class="bk-error" id="err-x">…</p>
 *   </div>
 */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.bk-field { margin: 0 0 14px; }

.bk-floating { position: relative; }
.bk-control {
  display: block; width: 100%; height: 58px; box-sizing: border-box;
  padding: 26px 14px 8px; border: 1px solid #6b7a89; border-radius: 12px;
  background-color: #fff; color: #0f172a; font: inherit; font-size: 1rem; font-weight: 500; line-height: 1.25;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bk-control::placeholder { color: transparent; }
.bk-floating.has-icon .bk-control { padding-left: 46px; }

select.bk-control {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
  text-overflow: ellipsis;
}
textarea.bk-control { height: 130px; padding-top: 30px; resize: vertical; }
.bk-control:hover { border-color: #475569; }
.bk-control:focus { outline: none; border-color: #0b4f49; box-shadow: 0 0 0 3px rgba(11, 79, 73, .28); }
.bk-control[readonly] { background-color: #f1f5f9; color: #334155; cursor: not-allowed; }
.bk-control[aria-invalid="true"] { border-color: #b91c1c; }
.bk-control[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(185, 28, 28, .25); }

.bk-floating > label {
  position: absolute; top: 0; left: 0; height: 100%; max-width: 100%; box-sizing: border-box;
  padding: 18px 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: #475569; font-size: 1rem; line-height: 1.25; pointer-events: none;
  border: 1px solid transparent; transform-origin: 0 0;
  transition: transform .15s ease, color .15s ease;
}
.bk-floating.has-icon > label { padding-left: 46px; }
/* Floated state: focused, filled, or a control that always shows a value. */
.bk-control:focus ~ label,
.bk-control:not(:placeholder-shown) ~ label,
select.bk-control ~ label,
input[type="date"].bk-control ~ label {
  transform: scale(.82) translateY(-9px) translateX(3px);
  /* Floated label is teal (6.4:1) so it reads as a label, distinct from the
     near-black value typed/selected below it (17.9:1). */
  color: #0f6b63; font-weight: 600;
}
.bk-floating.has-icon .bk-control:focus ~ label,
.bk-floating.has-icon .bk-control:not(:placeholder-shown) ~ label,
.bk-floating.has-icon select.bk-control ~ label,
.bk-floating.has-icon input[type="date"].bk-control ~ label { transform: scale(.82) translateY(-9px) translateX(10px); }
.bk-control:focus ~ label { color: #0b4f49; }
/* The whole date field opens its calendar (see showPicker in the booking script). */
input[type="date"].bk-control { cursor: pointer; }
input[type="date"].bk-control::-webkit-calendar-picker-indicator { cursor: pointer; }
/* A select/date with nothing chosen shows its prompt ("Select a category",
   mm/dd/yyyy) muted (4.8:1), so it doesn't look like an entered value.
   .is-empty is toggled by the progress script. */
.bk-control.is-empty { color: #64748b; font-weight: 400; }
.bk-control.is-empty::-webkit-datetime-edit { color: #64748b; }
select.bk-control option { color: #0f172a; }
.bk-icon { position: absolute; left: 15px; top: 50%; z-index: 2; width: 20px; height: 20px; transform: translateY(-50%); color: #475569; pointer-events: none; }
.bk-req { color: #b91c1c; font-weight: 700; }
.bk-optional { color: #475569; font-weight: 400; }
.bk-hint { margin: 6px 2px 0; color: #475569; font-size: .875rem; line-height: 1.4; }
.bk-error { margin: 6px 2px 0; color: #b91c1c; font-size: .875rem; font-weight: 600; line-height: 1.4; }
.bk-message { margin: 14px 0 0; }

/* ---------- Buttons ----------
   One shared system for every public-page button: a single base (size, shape,
   type, states) plus four colour variants. Existing class names are attached
   here so markup stays as it is.
     Primary          gold sheen      .ui-btn--primary  .btn-hero-primary  .bk-submit
     Secondary        teal fill       .ui-btn--secondary  .bms-btn-main  .bk-existing-btn
     Outline          on light bg     .ui-btn--outline  .bms-btn-ghost
     Inverse outline  on teal/dark bg .ui-btn--inverse  .btn-hero-outline
   (The header's compact "Contact Us" is styled in public-header.css.) */
.ui-btn, .btn-hero, .bk-submit, .bms-btn, .bk-existing-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box; min-height: 52px; margin: 0; padding: 14px 28px;
  border: 1.5px solid transparent; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 1rem; font-weight: 700; line-height: 1.2;
  text-align: center; text-decoration: none; white-space: nowrap;
  transition: background-color .2s ease, background-position .4s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.ui-btn:hover, .btn-hero:hover, .bk-submit:hover, .bms-btn:hover, .bk-existing-btn:hover { transform: translateY(-2px); text-decoration: none; }
.ui-btn:active, .btn-hero:active, .bk-submit:active, .bms-btn:active, .bk-existing-btn:active { transform: translateY(0) scale(.98); }
.ui-btn:focus-visible, .btn-hero:focus-visible, .bk-submit:focus-visible, .bms-btn:focus-visible, .bk-existing-btn:focus-visible { outline: 3px solid #0b4f49; outline-offset: 3px; }
.ui-btn:disabled, .bk-submit:disabled { cursor: progress; opacity: .75; transform: none; }

/* Primary: white -> gold sheen that slides to deeper gold on hover. */
.ui-btn--primary, .btn-hero-primary, .bk-submit {
  color: #000;
  background-color: hsl(40deg 36% 60.78%);
  background-image: linear-gradient(110deg, #fffaf0 0%, #eedfbb 24%, hsl(40deg 36% 60.78%) 50%, hsl(40deg 40% 50%) 100%);
  background-size: 200% 100%; background-position: 0% 50%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 10px 26px -10px rgba(120, 90, 30, .55);
}
.ui-btn--primary:hover, .btn-hero-primary:hover, .bk-submit:hover { color: #000; background-position: 100% 50%; }

/* Secondary: solid teal (white text 7.6:1). */
.ui-btn--secondary, .bms-btn-main, .bk-existing-btn { background: #0a5c55; color: #fff; box-shadow: 0 10px 22px -12px rgba(10, 92, 85, .7); }
.ui-btn--secondary:hover, .bms-btn-main:hover, .bk-existing-btn:hover { background: #083f3a; color: #fff; }

/* Outline on light backgrounds (border 3.1:1 as a UI component). */
.ui-btn--outline, .bms-btn-ghost { background: #fff; color: #0f2e2b; border-color: #8aa29e; }
.ui-btn--outline:hover, .bms-btn-ghost:hover { border-color: #0b4f49; color: #0b4f49; }

/* Inverse outline on the teal hero. */
.ui-btn--inverse, .btn-hero-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .8); }
.ui-btn--inverse:hover, .btn-hero-outline:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }
.btn-hero-outline:focus-visible, .ui-btn--inverse:focus-visible { outline-color: #fff; }

/* Full-width form submit (booking form); other forms set their own width. */
.bk-submit { width: 100%; }

/* Browser autofill: float the label, keep our colours (Chrome paints its own
   yellow/blue otherwise), and fire an animation the progress script listens
   for, since autofill on page load doesn't dispatch input events. */
@keyframes bkAutofill { from { opacity: 1; } to { opacity: 1; } }
.bk-control:-webkit-autofill { animation: bkAutofill 1ms; -webkit-text-fill-color: #0f172a; box-shadow: 0 0 0 1000px #f3fbf9 inset; caret-color: #0f172a; }
.bk-control:-webkit-autofill:focus { box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(11, 79, 73, .28); }
.bk-control:-webkit-autofill ~ label { transform: scale(.82) translateY(-9px) translateX(3px); color: #0f6b63; font-weight: 600; }
.bk-floating.has-icon .bk-control:-webkit-autofill ~ label { transform: scale(.82) translateY(-9px) translateX(10px); }

@media (prefers-reduced-motion: reduce) {
  .bk-floating > label, .bk-control, .ui-btn, .btn-hero, .bk-submit, .bms-btn, .bk-existing-btn { transition: none; }
}
