/* Forms, 3 October 2026. The app's own dropdown and its suggestion field, in the family look (family.css has the
   tokens). Loaded after family.css by index.html and admin.html. forms.js draws them.

   The dropdown: a pill-shaped field that opens a frosted list, the chosen option ticked. The real <select> stays in
   the page as the owner of the value and is never what a person sees or what opens.
   The suggestion field: an ordinary text field that offers a list under it while the person types.
   On a phone the dropdown's list is a sheet from the bottom; rows are 44px on a touch screen. */

/* the real select: in the page, out of sight, out of the tab order */
select.bsf-native {
  position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important;
  overflow: hidden !important; clip-path: inset(50%) !important; pointer-events: none !important;
}
/* a date field's real input, the same way */
input.bsf-native {
  position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important;
  overflow: hidden !important; clip-path: inset(50%) !important; pointer-events: none !important;
}
.bsf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 1. The field that opens -------------------------------------------------------------------------------- */
button.bsf-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; height: 46px; padding: 0 14px 0 18px;
  border: 1px solid var(--frost-line); border-radius: 999px;
  background: var(--frost-strong); background-image: none; box-shadow: var(--frost-rim);
  color: var(--color-foreground); font-family: inherit; font-size: 15px; font-weight: 400; line-height: 1.2;
  text-align: left; cursor: pointer; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .22s var(--ease-out, ease), box-shadow .32s var(--ease-out, ease), background-color .22s var(--ease-out, ease);
}
button.bsf-trigger[hidden], button.bsf-trigger.hidden { display: none; }
@media (hover: hover) { button.bsf-trigger:hover { border-color: var(--oryn-border-hover); } }
button.bsf-trigger:focus-visible, button.bsf-trigger.is-open {
  border-color: color-mix(in srgb, var(--color-brand) 70%, transparent); background: var(--color-card);
  box-shadow: var(--frost-rim), 0 0 0 4px var(--brand-soft);
}
button.bsf-trigger:disabled { opacity: .55; cursor: default; }
.bsf-trigger__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.bsf-trigger.is-empty .bsf-trigger__text { color: var(--color-muted-foreground); }
.bsf-trigger__caret { flex: none; width: 16px; height: 16px; color: var(--color-muted-foreground); }
.bsf-trigger__ic { flex: none; width: 16px; height: 16px; color: var(--color-muted-foreground); }
button.bsf-trigger.is-open .bsf-trigger__ic { color: var(--color-brand-ink); }
button.bsf-trigger.is-open .bsf-trigger__caret { color: var(--color-brand-ink); }

/* 2. The list that floats: real glass --------------------------------------------------------------------- */
.bsf-pop {
  position: fixed; z-index: 2147483000; display: flex; flex-direction: column;
  min-width: 180px; max-width: min(460px, calc(100vw - 16px)); max-height: 340px; padding: 6px;
  border: 1px solid var(--frost-line); border-radius: 20px;
  background: var(--frost-float); box-shadow: var(--frost-rim), var(--frost-pop);
  -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6);
  color: var(--color-foreground); font-family: var(--font-sans, 'Figtree', system-ui, sans-serif); font-size: 15px; line-height: 1.3;
  animation: bsf-in .16s var(--ease-out, ease) both;
}
@keyframes bsf-in { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }
.bsf-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: thin; }
.bsf-list[hidden] { display: none; }
.bsf-group { padding: 10px 12px 4px; font-size: 12.5px; font-weight: 600; color: var(--color-muted-foreground); }
.bsf-opt {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 13px;
  cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent;
}
.bsf-opt__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bsf-opt__label { overflow-wrap: anywhere; }
.bsf-opt__sub { font-size: 13px; color: var(--color-muted-foreground); }
.bsf-opt.is-active { background: color-mix(in srgb, var(--color-foreground) 8%, transparent); }
.bsf-opt[aria-disabled="true"] { opacity: .45; cursor: default; }
.bsf-opt__tick { flex: none; width: 16px; height: 16px; opacity: 0; color: var(--color-brand); }
.bsf-pop[data-bsf-pop="select"] .bsf-opt[aria-selected="true"] { font-weight: 600; color: var(--color-brand-ink); }
.bsf-pop[data-bsf-pop="select"] .bsf-opt[aria-selected="true"] .bsf-opt__tick { opacity: 1; }
.bsf-note { margin: 0; padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--color-muted-foreground); }
.bsf-note[hidden] { display: none; }

