/* =============================================================================
   RB-1028 fix 9 (RB 2026-10-21 14:27 PT): "the icons in the form field are a bit too small, and
   the carrot icon indicating dropdowns is stuck to the edge of the box." Reconciled spec (gate 1,
   RB 14:42 PT), public form controls only (patient forms incl. the kiosk, appointment request,
   contact, /patient-form -- since fix 10's R3 all of these carry .contact-form__input); the admin
   panel's selects are in admin_theme.css.
     select       appearance:none + an explicit chevron (~11x7 at 14px, scales in em) whose right
                  inset = the field's horizontal padding; padding-right = padding + chevron + 8px.
     date / time / datetime-local
                  a calendar (clock for time) glyph ~1.3x the field's font-size at the same right
                  inset. The native picker indicator stays clickable on top of it (transparent,
                  same box), so a click still opens the picker and the keyboard is unchanged.
     heights      date, time, select and text inputs of one surface render the SAME height
                  (--cmh-fc-h, the tallest of the measured main heights; nothing gets shorter).
   Last stylesheet in every public bundle. style2's overrides set these controls with !important
   (body.style-style2 .contact-section .contact-form__input, 0,3,1), so these rules use !important
   and a doubled class (0,3,2 and up) to win without editing that file. Colours follow each style's field text.
   Data-URI SVG only (CSP img-src allows data:); no inline style. Measured + pinned by
   platform/test_rb1028_form_controls.py.
   ============================================================================= */

