/* ============================================================================
   HRA SCHEDULER — "Book a call" / TALK-tile flow
   GOG Concierge Services — opening wedge. Prestige Through Restraint.
   ----------------------------------------------------------------------------
   SELF-CONTAINED. ZERO external dependencies (no CDN, no fonts fetched here).
   Scoped under .hra-sched so it CANNOT perturb the host page / conductor.
   All tokens mirror the live site :root (mockup.html lines 24-47) so the
   module inherits the brand exactly when embedded, AND stands alone when
   rendered in isolation (system-font fallbacks on every family).
   ============================================================================ */

/* Haze-on-load fix: the modal carries inline `display:grid`, which overrides the
   `hidden` attribute (inline display beats the UA `[hidden]{display:none}` rule).
   This guard makes `hidden` authoritative so the dimming/blur backdrop stays
   fully hidden until the TALK tile opens it. */
#hra-sched-modal[hidden] { display: none !important; }

.hra-sched {
  /* --- Brand tokens (EXTRACTED from mockup.html :root) --- */
  --sx-cinnabar: #E63B2E;
  --sx-cinnabar-bright: #ff5445;
  --sx-cinnabar-glow: rgba(230, 59, 46, 0.35);
  --sx-floral-white: #FFF8F0;
  --sx-floral-recede: rgba(255, 248, 240, 0.55);
  --sx-floral-faint: rgba(255, 248, 240, 0.30);
  --sx-luminous-white: #FFFFFF;
  --sx-corn-silk: #F5EAD0;
  --sx-grey-olive: #3B3A32;
  --sx-grey-olive-soft: #8B7355;
  --sx-black: #0A0908;
  --sx-void-center: #221C18;
  --sx-void-edge: #120E0B;

  /* Surfaces derived from the deep-stone palette */
  --sx-surface: rgba(255, 248, 240, 0.035);
  --sx-surface-hover: rgba(255, 248, 240, 0.06);
  --sx-surface-selected: rgba(230, 59, 46, 0.10);
  --sx-hairline: rgba(255, 248, 240, 0.12);
  --sx-hairline-strong: rgba(255, 248, 240, 0.22);

  /* Self-hosting-safe font stacks (same families the host loads; strong
     system fallbacks so the module never depends on a font fetch) */
  --sx-f-display: 'Mulish', Georgia, 'Times New Roman', serif;
  --sx-f-ui: 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sx-f-body: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* 8px spacing rhythm + z-scale (MOE: ui-ux-pro-max §5/§1) */
  --sx-z-base: 0;
  --sx-z-raised: 10;

  color: var(--sx-floral-white);
  font-family: var(--sx-f-body);
  font-size: 17px;            /* base bump — body/microcopy read comfortably, no straining */
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  line-height: 1.55;
}
.hra-sched *, .hra-sched *::before, .hra-sched *::after { box-sizing: border-box; }

/* ---- Shell (works as in-page section OR modal panel) ---- */
.hra-sched {
  width: 100%;
  max-width: 1040px;          /* more presence — commands the viewport, no longer floats small */
  margin: 0 auto;
  background:
    radial-gradient(120% 140% at 50% -20%, var(--sx-void-center) 0%, var(--sx-void-edge) 60%, var(--sx-black) 100%);
  border: 1px solid var(--sx-hairline);
  border-radius: 22px;
  padding: clamp(30px, 4.6vw, 64px);
  position: relative;
  overflow: hidden;
}
.hra-sched::before {
  /* whisper of cinnabar at the top edge — restraint, not decoration */
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--sx-cinnabar) 50%, transparent);
  opacity: 0.5;
}

/* ---- Header + step indicator (MOE: multi-step-progress) ---- */
.hra-sched__head { margin-bottom: clamp(20px, 3vw, 32px); }
.hra-sched__eyebrow {
  font-family: var(--sx-f-ui);
  font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--sx-cinnabar);
  margin: 0 0 12px;
}
.hra-sched__title {
  font-family: var(--sx-f-display); font-style: italic; font-weight: 700;
  font-size: clamp(32px, 4.6vw, 46px); line-height: 1.08; letter-spacing: -0.01em;
  margin: 0; color: var(--sx-floral-white);
}
.hra-sched__steps {
  display: flex; align-items: center; gap: 12px; margin-top: 22px;
  font-family: var(--sx-f-ui); font-size: 14px; letter-spacing: 0.03em;
}
.hra-sched__stepdot {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--sx-floral-recede); transition: color 200ms ease;
}
.hra-sched__stepdot .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sx-hairline-strong); transition: background 200ms ease, box-shadow 200ms ease;
}
.hra-sched__stepdot[data-active="true"] { color: var(--sx-floral-white); }
.hra-sched__stepdot[data-active="true"] .dot {
  background: var(--sx-cinnabar); box-shadow: 0 0 10px var(--sx-cinnabar-glow);
}
.hra-sched__steprule { flex: 0 0 34px; height: 1px; background: var(--sx-hairline); }

