/*
 * The $27 Coach, in the member app's branding (src/web/app.css): same tokens,
 * same fonts, same buttons, same message style. Andrea, 2026-12-04: "branded
 * the same as the app". Gold appears once per screen in the app; here it is the
 * countdown and the Platinum strip, which she saw in the mockup.
 */

@font-face { font-family: 'Montserrat'; font-weight: 900; font-display: swap; src: url('/fonts/montserrat-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('/fonts/poppins-latin-700-normal.woff2') format('woff2'); }

:root {
  --surface-page: #fffee6;
  --surface-raised: #fffffa;
  --surface-sunken: #f6f4d8;
  --surface-invert: #0a3a42;
  --ink-strong: #0a3a42;
  --ink-body: #3f3a2e;
  --ink-muted: #6f6a5c;
  --ink-faint: #9b9686;
  --ink-on-invert: #fffee6;
  --action: #008080;
  --action-strong: #006a6a;
  --accent-gold: #e7a81e;
  --accent-rust-text: #a8490f;
  --line: #ddd9b8;
  --line-strong: #c3bf9c;
  --font-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--surface-page);
  color: var(--ink-body);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; color: var(--ink-strong); margin: 0 0 8px; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { display: block; margin: 0 0 4px; font: 700 12px/1.3 var(--font-body); letter-spacing: 2.6px; text-transform: uppercase; color: var(--accent-rust-text); }
.muted, .note { color: var(--ink-muted); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; min-height: 44px; border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--action); color: #fff; font: 700 15px/1.2 var(--font-body); cursor: pointer; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--action-strong); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--quiet { background: transparent; color: var(--action-strong); border-color: var(--line-strong); }
.btn--quiet:hover:not(:disabled) { background: var(--surface-sunken); }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }

.topbar {
  display: flex; align-items: center; gap: 16px; padding: 0 24px; min-height: 56px;
  border-bottom: 1px solid var(--line); background: var(--surface-raised); min-width: 0;
}
.topbar__brand { font: 900 18px/1 var(--font-display); letter-spacing: -0.02em; color: var(--ink-strong); flex-shrink: 0; }
.topbar__title { color: var(--ink-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar__right { margin-left: auto; font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; flex-shrink: 0; }

.gate { display: grid; place-items: start center; padding: 48px 16px; overflow-y: auto; }
.card { width: 100%; max-width: 480px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 32px; }
.card form { display: grid; gap: 8px; margin-top: 16px; }
.card label { font-size: 14px; font-weight: 700; color: var(--ink-strong); }
input[type='email'], textarea {
  font: inherit; font-size: 15px; color: var(--ink-body); width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 10px 12px; background: var(--surface-page);
}

/* Chat beside the video on a laptop; video pinned above the chat on a phone. */
.panes { display: flex; min-height: 0; min-width: 0; }
.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.pane--chat { flex: 1 1 420px; max-width: 480px; border-right: 1px solid var(--line); background: var(--surface-raised); }
.pane--work { flex: 999 1 560px; overflow-y: auto; padding: 20px 24px 40px; display: grid; gap: 16px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.pane__head { padding: 16px 24px 12px; border-bottom: 1px solid var(--line); }
.pane__title { font: 700 15px/1.3 var(--font-body); color: var(--ink-strong); }
.pane__sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }

.thread { flex: 1; overflow-y: auto; padding: 24px; display: grid; gap: 16px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.msg { display: grid; gap: 4px; }
.msg__who { font: 700 11px/1 var(--font-body); letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink-muted); }
.msg--coach .msg__who { color: var(--accent-rust-text); }
.msg__body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.msg--you .msg__body { color: var(--ink-muted); }
.msg--pause { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.msg--pause .msg__body { color: var(--ink-strong); font-weight: 700; }
.msg__body a { color: var(--action-strong); font-weight: 700; }
.thinking { color: var(--ink-muted); font-style: italic; font-size: 14px; }

.picker { padding: 12px 24px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.picker__q { font-size: 13.5px; color: var(--ink-strong); font-weight: 700; }
.picker__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.picker__row--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.picker__btn { min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink-strong); font: 700 15px var(--font-body); cursor: pointer; }
.picker__btn:hover { background: var(--action); border-color: var(--action); color: var(--surface-raised); }
.picker__ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); }

.composer { border-top: 1px solid var(--line); padding: 12px 24px 16px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { resize: none; min-height: 44px; }

.video { position: relative; background: var(--surface-invert); border-radius: var(--radius-md); aspect-ratio: 16 / 9; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--ink-on-invert); font-size: 14px; padding: 16px; }
.video__placeholder strong { display: block; font: 900 20px var(--font-display); margin-bottom: 4px; }
.stage { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.standin { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-muted); }

.tickets { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); padding: 16px; }
.tickets__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tickets__when { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--ink-muted); text-transform: uppercase; }
.countdown { margin-left: auto; background: var(--accent-gold); color: var(--surface-invert); border-radius: var(--radius-sm); padding: 5px 10px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tickets__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tk { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-page); padding: 14px; display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.tk--featured { background: var(--surface-invert); border-color: var(--surface-invert); color: var(--ink-on-invert); }
.tk__top { display: flex; align-items: center; gap: 6px; }
.tk__name { font-weight: 700; font-size: 16px; color: var(--ink-strong); }
.tk--featured .tk__name { color: var(--ink-on-invert); }
.tk__tag { margin-left: auto; border: 1px solid currentColor; border-radius: var(--radius-pill); padding: 0 8px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.tk__price { margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk__full { font: 900 24px var(--font-display); color: var(--ink-strong); }
.tk__full--struck { text-decoration: line-through; text-decoration-thickness: 2px; }
.tk--featured .tk__full { color: var(--ink-on-invert); }
.tk__off { border-radius: var(--radius-pill); padding: 2px 9px; font-weight: 700; font-size: 11px; background: var(--action); color: #fff; }
.tk--featured .tk__off { background: var(--ink-on-invert); color: var(--surface-invert); }
.tk__terms { font-size: 11px; color: var(--ink-muted); }
.tk--featured .tk__terms { color: var(--line); }
.tk__strip { border-radius: var(--radius-sm); padding: 4px 8px; font-weight: 700; font-size: 12px; margin: 8px 0; background: var(--surface-sunken); color: var(--ink-strong); }
.tk--featured .tk__strip { background: var(--accent-gold); color: var(--surface-invert); }
.tk ul { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 3px; }
.tk li::before { content: '✓ '; }
.tk li.no { color: var(--ink-faint); text-decoration: line-through; }
.tk li.no::before { content: ''; }
.tk li.bold { font-weight: 700; }
.tk .btn { margin-top: auto; width: 100%; }
.tk:not(.tk--featured) .btn { background: transparent; color: var(--action-strong); border-color: var(--line-strong); }

.plan { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-sunken); padding: 14px 16px; }
.plan dl { margin: 0; display: grid; gap: 6px; }
.plan dt { font-size: 12px; color: var(--ink-muted); }
.plan dd { margin: 0 0 4px; color: var(--ink-strong); font-weight: 700; overflow-wrap: anywhere; }

/* Phone: the video pins to the top, the chat sits under it, and the tickets
   and the plan come after the chat. The work pane dissolves (display:
   contents) so its pieces can be ordered around the chat. */
@media (max-width: 760px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar__title { display: none; }
  .panes { flex-direction: column; overflow-y: auto; }
  .pane--work { display: contents; }
  /* The video and its controls stick together, so nothing scrolls under the
     video and becomes unreachable (CLAUDE.md: can a finger hit it). */
  .stage { order: -1; position: sticky; top: 0; z-index: 2; flex: 0 0 auto; gap: 0; background: var(--surface-page); }
  .video { border-radius: 0; }
  .standin { padding: 8px 14px; border-bottom: 1px solid var(--line); height: 60px; flex-wrap: nowrap; }
  .standin span { display: none; }
  .pane--chat { order: 0; max-width: none; border-right: 0; flex: 0 0 auto;
    /* Exactly the screen left under the top bar (56px), the 16:9 video
       (56.25vw) and the stage controls, so Send is on screen on arrival. */
    height: calc(100dvh - 56px - 56.25vw - 60px); min-height: 320px; border-bottom: 1px solid var(--line); }
  .tickets, .plan { order: 1; margin: 12px 14px 0; flex: 0 0 auto; }
  .plan { margin-bottom: 24px; }
  .pane--chat .pane__head { display: none; }
  .thread { padding: 16px 14px; }
  .composer, .picker { padding-left: 14px; padding-right: 14px; }
  .tickets__grid { grid-template-columns: minmax(0, 1fr); }
  .countdown { margin-left: 0; }
  .card { padding: 24px 20px; }
}
