/* The layout of the onboarding wizard. Everything shared with the rest of the site (the tokens, the buttons, the fields, the cards, the badges, the notices, the tables, the stepper and both themes) comes from
   ci.css, and the accent of the hospital's template is set by an accent class on the body, so this file only holds the few shapes that belong to the wizard: the page columns, the template cards, the
   schedule, the preview of what Talk may say, the progress of the first visit and the phone bubble. It uses the same tokens and the same radius as every other page. */

/* ---- the columns of a step: one column for a form, or a form beside a side panel ---- */
.wiz { display: grid; gap: var(--space-4); min-width: 0; }
.wiz > .stepper-nav, .wiz > .form-actions { margin: 0; }
.wiz-split { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.wiz-side { display: grid; gap: var(--space-4); min-width: 0; }
@media (min-width: 1000px) {
  .wiz-split { grid-template-columns: minmax(0, 1fr) 380px; }
  .wiz-split > .wiz-side { position: sticky; top: calc(var(--header-h) + var(--space-4)); max-height: calc(100vh - var(--header-h) - var(--space-6)); overflow-y: auto; }
}
.stage { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.onboard .form-actions { margin-top: var(--space-2); }

/* a fieldset that only groups controls has no frame of its own, because the card around it is the frame */
fieldset.bare { padding: 0; border: 0; }
fieldset.services { margin-top: var(--space-4); }
fieldset.has-error { border-color: var(--danger); border-width: 2px; }
.check-grid { display: grid; gap: 0 var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.check-list { display: grid; }
.onboard .field-error { margin-top: var(--space-2); }

/* ---- the first page: the template cards ---- */
.resume { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; justify-content: space-between; }
.resume > div { display: grid; }
.templates { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 880px) { .templates { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
label.template { position: relative; display: grid; align-content: start; gap: var(--space-1); margin: 0; padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow-1); cursor: pointer; transition: border-color var(--dur), background-color var(--dur); font-size: var(--fs-md); font-weight: 400; }
label.template:hover { border-color: var(--accent-text); border-top-color: var(--accent); }
label.template:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-text); }
label.template:has(input:focus-visible) { outline: var(--ring); outline-offset: var(--ring-offset); }
label.template input { position: absolute; top: var(--space-4); right: var(--space-4); }
.tpl-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--space-2); border-radius: var(--radius); background: var(--accent); color: var(--on-accent); }
.tpl-mark .mark-svg { width: 28px; height: 28px; }
.tpl-title { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 600; color: var(--text); padding-right: var(--space-6); }
.tpl-name { color: var(--text-2); }
.tpl-facts { margin-top: var(--space-2); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }

/* ---- facts and the masked secret ---- */
dl.facts { display: grid; margin: 0 0 var(--space-4); max-width: none; }
dl.facts > div { display: grid; gap: var(--space-1) var(--space-4); grid-template-columns: minmax(0, 1fr); padding: var(--space-2) 0; border-top: 1px solid var(--border); }
dl.facts > div:first-child { border-top: 0; }
@media (min-width: 640px) { dl.facts > div { grid-template-columns: 160px minmax(0, 1fr); } }
dl.facts dt { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.secret-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.secret-row input { flex: 1 1 240px; min-width: 0; font-family: var(--mono); letter-spacing: 1px; }

/* ---- the result of the connection test ---- */
.result { margin-bottom: var(--space-4); }
.result:focus { outline: none; }
ul.checks { list-style: none; margin: 0; padding: 0; max-width: none; display: grid; gap: var(--space-2); }
.check-result { display: grid; gap: var(--space-1); margin: 0; padding: var(--space-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.check-head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

/* ---- the schedule and the guide ---- */
.table.schedule select { width: auto; min-width: 96px; min-height: var(--control-sm); padding-block: var(--space-1); }
.table.schedule td { vertical-align: middle; }
.table.schedule .check { min-height: var(--control-sm); font-size: var(--fs-sm); }
/* on a phone a day is one small block: its name, then the opening and the closing time side by side, then the box that closes the day */
@media (max-width: 639px) {
  .table.schedule tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1) var(--space-3); padding: var(--space-3); }
  .table.schedule td { display: grid; gap: var(--space-1); padding: 0; text-align: left; }
  .table.schedule td[data-label="Day"], .table.schedule td[data-label="Closed"] { grid-column: 1 / -1; }
  .table.schedule td[data-label="Day"]::before, .table.schedule td[data-label="Closed"]::before { display: none; }
  .table.schedule select { width: 100%; }
}
.schedule-extras { margin-top: var(--space-4); align-items: end; }
.entries { display: grid; gap: var(--space-4); }
.entry { display: grid; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.entry:first-child { padding-top: 0; border-top: 0; }

/* ---- the preview: what the caller says and what Talk may say in answer ---- */
ul.say-list { list-style: none; margin: 0; padding: 0; max-width: none; display: grid; gap: var(--space-3); }
.say { margin: 0; padding: var(--space-3); background: var(--surface-2); border-radius: var(--radius); }
.say h3 { margin: 0 0 var(--space-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.say .line { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: var(--space-2); margin: 0 0 var(--space-1); max-width: none; font-size: var(--fs-sm); line-height: var(--lh-sm); overflow-wrap: anywhere; }
.say .line:last-child { margin-bottom: 0; }
.say .line .who { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); }
.say .line.talk { color: var(--text); }

/* ---- the first visit: four things that must happen, then the front desk beside the conversation ---- */
ol.progress-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; max-width: none; }
@media (min-width: 720px) { ol.progress-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
ol.progress-list li { display: flex; gap: var(--space-3); align-items: center; margin: 0; padding: var(--space-2) var(--space-3); min-height: var(--control); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; }
ol.progress-list .dot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--border-strong); border-radius: var(--radius-pill); font-size: var(--fs-xs); line-height: 1; }
ol.progress-list li.next { color: var(--text); border-color: var(--accent-text); }
ol.progress-list li.next .dot { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
ol.progress-list li.done { color: var(--text); }
ol.progress-list li.done .dot { border-color: var(--success); color: var(--success); }
#text-card { margin-top: var(--space-4); }
.desk-frame { display: block; width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
@media (max-width: 719px) { .desk-frame { height: 560px; } }
.phone-card { max-width: 420px; margin: var(--space-4) 0 0; padding: var(--space-4); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.phone-card .head { display: flex; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-2); max-width: none; font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--text-3); }
.phone-card .bubble { margin: 0 0 var(--space-2); padding: var(--space-3) var(--space-4); max-width: none; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); overflow-wrap: anywhere; }
.phone-card .delivery { margin: 0; max-width: none; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.glimpse { margin: 0 0 var(--space-2); padding: var(--space-3) var(--space-4); max-width: none; border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface-2); }

/* ---- the summary ---- */
ol.timeline { list-style: none; margin: 0 0 var(--space-4); padding: 0; max-width: none; }
ol.timeline li { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); justify-content: space-between; margin: 0; padding: var(--space-2) 0; border-top: 1px solid var(--border); }
ol.timeline li:first-child { border-top: 0; }
.replay details { border-top: 1px solid var(--border); }
.replay details:last-of-type { border-bottom: 1px solid var(--border); }
.replay summary span { min-width: 0; overflow-wrap: anywhere; }
.replay .turn-words { margin: 0 0 var(--space-2); max-width: none; color: var(--text-2); }
.stack-actions { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.restart { display: flex; }

@media print { .form-actions, .desk-frame { display: none; } }
.entry textarea { min-height: 80px; }