/* ============================ STEP PANELS ============================ */
.hra-sched__panel { display: none; }
.hra-sched__panel[data-show="true"] { display: block; animation: sx-fade 280ms ease both; }
@keyframes sx-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- STEP 1 — meeting-type cards ---- */
.hra-sched__cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 6px;
}
.hra-sched__card {
  appearance: none; -webkit-appearance: none; text-align: left; cursor: pointer;
  font-family: inherit; color: inherit;
  background: var(--sx-surface); border: 1px solid var(--sx-hairline);
  border-radius: 16px; padding: 26px 24px 24px;
  display: flex; flex-direction: column; gap: 13px; min-height: 168px;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease, transform 150ms ease;
}
.hra-sched__card:hover { background: var(--sx-surface-hover); border-color: var(--sx-hairline-strong); }
.hra-sched__card:active { transform: scale(0.985); }
.hra-sched__card:focus-visible {
  outline: 2px solid var(--sx-cinnabar-bright); outline-offset: 2px;
}
.hra-sched__card[aria-pressed="true"] {
  border-color: var(--sx-cinnabar); background: var(--sx-surface-selected);
  box-shadow: 0 0 0 1px var(--sx-cinnabar), 0 14px 34px var(--sx-cinnabar-glow);
}
.hra-sched__card-ico {
  width: 36px; height: 36px; color: var(--sx-floral-white);
}
.hra-sched__card[aria-pressed="true"] .hra-sched__card-ico { color: var(--sx-cinnabar-bright); }
.hra-sched__card-name {
  font-family: var(--sx-f-display); font-weight: 700; font-size: 23px; letter-spacing: -0.01em;
}
.hra-sched__card-sub { font-size: 16px; color: var(--sx-floral-recede); margin-top: -4px; }

/* ---- STEP 2 — calendar + time slots ---- */
.hra-sched__sched {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 36px; margin-top: 6px;
}
.hra-sched__cal { min-width: 0; }
.hra-sched__cal-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.hra-sched__cal-month {
  font-family: var(--sx-f-display); font-weight: 700; font-size: 21px; letter-spacing: -0.01em;
}
.hra-sched__cal-nav { display: flex; gap: 6px; }
.hra-sched__navbtn {
  appearance: none; cursor: pointer; width: 40px; height: 40px; border-radius: 10px;
  background: var(--sx-surface); border: 1px solid var(--sx-hairline);
  color: var(--sx-floral-white); display: grid; place-items: center;
  transition: background 180ms ease, border-color 180ms ease;
}
.hra-sched__navbtn:hover:not(:disabled) { background: var(--sx-surface-hover); border-color: var(--sx-hairline-strong); }
.hra-sched__navbtn:focus-visible { outline: 2px solid var(--sx-cinnabar-bright); outline-offset: 2px; }
.hra-sched__navbtn:disabled { opacity: 0.3; cursor: not-allowed; }

.hra-sched__dow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px;
}
.hra-sched__dow span {
  text-align: center; font-family: var(--sx-f-ui); font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--sx-floral-faint);
  padding: 6px 0;
}
.hra-sched__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

/* Day cell — the curated logic lives here. Three states:
   available (selectable) / unavailable (dimmed+disabled) / empty (blank pad) */
.hra-sched__day {
  appearance: none; font-family: var(--sx-f-ui); font-size: 16px;
  aspect-ratio: 1 / 1; border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--sx-floral-recede);
  display: grid; place-items: center; position: relative;
}
.hra-sched__day--empty { visibility: hidden; }

/* AVAILABLE: clearly selectable, hairline ring + subtle dot marker */
.hra-sched__day--available {
  cursor: pointer; color: var(--sx-floral-white);
  background: var(--sx-surface); border-color: var(--sx-hairline);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.hra-sched__day--available::after {
  content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--sx-cinnabar); opacity: 0.85;
}
.hra-sched__day--available:hover { background: var(--sx-surface-hover); border-color: var(--sx-cinnabar); }
.hra-sched__day--available:focus-visible { outline: 2px solid var(--sx-cinnabar-bright); outline-offset: 2px; }
.hra-sched__day[aria-selected="true"] {
  background: var(--sx-cinnabar); color: var(--sx-luminous-white); border-color: var(--sx-cinnabar);
  box-shadow: 0 10px 26px var(--sx-cinnabar-glow);
}
.hra-sched__day[aria-selected="true"]::after { background: var(--sx-luminous-white); opacity: 0.9; }