/* 3. A phone: the dropdown's list is a sheet from the bottom ------------------------------------------------ */
.bsf-scrim {
  position: fixed; inset: 0; z-index: 2147482999; background: color-mix(in srgb, var(--canvas, #000) 58%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: bsf-fade .2s ease both;
  touch-action: none;   /* the page behind does not scroll under the finger */
}
@keyframes bsf-fade { from { opacity: 0; } to { opacity: 1; } }
.bsf-pop.is-sheet {
  left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; width: auto !important;
  max-width: none; max-height: min(72dvh, 560px) !important; padding: 6px 10px calc(14px + env(safe-area-inset-bottom));
  border-width: 1px 0 0; border-radius: 26px 26px 0 0; background: var(--color-card);
  -webkit-backdrop-filter: none; backdrop-filter: none; animation: bsf-up .28s var(--frost-ease, ease) both;
}
@keyframes bsf-up { from { translate: 0 100%; } to { translate: 0 0; } }
.bsf-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px 6px 12px; }
.bsf-sheet__title { min-width: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.bsf-sheet__close {
  display: grid; flex: none; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--color-muted-foreground); cursor: pointer;
}
.bsf-sheet__close:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -4px; }
.bsf-pop.is-sheet .bsf-opt { min-height: 48px; padding: 10px 12px; font-size: 16px; }
.bsf-pop.is-sheet .bsf-opt:focus-visible { background: color-mix(in srgb, var(--color-foreground) 8%, transparent); }

/* 3b. The calendar of a date field: a month on glass, the chosen day filled, today ringed ------------------- */
.bsf-cal { width: 312px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px 12px 8px; }
.bsf-cal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 10px; }
.bsf-cal__title { flex: 1; text-align: center; font-size: 15px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.bsf-cal__nav {
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--color-muted-foreground); cursor: pointer;
  transition: background-color .18s var(--ease-out, ease), color .18s var(--ease-out, ease);
}
@media (hover: hover) { .bsf-cal__nav:hover { background: color-mix(in srgb, var(--color-foreground) 7%, transparent); color: var(--color-foreground); } }
.bsf-cal__grid { display: flex; flex-direction: column; gap: 2px; }
.bsf-cal__row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.bsf-cal__wk span { display: grid; place-items: center; height: 26px; font-size: 12px; font-weight: 500; color: var(--color-muted-foreground); }
.bsf-cal__day {
  display: grid; place-items: center; height: 38px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: var(--color-foreground); font-family: inherit; font-size: 14px; font-variant-numeric: tabular-nums;
  cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .16s var(--ease-out, ease), color .16s var(--ease-out, ease), box-shadow .16s var(--ease-out, ease);
}
.bsf-cal__day.is-out { color: var(--color-muted-foreground); opacity: .5; }
.bsf-cal__day.is-today { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-brand) 55%, transparent); color: var(--color-brand-ink); font-weight: 600; }
@media (hover: hover) { .bsf-cal__day:hover:not(:disabled):not(.is-on) { background: color-mix(in srgb, var(--color-foreground) 7%, transparent); } }
.bsf-cal__day:focus-visible { box-shadow: 0 0 0 2px var(--color-brand); }
.bsf-cal__day.is-on { background: var(--color-brand); color: var(--color-primary-foreground); font-weight: 600; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--color-brand) 80%, transparent); opacity: 1; }
.bsf-cal__day:disabled { opacity: .28; cursor: default; }
.bsf-cal__foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 8px 2px 0; border-top: 1px solid var(--frost-line, var(--color-border)); }
.bsf-cal__link {
  min-height: 32px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--color-brand-ink); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.bsf-cal__link:only-child { margin-left: auto; }
@media (hover: hover) { .bsf-cal__link:hover { background: color-mix(in srgb, var(--color-brand) 9%, transparent); } }
.bsf-cal__link:focus-visible, .bsf-cal__nav:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 1px; }
.bsf-pop.bsf-cal.is-sheet { width: auto; padding: 6px 16px calc(16px + env(safe-area-inset-bottom)); }
.bsf-pop.bsf-cal.is-sheet .bsf-cal__day { height: 46px; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .bsf-cal__day, .bsf-cal__nav { transition: none; } }

/* 4. A touch screen: 44px to the finger ---------------------------------------------------------------------- */
@media (pointer: coarse) {
  button.bsf-trigger { min-height: 44px; }
  .bsf-opt { min-height: 44px; }
  .bsf-chip { min-height: 44px; }
}

/* 5. Chosen things as chips, with a field to add more --------------------------------------------------------- */
.bsf-chips { display: flex; flex-direction: column; gap: 12px; }
.bsf-chips__list { display: flex; flex-wrap: wrap; gap: 8px; }
.bsf-chips__list[hidden] { display: none; }
.bsf-chip { display: inline-flex; align-items: center; gap: 7px; }
.bsf-chip svg { flex: none; width: 11px; height: 11px; opacity: .8; }

