/* Shared components: brand mark, buttons, fields, cards, badges, lists, flash messages. */

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand__mark { flex: none; display: block; }
.brand__name { font: 600 17px var(--font-display); letter-spacing: -0.01em; }
.brand__badge { margin-inline-start: auto; padding: 2px 7px; border-radius: 6px; background: var(--nav-active); font-size: 11px; font-weight: 700;
  color: var(--nav-muted); text-transform: uppercase; letter-spacing: 0.02em; }

/* Buttons: 48px tall in the client app (a sweaty thumb), 44px in the console. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--accent); color: #FFFFFF;
  font: 600 15px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:hover { background: var(--accent-ink); color: #FFFFFF; }
.button:disabled, .button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.button--block { display: flex; width: 100%; }
.button--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.button--secondary:hover { background: var(--canvas); color: var(--ink); }
.button--danger { background: var(--surface); color: var(--warn); border-color: var(--warn-line); }
.button--danger:hover { background: var(--warn-soft); color: var(--warn); }
.button--small { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.button--link { background: none; border: none; color: var(--accent); padding: 0; height: auto; font-weight: 600; }
.button--link:hover { background: none; color: var(--accent-ink); }
.button svg { flex: none; }
.icon-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13.5px; font-weight: 600; }
.field__hint { font-size: 13px; color: var(--ink-2); }
.field__error { font-size: 13px; color: var(--warn); font-weight: 600; }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 400 16px var(--font); /* 16px stops iOS zooming into the field */
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input--code { font: 600 26px/1 var(--font-display); letter-spacing: 0.3em; text-align: center; height: 60px; }
.field--invalid .input { border-color: var(--warn); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px;
}
.card--flush { padding: 0; overflow: hidden; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card__body { padding: 16px 20px; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--line-soft); color: #343A40;
}
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--info { background: var(--accent-soft); color: var(--accent-ink); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--tag { width: 104px; text-transform: uppercase; }

.pill {
  display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--line-soft); color: var(--ink-2);
}
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--accent { background: var(--accent); color: #FFFFFF; }
.pill--bad { background: var(--bad-soft); color: var(--bad); }
.pill--draft { background: var(--line-soft); color: var(--ink-2); }
.pill--soft { background: var(--accent-soft); color: var(--accent-ink); }
.input--ai { background: #F7F9FE; border-color: var(--accent-line); }
.input--narrow { width: 100px; }

.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft);
}
.list__item:last-child { border-bottom: none; }
.list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list__title { font-size: 14.5px; font-weight: 600; }
.list__detail { font-size: 13px; color: var(--ink-2); }
.list__empty { padding: 20px; color: var(--ink-2); font-size: 14px; }

.flash {
  border-radius: var(--radius); padding: 12px 14px; font-size: 14px; font-weight: 500;
  background: var(--ok-soft); color: var(--ok); border: 1px solid #BFE0CC;
}
.flash--alert { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }

.checkbox { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.checkbox input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.icon-circle {
  width: 32px; height: 32px; border-radius: 16px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.icon-circle--done { background: var(--ok-soft); color: var(--ok); }
.icon-circle--current { background: var(--accent); color: #FFFFFF; }
.icon-circle--locked { border: 1.5px solid var(--line-strong); color: var(--ink-3); font-weight: 600; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; }

.qr svg { width: 200px; height: 200px; display: block; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }

/* Demo server (DEMO_MODE=1): a banner on every page and the sign-in code shown on screen. */
.demo-banner { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn-line); padding: 8px 16px; font-size: 13.5px; font-weight: 600; text-align: center; }
.demo-code { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid var(--warn-line); font-size: 14px; }
.demo-code__value { font: 600 26px/1.1 var(--font-display); letter-spacing: 0.12em; color: var(--ink); }

/* Shared helpers added in M1. */
.center { text-align: center; align-self: center; }
.input--area { height: auto; min-height: 64px; padding: 10px 12px; resize: vertical; line-height: 20px; font: 400 15px/20px var(--font); }
.input--small { height: 38px; font-size: 14px; padding: 0 10px; }
textarea.input--small { height: auto; }
.input--file { height: auto; padding: 10px; }
.button--tiny { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--radius-s); }
.bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 20px; color: var(--ink-2); }