/* UNAVAILABLE: dimmed + non-interactive (the no-open-grid rule, MOE: disabled-states) */
.hra-sched__day--unavailable {
  cursor: not-allowed; color: var(--sx-floral-faint); opacity: 0.55;
}

.hra-sched__cal-note {
  margin-top: 18px; font-size: 14px; color: var(--sx-floral-recede); font-family: var(--sx-f-ui);
  display: flex; align-items: center; gap: 8px;
}
.hra-sched__cal-note .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--sx-cinnabar); }

/* Time-slot column */
.hra-sched__slots { min-width: 0; display: flex; flex-direction: column; }
.hra-sched__slots-head {
  font-family: var(--sx-f-ui); font-size: 14px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--sx-floral-recede); margin-bottom: 14px;
}
.hra-sched__tz {
  font-size: 14px; color: var(--sx-floral-recede); font-weight: 500;
  text-transform: none; letter-spacing: 0.01em; display: block; margin-top: 5px;
}
.hra-sched__slot-list { display: flex; flex-direction: column; gap: 10px; }
.hra-sched__slot {
  appearance: none; cursor: pointer; font-family: var(--sx-f-ui); font-size: 16px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: var(--sx-floral-white);
  background: var(--sx-surface); border: 1px solid var(--sx-hairline);
  border-radius: 12px; padding: 16px 18px; text-align: center; width: 100%;
  transition: background 180ms ease, border-color 180ms ease, color 160ms ease, box-shadow 180ms ease;
}
.hra-sched__slot:hover { background: var(--sx-surface-hover); border-color: var(--sx-cinnabar); }
.hra-sched__slot:focus-visible { outline: 2px solid var(--sx-cinnabar-bright); outline-offset: 2px; }
.hra-sched__slot[aria-pressed="true"] {
  background: var(--sx-cinnabar); color: var(--sx-luminous-white); border-color: var(--sx-cinnabar);
  box-shadow: 0 10px 26px var(--sx-cinnabar-glow);
}
.hra-sched__slots-empty {
  color: var(--sx-floral-recede); font-size: 15px; font-family: var(--sx-f-ui);
  padding: 18px 0; line-height: 1.6;
}

/* Back link inside step 2 */
.hra-sched__back {
  appearance: none; background: none; border: none; cursor: pointer;
  font-family: var(--sx-f-ui); font-size: 15px; color: var(--sx-floral-recede);
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 0; margin-bottom: 18px;
  transition: color 160ms ease;
}
.hra-sched__back:hover { color: var(--sx-floral-white); }
.hra-sched__back:focus-visible { outline: 2px solid var(--sx-cinnabar-bright); outline-offset: 2px; border-radius: 4px; }

/* ---- STEP 3 — Your details (white-glove, not a generic form) ---- */
.hra-sched__details-intro {
  font-family: var(--sx-f-body); font-size: 16px; color: var(--sx-floral-recede);
  margin: 0 0 24px; max-width: 60ch; line-height: 1.6;
}
.hra-sched__form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; margin-top: 2px;
}
.hra-sched__field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.hra-sched__field--full { grid-column: 1 / -1; }
.hra-sched__label {
  font-family: var(--sx-f-ui); font-size: 14px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--sx-floral-white); display: flex; align-items: baseline; gap: 8px;
}
.hra-sched__label .req { color: var(--sx-cinnabar); font-weight: 700; }
.hra-sched__label .opt {
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--sx-floral-faint);
}
.hra-sched__input {
  appearance: none; font-family: var(--sx-f-body); font-size: 16px; color: var(--sx-floral-white);
  background: var(--sx-surface); border: 1px solid var(--sx-hairline);
  border-radius: 12px; padding: 15px 17px; width: 100%; line-height: 1.4;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.hra-sched__input::placeholder { color: var(--sx-floral-faint); }
.hra-sched__input:hover { border-color: var(--sx-hairline-strong); }
.hra-sched__input:focus {
  outline: none; border-color: var(--sx-cinnabar); background: var(--sx-surface-hover);
  box-shadow: 0 0 0 3px var(--sx-cinnabar-glow);
}
.hra-sched__input--area { resize: vertical; min-height: 84px; }
/* gentle inline error — never harsh; Cinnabar-toned, quiet, appears only when present */
.hra-sched__input[aria-invalid="true"] { border-color: rgba(230, 59, 46, 0.55); }
.hra-sched__err {
  font-family: var(--sx-f-ui); font-size: 13px; color: var(--sx-cinnabar-bright);
  opacity: 0.92; letter-spacing: 0.01em;
}
.hra-sched__err:empty { display: none; }
.hra-sched__summary-for { color: var(--sx-floral-white); }

/* ---- Footer: summary line + confirm ---- */
.hra-sched__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  margin-top: clamp(28px, 3.6vw, 44px); padding-top: 28px;
  border-top: 1px solid var(--sx-hairline); flex-wrap: wrap;
}
.hra-sched__summary {
  font-family: var(--sx-f-ui); font-size: 16px; color: var(--sx-floral-recede);
  font-variant-numeric: tabular-nums; min-height: 22px;
}
.hra-sched__summary b { color: var(--sx-floral-white); font-weight: 600; }
.hra-sched__summary .sep { color: var(--sx-floral-faint); margin: 0 8px; }
.hra-sched__summary .placeholder { color: var(--sx-floral-faint); font-style: italic; }