/* 6. Settings: the practice hours and the small text actions --------------------------------------------------- */
.sf-link {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; margin-top: 8px; padding: 0 2px; border: 0; border-radius: 8px;
  background: none; color: var(--color-brand-ink); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.sf-link.hidden { display: none; }
.sf-link i { font-size: 16px; }
@media (hover: hover) { .sf-link:hover { text-decoration: underline; text-underline-offset: 3px; } }
.sf-link:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.sf-days { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-days .chiptog { min-width: 58px; justify-content: center; }
.sf-times { display: grid; grid-template-columns: repeat(2, minmax(0, 230px)); gap: 16px; margin-top: 18px; }
.sf-preview { margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--color-muted-foreground); }
.sf-preview b { font-weight: 600; color: var(--color-foreground); }
@media (max-width: 520px) { .sf-times { grid-template-columns: 1fr 1fr; gap: 12px; } }
@media (pointer: coarse) { .sf-link { min-height: 44px; } }

/* 7. A question with one answer to type (in place of the browser's prompt) ------------------------------------- */
.bsf-ask {
  position: fixed; z-index: 2147483000; left: 50%; top: 50%; translate: -50% -50%; width: min(420px, calc(100vw - 32px)); padding: 24px;
  border: 1px solid var(--frost-line); border-radius: 26px; background: var(--color-card); box-shadow: var(--frost-rim), var(--frost-pop);
  color: var(--color-foreground); font-family: var(--font-sans, 'Figtree', system-ui, sans-serif); animation: bsf-fade .18s ease both;
}
.bsf-ask__title { margin: 0 0 16px; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.bsf-ask__label { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 500; }
.bsf-ask__input { width: 100%; }
.bsf-ask__row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.bsf-ask__btn {
  height: 44px; padding: 0 20px; border: 1px solid var(--frost-line); border-radius: 999px; background: var(--frost-strong); box-shadow: var(--frost-rim);
  color: var(--color-foreground); font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.bsf-ask__btn--go { border-color: transparent; background: var(--color-brand); color: var(--color-primary-foreground); }
.bsf-ask__btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
/* a step that cannot be undone: calm words, and the only alarm color is the button that does it */
.bsf-ask--sure { width: min(470px, calc(100vw - 32px)); }
.bsf-ask__text { margin: -4px 0 18px; }
.bsf-ask__text p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.55; color: var(--oryn-text-2, var(--color-muted-foreground)); }
.bsf-ask__btn--danger { border-color: transparent; background: var(--color-alert); color: white; box-shadow: none; }
.bsf-ask__btn:disabled { opacity: .4; cursor: default; }
.bsf-ask__text p[hidden] { display: none; }
/* what happened when the step did not go through, under the field; and a row that holds three buttons */
.bsf-ask__err { margin: 14px 0 0; font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--color-foreground); }
.bsf-ask__err[hidden] { display: none; }
.bsf-ask__btn[aria-busy="true"] { opacity: .75; cursor: progress; }
.bsf-ask__row--wrap { flex-wrap: wrap; }
@media (max-width: 520px) { .bsf-ask__row--wrap { flex-direction: column-reverse; align-items: stretch; } }
.bsf-ask__text p[role="alert"] { color: var(--color-foreground); font-weight: 500; }
@media (max-width: 640px) { .bsf-ask { top: 14vh; translate: -50% 0; } .bsf-ask--sure { top: 7vh; padding: 20px; } }

/* 7b. A calm notice at the top of the sign-in form (the goodbye after an account is deleted) -------------------- */
.bsf-bye { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--frost-line, var(--color-border)); border-radius: 18px; background: var(--color-card); color: var(--color-foreground); }
.bsf-bye__ic { flex: none; margin-top: 1px; font-size: 20px; color: var(--color-brand); }
.bsf-bye__title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; }
.bsf-bye__text { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--oryn-text-2, var(--color-muted-foreground)); }

/* 8. Less motion ------------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) { .bsf-pop, .bsf-pop.is-sheet, .bsf-scrim, .bsf-ask { animation: none; } button.bsf-trigger { transition: none; } }
html.a11y-reduce-motion .bsf-pop, html.a11y-reduce-motion .bsf-pop.is-sheet, html.a11y-reduce-motion .bsf-scrim { animation: none; }
html.a11y-reduce-motion button.bsf-trigger { transition: none; }

/* the search field of a long list (18 November 2026, the owner: the country codes should have a predictive search): a quiet
   field at the top of the list, the typed letters marked in each choice, the closest first */
