/*
 * The Appointment calendar (Appointment bookings, Phase 1 step 3b, 05/11/2026) - the look of public/js/lxf-appointment.js.
 * Shared by the Classic and the Smart form. The accent follows the Smart form's own colour (--lxsf-accent) and can be set
 * with --lxfa-accent on a Classic form. Works down to 320px wide.
 *
 * Smart form (16/11/2026): its Design panel has an "Appointment calendar" group that writes the --lxsf-appt-* variables below; each one's
 * fallback is the look this sheet always had, so a form that never touches the group looks exactly as before. A Classic form has no
 * Design panel: its customer writes CSS over the .lxfa-* classes (or sets --lxfa-accent) and the variables are simply not there.
 */
.lxfa, .lxfa * { box-sizing: border-box; }
.lxfa {
    --lxfa-accent: var(--lxsf-appt-accent, var(--lxsf-accent, #0a7d44));
    --lxfa-on-accent: var(--lxsf-appt-accent-text, #fff);   /* the text on a chosen day or time */
    --lxfa-text: var(--lxsf-text, #1e293b);
    --lxfa-muted: #64748b;
    --lxfa-line: #d8dee8;
    --lxfa-radius: 10px;
    width: 100%;
    /* The calendar itself (the month grid, the one that opens under the picker, the Next 7 days strip) stays 440px: stretched across a whole form its
       cells get huge (owner, 17/11/2026). I had made it 100% for a moment; only the picker BOX is full width (.lxfa-pick below). */
    max-width: var(--lxsf-appt-max-width, 440px);
    padding: 12px;
    color: var(--lxfa-text);
    background: var(--lxsf-appt-bg, #fff);
    border-top: var(--lxsf-appt-border-top, 1px solid var(--lxfa-line));
    border-right: var(--lxsf-appt-border-right, 1px solid var(--lxfa-line));
    border-bottom: var(--lxsf-appt-border-bottom, 1px solid var(--lxfa-line));
    border-left: var(--lxsf-appt-border-left, 1px solid var(--lxfa-line));
    border-radius: var(--lxsf-appt-radius, 14px);
    font: inherit;
    text-align: left;
}
.lxfa.is-closed .lxfa-grid, .lxfa.is-closed .lxfa-head { opacity: .45; pointer-events: none; }

.lxfa-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.lxfa-title { flex: 1 1 auto; min-width: 0; text-align: center; font-size: 15px; font-weight: 700; line-height: 1.3; }
.lxfa-nav {
    flex: 0 0 auto; width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; line-height: 1; color: var(--lxfa-text); background: #f8fafc; border: 1px solid var(--lxfa-line);
    border-radius: 999px; cursor: pointer;
}
.lxfa-nav:hover:not(:disabled) { border-color: var(--lxfa-accent); color: var(--lxfa-accent); }
.lxfa-nav:disabled { opacity: .35; cursor: default; }
.lxfa button:focus-visible { outline: 2px solid var(--lxfa-accent); outline-offset: 2px; }

.lxfa-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.lxfa-wd { padding: 4px 0; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--lxfa-muted); }
.lxfa-day {
    position: relative; min-width: 0; aspect-ratio: 1 / 1; max-height: 52px; padding: 0; display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center; font: inherit; font-size: 14px; font-weight: 600; color: var(--lxsf-appt-day-text, var(--lxfa-text));
    background: var(--lxsf-appt-day-bg, #fff); border: 1px solid transparent; border-radius: var(--lxsf-appt-day-radius, var(--lxfa-radius)); cursor: pointer;
}
/* .lxfa-day:hover:not(.is-off) { ... }   (until 13/11/2026: it also hit a CHOSEN day under the mouse, which then turned white text on white) */
.lxfa-day:hover:not(.is-off):not(.is-chosen) { border-color: var(--lxfa-accent); background: color-mix(in srgb, var(--lxfa-accent) 8%, #fff); }
.lxfa-day.is-out { opacity: .4; }
.lxfa-day.is-off { color: #a3aebd; background: #f1f4f8; cursor: not-allowed; font-weight: 500; }
.lxfa-day.is-today::after { content: ''; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.lxfa-day.is-chosen { color: var(--lxfa-on-accent); background: var(--lxfa-accent); border-color: var(--lxfa-accent); }
/* Date range (Phase 5): the dates between the first and the last, in a light wash of the accent */
.lxfa-day.is-in { color: var(--lxfa-accent); background: color-mix(in srgb, var(--lxfa-accent) 14%, #fff); border-color: transparent; }
.lxfa-len.is-hint { color: #b42318; }
.lxfa-grid--strip .lxfa-day { aspect-ratio: auto; max-height: none; padding: 8px 0; gap: 2px; }
.lxfa-dow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; opacity: .75; }
.lxfa-num { font-size: 16px; font-weight: 700; }

.lxfa-msg { display: none; margin: 10px 0 0; padding: 9px 11px; font-size: 13px; line-height: 1.4; color: var(--lxfa-muted); background: #f8fafc; border-radius: var(--lxfa-radius); }
.lxfa-msg.is-on { display: block; }
.lxfa-msg.is-error { color: #b42318; background: #fef3f2; }
.lxfa-retry { padding: 0; font: inherit; font-weight: 700; color: inherit; background: none; border: 0; text-decoration: underline; cursor: pointer; }

.lxfa-slots { margin-top: 12px; }
.lxfa-slots-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
/* Time only: the day, where the calendar would be. */
.lxfa-dayline { margin: 0 0 10px; font-size: 15px; font-weight: 700; line-height: 1.3; }
.lxfa-dayline:empty { display: none; }
/* Time only hides the calendar with the hidden attribute; the head and the grid set their own display, so say it once more here. */
.lxfa-head[hidden], .lxfa-grid[hidden] { display: none; }
.lxfa-none { padding: 9px 11px; font-size: 13px; color: var(--lxfa-muted); background: #f8fafc; border-radius: var(--lxfa-radius); }
/* A Date range with times (16/11/2026): the start time of the first day and the end time of the last, side by side (stacked when narrow). */
.lxfa-tpick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lxfa-tfield { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.lxfa-tlabel { font-size: 12px; font-weight: 600; color: var(--lxfa-muted); }
.lxfa-tselect { width: 100%; height: 40px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--lxfa-text); background: #fff; border: 1px solid var(--lxfa-line); border-radius: var(--lxfa-radius); }
.lxfa-tselect:focus { outline: 2px solid var(--lxfa-accent); outline-offset: 1px; border-color: var(--lxfa-accent); }
.lxfa-tpick + .lxfa-none { margin-top: 8px; }
@media (max-width: 360px) { .lxfa-tpick { grid-template-columns: 1fr; } }
.lxfa-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.lxfa-slot {
    padding: 8px 4px; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; font-size: 14px; font-weight: 600;
    font-variant-numeric: tabular-nums; color: var(--lxsf-appt-slot-text, var(--lxfa-text)); background: var(--lxsf-appt-slot-bg, #fff);
    border: 1px solid var(--lxsf-appt-slot-border, var(--lxfa-line)); border-radius: var(--lxsf-appt-slot-radius, var(--lxfa-radius)); cursor: pointer;
}
.lxfa-slot:hover { border-color: var(--lxfa-accent); color: var(--lxfa-accent); }
.lxfa-slot.is-chosen { color: var(--lxfa-on-accent); background: var(--lxfa-accent); border-color: var(--lxfa-accent); }
.lxfa-left { font-size: 10.5px; font-weight: 600; opacity: .8; }
.lxfa-more { margin-top: 8px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--lxfa-accent); background: none; border: 1px solid var(--lxfa-line); border-radius: 999px; cursor: pointer; }
.lxfa-more:hover { border-color: var(--lxfa-accent); }
.lxfa-zone { margin-top: 10px; font-size: 12px; color: var(--lxfa-muted); }
.lxfa-len { margin-top: 8px; font-size: 13px; font-weight: 600; }
.lxfa-zone:empty, .lxfa-picked:empty, .lxfa-len:empty { display: none; }
.lxfa-picked { margin-top: 8px; padding: 8px 11px; font-size: 13px; font-weight: 600; color: var(--lxfa-accent); background: color-mix(in srgb, var(--lxfa-accent) 9%, #fff); border-radius: var(--lxfa-radius); }

@media (max-width: 360px) {
    .lxfa { padding: 8px; }
    .lxfa-day { font-size: 13px; }
    .lxfa-times { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
    .lxfa-day, .lxfa-slot, .lxfa-nav { transition: background-color .12s, border-color .12s, color .12s; }
}

/*
 * The compact picker (calendar: 'picker', 09/11/2026): a box like the form's other inputs that opens the month calendar under
 * it. It opens in the page's flow, not as a floating layer, so a Smart step or an iframe edge never clips it.
 */
/* The picker box is full width like the form's other fields (was max-width: var(--lxsf-appt-max-width, 440px)); the calendar that opens under it keeps its own 440px (.lxfa). */
.lxfa-pick { width: 100%; max-width: var(--lxsf-appt-max-width, 100%); }
/* The Smart form keeps its 440px picker: one question at a time reads better narrow. Its Design panel value still wins (the variable). */
.lxsf-appointment .lxfa-pick { max-width: var(--lxsf-appt-max-width, 440px); }
.lxfa-trigger {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; font: inherit; font-size: 15px; text-align: left;
    color: var(--lxsf-text, #1e293b); background: #fff; border: 1px solid #d8dee8; border-radius: 10px; cursor: pointer;
}
.lxfa-trigger:hover { border-color: var(--lxsf-accent, #0a7d44); }
.lxfa-trigger:focus-visible { outline: 2px solid var(--lxsf-accent, #0a7d44); outline-offset: 2px; }
.lxfa-trigger:disabled { cursor: not-allowed; opacity: .65; }
.lxfa-trigger-ico { flex: 0 0 auto; color: var(--lxsf-accent, #0a7d44); }
.lxfa-trigger-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lxfa-trigger-text.is-empty { font-weight: 400; color: #64748b; }
.lxfa-trigger-caret { flex: 0 0 auto; color: #64748b; transition: transform .15s; }
.lxfa-pick.is-open .lxfa-trigger { border-color: var(--lxsf-accent, #0a7d44); }
.lxfa-pick.is-open .lxfa-trigger-caret { transform: rotate(180deg); }
/* The calendar under the picker (17/11/2026): smaller than the 440px month grid, and it FLOATS over the page (absolute) so the fields below do not move.
   (It opened upward near the bottom of the page until 18/11/2026; off for the 26 KB budget.) Was: .lxfa.lxfa--drop { margin-top: 6px; box-shadow: ... } in the flow. */
.lxfa-pick { position: relative; }
.lxfa.lxfa--drop {
    position: absolute; left: 0; top: calc(100% + 6px); z-index: 50; padding: 10px;
    width: var(--lxsf-appt-max-width, 320px); max-width: 100%; box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}
/* Opening upward is off (18/11/2026, the 26 KB budget): .lxfa.lxfa--drop.lxfa--up { top: auto; bottom: calc(100% + 6px); } */
.lxfa--drop .lxfa-day { max-height: 40px; font-size: 13px; }
/* .lxfa--drop .lxfa-nav { width: 30px; height: 30px; }   (18/11/2026: dropped for the 26 KB budget; the arrows keep their 34px) */
/* The Smart form card hides what sticks out of it (.lxsf-app { overflow: hidden }), so there the calendar stays in the flow, only smaller. */
/* Was (17/11/2026): ... { position: static; width: 100%; max-width: var(--lxsf-appt-max-width, 320px); margin-top: 6px; box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
   Trimmed for the 26 KB budget (18/11/2026): the floating rule's width already fits, and its shadow stays. */
.lxsf-appointment .lxfa.lxfa--drop { position: static; margin-top: 6px; }
.lxfa[hidden] { display: none !important; }