.hra-sched__confirm {
  appearance: none; cursor: pointer; font-family: var(--sx-f-ui); font-weight: 600; font-size: 17px;
  letter-spacing: 0.02em; color: var(--sx-luminous-white);
  background: var(--sx-cinnabar); border: 1px solid var(--sx-cinnabar);
  border-radius: 13px; padding: 17px 32px; display: inline-flex; align-items: center; gap: 11px;
  transition: background 180ms ease, box-shadow 200ms ease, transform 150ms ease, opacity 180ms ease;
}
.hra-sched__confirm:hover:not(:disabled) {
  background: var(--sx-cinnabar-bright); box-shadow: 0 14px 34px var(--sx-cinnabar-glow);
}
.hra-sched__confirm:active:not(:disabled) { transform: scale(0.98); }
.hra-sched__confirm:focus-visible { outline: 2px solid var(--sx-floral-white); outline-offset: 3px; }
.hra-sched__confirm:disabled { opacity: 0.32; cursor: not-allowed; }
.hra-sched__confirm .arr { transition: transform 200ms ease; }
.hra-sched__confirm:hover:not(:disabled) .arr { transform: translateX(3px); }

/* aria-live status (visually hidden — for screen readers) */
.hra-sched__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Confirmation success state */
.hra-sched__done { text-align: center; padding: 12px 0 4px; animation: sx-fade 320ms ease both; }
.hra-sched__done-ico {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; color: var(--sx-cinnabar);
  background: var(--sx-surface-selected); border: 1px solid var(--sx-cinnabar);
}
.hra-sched__done h3 {
  font-family: var(--sx-f-display); font-style: italic; font-weight: 700;
  font-size: 32px; margin: 0 0 12px; color: var(--sx-floral-white);
}
.hra-sched__done p { color: var(--sx-floral-recede); font-size: 17px; max-width: 460px; margin: 0 auto; line-height: 1.6; }
.hra-sched__done .recap { margin-top: 22px; font-size: 17px; font-family: var(--sx-f-ui); font-variant-numeric: tabular-nums; color: var(--sx-floral-white); }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 760px) {
  .hra-sched__cards { grid-template-columns: 1fr; }
  .hra-sched__card { min-height: 0; flex-direction: row; align-items: center; gap: 16px; padding: 20px 22px; }
  .hra-sched__card-ico { flex: 0 0 auto; }
  .hra-sched__sched { grid-template-columns: 1fr; gap: 30px; }
  .hra-sched__foot { flex-direction: column-reverse; align-items: stretch; }
  .hra-sched__confirm { justify-content: center; width: 100%; }
  .hra-sched__summary { text-align: center; }
  /* day cells stay comfortably tappable but never overflow the narrow grid */
  .hra-sched__day { font-size: 17px; }
  /* details form collapses to a single column on mobile */
  .hra-sched__form { grid-template-columns: 1fr; gap: 18px; }
}

/* Respect reduced-motion (MOE: reduced-motion CRITICAL) */
@media (prefers-reduced-motion: reduce) {
  .hra-sched *, .hra-sched *::before, .hra-sched *::after {
    animation-duration: 0.01ms !important; transition-duration: 0.01ms !important;
  }
}