.bsf-search { position: relative; display: flex; flex: none; align-items: center; gap: 8px; margin: 2px 2px 6px; padding: 0 12px; height: 40px; border: 1px solid var(--cl-line-2, var(--color-border)); border-radius: 10px; background: var(--cl-surface, var(--color-card)); color: var(--cl-ink-3, var(--color-muted-foreground)); }
.bsf-search svg { flex: none; width: 15px; height: 15px; }
.bsf-search__in { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--cl-ink, var(--color-foreground)); }
.bsf-search__in::placeholder { color: var(--cl-ink-4, var(--color-muted-foreground)); opacity: 1; }
.bsf-search:focus-within { border-color: var(--cl-lilac, var(--color-brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cl-lilac, var(--color-brand)) 16%, transparent); }
.bsf-opt__label mark { padding: 0; border-radius: 3px; background: color-mix(in srgb, var(--cl-lilac, var(--color-brand)) 22%, transparent); color: inherit; }
.bsf-pop.is-sheet .bsf-search { margin: 4px 12px 8px; height: 46px; }
.bsf-pop.is-sheet .bsf-search__in { font-size: 16px; }

/* the step before an act that cannot be undone (BSF.confirmStep, 19 November 2026): what goes as a quiet list, the way out
   (Export my data) as a quiet pill, the box to tick, then Cancel and a Continue drawn as a red line, not yet filled */
.bsf-ask__list { display: grid; gap: 6px; margin: 4px 0 14px; padding: 0; list-style: none; }
.bsf-ask__list > li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.45; color: var(--cl-ink-2); }
.bsf-ask__list > li::before { content: ''; position: absolute; top: .62em; left: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--cl-ink-4); }
.bsf-ask__input + .bsf-ask__label { margin-top: 14px; }   /* Your password, under the email */
.bsf-ask__aside { display: inline-flex; align-items: center; gap: 8px; height: 38px; margin: 0 0 14px; padding: 0 14px 0 12px; border: 1px solid var(--cl-line-2); border-radius: 999px; background: var(--cl-surface); color: var(--cl-ink); font: inherit; font-size: 14px; cursor: pointer; transition: background-color .16s var(--cl-out), border-color .16s var(--cl-out); }
.bsf-ask__aside > i { font-size: 16px; }
@media (hover: hover) { .bsf-ask__aside:hover { background: var(--cl-hover); border-color: var(--cl-line-3); } }
.bsf-ask__tick { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 16px; padding: 12px 14px; border: 1px solid var(--cl-line-2); border-radius: 12px; font-size: 14px; line-height: 1.45; color: var(--cl-ink-2); cursor: pointer; }
/* the box is drawn here, not the browser's: a rounded square that fills with ink and shows a tick */
.bsf-ask__tick > input { position: relative; flex: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid var(--cl-line-3); border-radius: 6px; background: var(--cl-surface); cursor: pointer; appearance: none; -webkit-appearance: none; transition: background-color .18s var(--cl-out), border-color .18s var(--cl-out); }
.bsf-ask__tick > input::after { content: ''; position: absolute; top: 4px; left: 3px; width: 11px; height: 9px; background: var(--cl-surface); clip-path: polygon(14% 44%, 0 59%, 39% 100%, 100% 21%, 86% 7%, 38% 70%); opacity: 0; scale: .6; transition: opacity .16s var(--cl-out), scale .28s var(--cl-spring); }
.bsf-ask__tick > input:checked { border-color: var(--cl-ink); background: var(--cl-ink); }
.bsf-ask__tick > input:checked::after { opacity: 1; scale: 1; }
.bsf-ask__tick > input:focus-visible { outline: 2px solid var(--cl-ink-3); outline-offset: 2px; }
.bsf-ask__tick:has(input:checked) { border-color: var(--cl-line-3); background: var(--cl-hover); }
.bsf-ask__btn--danger-line { border: 1px solid var(--cl-bad-ink) !important; background: transparent !important; color: var(--cl-bad-ink) !important; box-shadow: none !important; }
.bsf-ask__btn--danger-line:disabled { opacity: .45; cursor: default; }
@media (hover: hover) { .bsf-ask__btn--danger-line:not(:disabled):hover { background: color-mix(in srgb, var(--cl-bad-ink) 8%, transparent) !important; } }
@media (prefers-reduced-motion: reduce) { .bsf-ask__tick > input, .bsf-ask__tick > input::after { transition: none; } }
html.a11y-reduce-motion .bsf-ask__tick > input, html.a11y-reduce-motion .bsf-ask__tick > input::after { transition: none; }
