/* ==========================================================================
   T&TJets International - shared form widgets: calendar date picker + searchable drop-down.
   Used by the website forms and the Crew Portal.  Colours follow the page's own
   --red / --ink / --line variables when present and fall back to the brand palette.
   ========================================================================== */

.ttdp-wrap, .ttcb-wrap { position: relative; display: block; }
.ttdp-wrap > input, .ttcb-wrap > input { width: 100%; }
.ttdp-wrap > input { padding-right: 46px; }
.ttcb-wrap > input { padding-right: 38px; }

.ttdp-btn, .ttcb-caret {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--ttw-muted, #5B666C); cursor: pointer; border-radius: 4px; padding: 0;
}
.ttdp-btn { right: 6px; width: 36px; height: 36px; }
.ttcb-caret { right: 6px; width: 28px; height: 28px; }
.ttdp-btn:hover, .ttcb-caret:hover { color: var(--ttw-accent, var(--red, #C0142F)); background: rgba(14, 27, 34, .05); }
.ttdp-btn:focus-visible, .ttcb-caret:focus-visible { outline: 2px solid var(--ttw-accent, var(--red, #C0142F)); outline-offset: 1px; }
.ttdp-input.is-invalid { border-color: var(--ttw-err, #B3122B) !important; }
.ttdp-err { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.35; color: var(--ttw-err, #B3122B); }
.ttdp-err[hidden] { display: none; }

/* ------------------------------------------------------------ calendar popup */
.ttdp-pop {
  position: fixed; z-index: 100000; width: 296px; box-sizing: border-box; padding: 12px 12px 10px;
  background: #fff; color: var(--ttw-ink, #101B21); border: 1px solid var(--ttw-line, #D6D9D2); border-radius: 8px;
  box-shadow: 0 12px 34px rgba(14, 27, 34, .22), 0 2px 6px rgba(14, 27, 34, .10);
  font: 14px/1.3 var(--body, 'Inter', -apple-system, 'Segoe UI', sans-serif);
}
.ttdp-pop *, .ttdp-pop *::before, .ttdp-pop *::after { box-sizing: border-box; }
.ttdp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.ttdp-mid { flex: 1; display: flex; gap: 6px; min-width: 0; }
.ttdp-nav {
  flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; border-radius: 6px; color: inherit; cursor: pointer; padding: 0;
}
.ttdp-nav:hover:not(:disabled) { background: #F1F2EF; border-color: var(--ttw-line, #D6D9D2); }
.ttdp-nav:disabled { opacity: .3; cursor: default; }
.ttdp-sel {
  flex: 1; min-width: 0; height: 34px; padding: 0 6px; font: inherit; font-weight: 600; color: inherit; background: #fff;
  border: 1px solid var(--ttw-line, #D6D9D2); border-radius: 6px; cursor: pointer;
}
.ttdp-sel.ttdp-year { flex: 0 0 76px; }
.ttdp-nav:focus-visible, .ttdp-sel:focus-visible, .ttdp-day:focus-visible, .ttdp-link:focus-visible { outline: 2px solid var(--ttw-accent, var(--red, #C0142F)); outline-offset: 1px; }
.ttdp-dow, .ttdp-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.ttdp-dow span { text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--ttw-muted, #5B666C); padding: 4px 0 6px; text-transform: uppercase; }
.ttdp-grid { min-height: 228px; }
.ttdp-blank { height: 36px; }
.ttdp-day {
  height: 36px; margin: 1px; border: 0; background: transparent; border-radius: 6px; font: inherit; font-size: 14px; color: inherit; cursor: pointer; padding: 0;
  font-variant-numeric: tabular-nums;
}
.ttdp-day:hover:not(:disabled) { background: #F1F2EF; }
.ttdp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--ttw-accent, var(--red, #C0142F)); font-weight: 700; }
.ttdp-day.is-sel, .ttdp-day.is-sel:hover { background: var(--ttw-accent, var(--red, #C0142F)); color: #fff; font-weight: 700; }
.ttdp-day.is-off { opacity: .28; cursor: default; }
.ttdp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ttw-line, #E7E9E3); }
.ttdp-link { border: 0; background: transparent; color: var(--ttw-accent, var(--red, #C0142F)); font: inherit; font-weight: 600; padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.ttdp-link:hover:not(:disabled) { background: rgba(192, 20, 47, .08); }
.ttdp-link:disabled { color: #9aa0a4; cursor: default; }
.ttdp-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ttdp-backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(14, 27, 34, .45); }
.ttdp-pop.ttdp-sheet {
  left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; border-radius: 14px 14px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-width: 1px 0 0;
}
.ttdp-sheet .ttdp-day, .ttdp-sheet .ttdp-blank { height: 42px; }
.ttdp-sheet .ttdp-grid { min-height: 264px; }

/* ----------------------------------------------------------- searchable list */
.ttcb-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  max-height: min(340px, 52vh); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; color: var(--ttw-ink, #101B21); border: 1px solid var(--ttw-line, #D6D9D2); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(14, 27, 34, .20); text-align: left;
}
.ttcb-list[hidden] { display: none; }
.ttcb-group { position: sticky; top: -4px; z-index: 1; margin: 0 -4px; padding: 6px 12px 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ttw-muted, #5B666C); background: #F6F7F4; border-bottom: 1px solid #ECEEE8; }
.ttcb-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14.5px; line-height: 1.3; }
.ttcb-opt.is-active { background: #F1F2EF; box-shadow: inset 3px 0 0 var(--ttw-accent, var(--red, #C0142F)); }
.ttcb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ttcb-label { font-weight: 600; overflow-wrap: anywhere; }
.ttcb-sub { font-size: 12.5px; color: var(--ttw-muted, #5B666C); overflow-wrap: anywhere; }
.ttcb-tag { flex: none; font: 600 12px/1 var(--mono, 'IBM Plex Mono', Consolas, monospace); letter-spacing: .02em; padding: 5px 7px; border-radius: 4px; background: #E9EBE5; color: #26343b; white-space: nowrap; }
.ttcb-list mark { background: rgba(232, 185, 59, .45); color: inherit; border-radius: 2px; padding: 0 1px; }
.ttcb-free .ttcb-label { color: var(--ttw-accent, var(--red, #C0142F)); }
.ttcb-empty, .ttcb-more { padding: 10px 12px; font-size: 13px; color: var(--ttw-muted, #5B666C); }
.ttcb-more { text-align: center; border-top: 1px solid #ECEEE8; margin-top: 4px; }

@media (max-width: 520px) {
  .ttcb-list { max-height: 46vh; }
  .ttcb-opt { padding: 10px 10px; }
}