/* body defaults (contact-form surface) */
body {
  --cmh-fc-pad: 16px;
  --cmh-fc-h: 48px;
  --cmh-fc-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23333333' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --cmh-fc-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Crect x='0.8' y='2.2' width='16.4' height='15' rx='2' fill='none' stroke='%23333333' stroke-width='1.6'/%3E%3Cpath d='M0.8 6.8h16.4M5 0.8v3.4M13 0.8v3.4' stroke='%23333333' stroke-width='1.6' stroke-linecap='round'/%3E%3Crect x='3.6' y='9.4' width='3' height='2.6' fill='%23333333'/%3E%3Crect x='7.6' y='9.4' width='3' height='2.6' fill='%23333333'/%3E%3Crect x='11.6' y='9.4' width='2.8' height='2.6' fill='%23333333'/%3E%3Crect x='3.6' y='13' width='3' height='2.4' fill='%23333333'/%3E%3Crect x='7.6' y='13' width='3' height='2.4' fill='%23333333'/%3E%3C/svg%3E");
  --cmh-fc-clk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='8.2' fill='none' stroke='%23333333' stroke-width='1.6'/%3E%3Cpath d='M9 4.2V9l3.2 2.2' fill='none' stroke='%23333333' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* body.style-style2  */
body.style-style2 {
  --cmh-fc-pad: 0.9rem;
  --cmh-fc-h: 43px;
  --cmh-fc-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23333333' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --cmh-fc-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Crect x='0.8' y='2.2' width='16.4' height='15' rx='2' fill='none' stroke='%23333333' stroke-width='1.6'/%3E%3Cpath d='M0.8 6.8h16.4M5 0.8v3.4M13 0.8v3.4' stroke='%23333333' stroke-width='1.6' stroke-linecap='round'/%3E%3Crect x='3.6' y='9.4' width='3' height='2.6' fill='%23333333'/%3E%3Crect x='7.6' y='9.4' width='3' height='2.6' fill='%23333333'/%3E%3Crect x='11.6' y='9.4' width='2.8' height='2.6' fill='%23333333'/%3E%3Crect x='3.6' y='13' width='3' height='2.4' fill='%23333333'/%3E%3Crect x='7.6' y='13' width='3' height='2.4' fill='%23333333'/%3E%3C/svg%3E");
  --cmh-fc-clk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='8.2' fill='none' stroke='%23333333' stroke-width='1.6'/%3E%3Cpath d='M9 4.2V9l3.2 2.2' fill='none' stroke='%23333333' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* body.style-style6  */
body.style-style6 {
  --cmh-fc-pad: 22px;
  --cmh-fc-h: 53px;
  --cmh-fc-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%235b4c52' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --cmh-fc-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Crect x='0.8' y='2.2' width='16.4' height='15' rx='2' fill='none' stroke='%235b4c52' stroke-width='1.6'/%3E%3Cpath d='M0.8 6.8h16.4M5 0.8v3.4M13 0.8v3.4' stroke='%235b4c52' stroke-width='1.6' stroke-linecap='round'/%3E%3Crect x='3.6' y='9.4' width='3' height='2.6' fill='%235b4c52'/%3E%3Crect x='7.6' y='9.4' width='3' height='2.6' fill='%235b4c52'/%3E%3Crect x='11.6' y='9.4' width='2.8' height='2.6' fill='%235b4c52'/%3E%3Crect x='3.6' y='13' width='3' height='2.4' fill='%235b4c52'/%3E%3Crect x='7.6' y='13' width='3' height='2.4' fill='%235b4c52'/%3E%3C/svg%3E");
  --cmh-fc-clk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='8.2' fill='none' stroke='%235b4c52' stroke-width='1.6'/%3E%3Cpath d='M9 4.2V9l3.2 2.2' fill='none' stroke='%235b4c52' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}




/* The tablet kiosk (kiosk.css: 19px text, min-height 52px): one height there too. style6 keeps
   its own (53px), which is already taller. */
body.kiosk-body:not(.style-style6) { --cmh-fc-h: 52px; }


/* ---- one height per surface (date, time, select and text inputs alike) ---- */
:is(input, select).contact-form__input.contact-form__input:is(select, input:is([type='text'], [type='email'], [type='tel'], [type='number'], [type='url'], [type='date'], [type='time'], [type='datetime-local'])) {
  box-sizing: border-box;
  height: var(--cmh-fc-h) !important;
  min-height: var(--cmh-fc-h);
}

/* ---- select: explicit chevron, inset = horizontal padding ---- */
body select.contact-form__input.contact-form__input.contact-form__input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff !important;   /* M7: the text inputs' white, not the native #EFEFEF */
  background-image: var(--cmh-fc-chev) !important;
  background-repeat: no-repeat !important;
  background-size: 0.786em 0.5em !important;
  background-position: right var(--cmh-fc-pad) center !important;
  padding-right: calc(var(--cmh-fc-pad) + 0.786em + 8px) !important;
}
body select.contact-form__input.contact-form__input.contact-form__input::-ms-expand { display: none; }

/* ---- date / time / datetime-local: a glyph ~1.3x the text, inset = horizontal padding ---- */
input.contact-form__input.contact-form__input:is([type='date'], [type='time'], [type='datetime-local']) {
  position: relative;
  background-image: var(--cmh-fc-cal) !important;
  background-repeat: no-repeat !important;
  background-size: 1.35em 1.35em !important;  /* the drawn glyph spans ~93% of its 18-unit box: ~1.3x the text */
  background-position: right var(--cmh-fc-pad) center !important;
  padding-right: calc(var(--cmh-fc-pad) + 1.35em + 8px) !important;
}
input.contact-form__input.contact-form__input[type='time'] {
  background-image: var(--cmh-fc-clk) !important;
}
/* The native picker button stays: transparent, exactly over the drawn glyph, so the click still
   opens the picker (Chromium). WebKit/Safari has no such button; the field itself opens it. */
input.contact-form__input.contact-form__input:is([type='date'], [type='time'], [type='datetime-local'])::-webkit-calendar-picker-indicator {
  position: absolute;
  right: var(--cmh-fc-pad);
  top: 0;
  bottom: 0;
  margin: auto 0;
  width: 1.35em;
  height: 1.35em;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---- disabled selects look disabled (review B): appearance:none + the white above hid the UA's
   grey. The same grey field and dimmed text a disabled native control had. ---- */
body select.contact-form__input.contact-form__input.contact-form__input:disabled {
  background-color: #efefef !important;
  color: #6d6d6d;
  cursor: not-allowed;
}

/* ---- Firefox has no ::-webkit-calendar-picker-indicator: it draws its own picker button inside
   the field, so the drawn glyph would be a SECOND icon there (review B; Firefox is not installed in
   this sandbox: CONFIGURATION-CONSISTENT, not observed). Only Firefox matches -moz-appearance here
   (CSS.supports: Chromium false, WebKit false), so Chromium/WebKit rendering is unchanged. ---- */
@supports (-moz-appearance: none) {
  input.contact-form__input.contact-form__input:is([type='date'], [type='time'], [type='datetime-local']) {
    background-image: none !important;
    padding-right: var(--cmh-fc-pad) !important;
  }
}

/* ---- forced colors (Windows High Contrast and the like). Gate 3 on 526113e: the drawn chevron is a
   fixed-colour SVG, ~1.6:1 on a dark forced field (main's native arrow followed the palette). In
   forced-colors mode ONLY: the select goes back to its native arrow (which follows the palette), and
   the date/time glyph is drawn by the picker button itself in CanvasText through a mask of the same
   icon, so it follows the palette too. Normal-mode rendering is untouched (RB approved it 20:38 PT). */
@media (forced-colors: active) {
  body select.contact-form__input.contact-form__input.contact-form__input {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    background-image: none !important;
    padding-right: var(--cmh-fc-pad) !important;
  }
  input.contact-form__input.contact-form__input:is([type='date'], [type='time'], [type='datetime-local']) {
    background-image: none !important;
  }
  input.contact-form__input.contact-form__input:is([type='date'], [type='time'], [type='datetime-local'])::-webkit-calendar-picker-indicator {
    opacity: 1;
    forced-color-adjust: none;
    background: CanvasText;
    -webkit-mask: var(--cmh-fc-cal) center / contain no-repeat;
    mask: var(--cmh-fc-cal) center / contain no-repeat;
  }
  input.contact-form__input.contact-form__input[type='time']::-webkit-calendar-picker-indicator {
    -webkit-mask-image: var(--cmh-fc-clk);
    mask-image: var(--cmh-fc-clk);
  }
}