/* Yes / No (and Pass / Fail) as two large toggles. */
.yes-no { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.yes-no__option { position: relative; display: block; cursor: pointer; }
.yes-no__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.yes-no__option span {
  display: flex; align-items: center; justify-content: center; height: 48px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); font: 600 15px var(--font);
}
.yes-no__option input:checked + span { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.yes-no__option input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.yes-no--small { width: 180px; }
.yes-no--small .yes-no__option span { height: 38px; font-size: 14px; }

/* Chat bubbles (intake chat and the coach's transcript). */
.bubble { max-width: 300px; padding: 10px 14px; font-size: 15px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble--them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; }
.bubble--me { align-self: flex-end; background: var(--accent); color: #FFFFFF; border-radius: 16px 16px 4px 16px; }
.bubble--small { font-size: 14px; line-height: 20px; max-width: 92%; }
.bubble--typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.bubble--typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); animation: typing 1.2s infinite ease-in-out; }
.bubble--typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble--typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .bubble--typing span { animation: none; opacity: 0.6; } }
.stack > .badge, .stack > .pill { align-self: flex-start; }
.checkbox--small { gap: 8px; font-size: 13px; color: var(--ink-2); align-items: center; }
.checkbox--small input { width: 18px; height: 18px; margin: 0; }

/* Weekly report goals, photo slots (shared by coach and client). */
.goal-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.goal-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.photo-slot__label { height: 96px; border-radius: var(--radius); border: 1.5px dashed var(--ink-4); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 500 13px var(--font); color: var(--ink-2); cursor: pointer; }
.photo-slot.is-uploading .photo-slot__label { opacity: 0.5; }
.photo-thumb img { width: 100%; height: 110px; object-fit: cover; border-radius: var(--radius-s); display: block; }
.answers-dl { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; font-size: 13.5px; }
.answers-dl dt { color: var(--ink-2); }
.answers-dl dd { margin: 0; }
.guide summary { cursor: pointer; }

/* Booking: slot pickers (client and public) and Jake's setup. */
.slot-day { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.slot-grid .yes-no__option span { height: 42px; font-size: 14px; }
.sticky-action { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--canvas) 30%); }
.type-form { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.type-form:last-child { border-bottom: none; }
.type-form__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
form.type-form__grid { grid-template-columns: 1.4fr 1fr 1fr auto; }

/* Weekly report, shared by CL-17 and CO-18. */
.back-link { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.icon-button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-button:hover { color: var(--bad); border-color: var(--bad-line); }
.align-start { align-self: flex-start; }
.goal-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.goal-items li { display: flex; align-items: center; gap: 12px; }
.goal-items__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: flex;
  align-items: center; justify-content: center; flex: none; }
.goal-items__text { display: flex; flex-direction: column; }
.goal-items__title { font-size: 15px; font-weight: 600; }
.summary-part { display: flex; flex-direction: column; gap: 4px; }
.summary-part p { margin: 0; font-size: 14.5px; line-height: 21px; }
.summary-part__label { font-size: 13px; font-weight: 700; }
.summary-part__label--ok { color: var(--ok); }
.summary-part__label--warn { color: var(--warn); }
.summary-part__label--accent { color: var(--accent-ink); }
.comment { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius); background: var(--canvas-coach); font-size: 14.5px; line-height: 20px; }
.comment--coach { background: var(--accent-soft); }
.comment__meta { font-size: 12.5px; color: var(--ink-2); }
.comment__meta strong { color: var(--ink); }

/* S4: upload slots, refusals and files (CL-13, CL-3). */
.weight-400 { font-weight: 400; }
.photo-grid--slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-grid--slots .photo-slot__label { height: 150px; font-weight: 600; font-size: 13.5px; }
.photo-slot--error .photo-slot__label { border: 2px dashed #D9534F; color: var(--bad); }
.photo-slot__retry { font-weight: 500; font-size: 12.5px; }
.photo-tile { position: relative; display: block; height: 150px; border-radius: var(--radius); overflow: hidden; background: var(--line); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile__tag { position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.9);
  font-size: 12.5px; font-weight: 600; color: var(--ink); }
.upload-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft);
  border: 1px solid var(--bad-line); color: var(--bad); font-size: 13.5px; line-height: 19px; }
.upload-alert svg { flex: none; margin-top: 1px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2); }
.file-row__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.file-row__title { font-size: 14px; font-weight: 600; color: var(--ink); }
.button--error { border-color: var(--bad-line); color: var(--bad); }
.input--error { border-color: var(--bad); }
label.button { cursor: pointer; }

/* A field a coach still needs to fill in to go live (CO-21). */
.input--needed { border: 2px solid var(--badge); }
.input--mono { font: 14px/22px ui-monospace, SFMono-Regular, Menlo, monospace; }
