/* ==========================================================================
   Uptown Psychology · product design system
   The single source of truth for every screen in screens/.
   Screen builders MUST use these tokens and components. Do not invent a
   parallel palette, a second button, or a local font stack.

   Palette is sampled directly from the client's own flyers:
     cream #F7F1EF · navy #323E52 · blush #DCAEB2
   Contrast rules (WCAG AA, verified):
     navy on cream .......... 9.6:1  body text
     white on navy .......... 10.7:1 dark surfaces
     navy on blush .......... 5.4:1  blush buttons carry NAVY text, never white
     --ink-soft on cream .... 5.2:1  smallest allowed muted text
     Raw --blush on cream is 1.9:1. It is DECORATIVE ONLY: rules, mark, borders.
     For blush-coloured text on cream use --blush-ink.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500&family=Inter:wght@400;500;600;700&family=Petit+Formal+Script&display=swap');

:root {
  /* Brand */
  --cream:      #F7F1EF;
  --navy:       #323E52;
  --blush:      #DCAEB2;

  /* Derived surfaces */
  --white:      #FFFFFF;
  --cream-deep: #F0E7E4;
  --blush-soft: #F5E6E7;
  --blush-line: #EBD5D6;
  --navy-deep:  #29323F;
  --navy-soft:  #46536A;

  /* Ink */
  --ink:        #323E52;
  --ink-soft:   #5A6577;   /* AA on cream */
  --blush-ink:  #8A5A60;   /* AA on cream, reads as blush */
  --line:       #E4DAD6;
  --line-strong:#D6C7C3;

  /* Semantic */
  --ok:         #3F7A63;
  --ok-soft:    #E4F0EA;
  --warn:       #9A6B33;
  --warn-soft:  #F8EEE0;
  --stop:       #96504F;
  --stop-soft:  #F7E6E5;

  /* Type */
  --font-display: 'Jost', 'Futura', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-script: 'Petit Formal Script', cursive;

  /* Geometry */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Elevation. Kept tight: large soft shadows band in print-to-PDF and read
     cheap on screen. Borders do the structural work here. */
  --shadow: 0 1px 2px rgba(50, 62, 82, .06), 0 4px 12px rgba(50, 62, 82, .06);
  --shadow-lift: 0 2px 4px rgba(50, 62, 82, .08), 0 10px 24px rgba(50, 62, 82, .10);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ==========================================================================
   Frames. Every screen file is ONE of these, sized exactly. No page scroll:
   scrolling belongs to .screen-body so the frame edge stays honest.
   ========================================================================== */
.screen {
  width: 390px; height: 844px;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--cream);
  position: relative;
}
.screen--desktop { width: 1280px; height: 800px; }
.screen--navy { background: var(--navy); color: var(--white); }
/* Responsive frame: the board renders the SAME file at 390 and at 1280, so the
   file must not fix its own width. Only events-list.html uses this. */
.screen--fluid { width: 100%; height: 100vh; }

/* Visibility helpers for the responsive frame. Breakpoint 720px.
   These only ever HIDE. They never force a display value, because forcing one
   would flatten .home-bar's grid or .site-nav's flex. */
@media (min-width: 720px) { .only-mobile { display: none !important; } }
@media (max-width: 719.98px) { .only-desktop { display: none !important; } }

.screen-body { flex: 1; overflow-y: auto; overflow-x: hidden; }
.screen-body::-webkit-scrollbar { width: 0; height: 0; }
.screen-body { scrollbar-width: none; }
.pad { padding: 20px; }

/* ---------- iOS status bar ---------- */
.status-bar {
  height: 54px; flex: none;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 22px 8px;
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
}
.status-bar__icons { display: flex; align-items: center; gap: 6px; }
.status-bar__icons svg { width: 17px; height: 12px; }

/* ---------- App bar ---------- */
.app-bar {
  flex: none; height: 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.app-bar--navy { background: var(--navy); border-bottom-color: rgba(255,255,255,.12); }
.app-bar__title { font-size: 16px; font-weight: 600; }
.app-bar__spacer { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer;
  border-radius: var(--r-sm); color: inherit;
}
.icon-btn svg { width: 20px; height: 20px; }

/* ==========================================================================
   Brand lockup
   ========================================================================== */
/* This is the practice's REAL logo file, lifted from uptownpsychologyny.com
   (`main-logo-1-uptown-psychology.webp`), not a redraw and not a font
   approximation of their wordmark.

   It is painted as a CSS mask rather than an <img>: the artwork is flat colour
   on transparent, so masking it with `background: currentColor` lets one asset
   take the navy on cream and the blush on navy, which is exactly how the client
   uses it across their two flyer grounds. An <img> could not recolour. */
.brand { display: inline-flex; align-items: center; color: var(--navy); }
.brand__logo {
  width: 152px; height: 43px; flex: none;
  background-color: currentColor;
  -webkit-mask: url('../img/logo.png') left center / contain no-repeat;
  mask: url('../img/logo.png') left center / contain no-repeat;
}
.brand--lg .brand__logo { width: 210px; height: 60px; }
.brand--sm .brand__logo { width: 116px; height: 33px; }
/* Mark only, for tight spots */
.brand--mark .brand__logo {
  width: 30px; height: 30px;
  -webkit-mask-image: url('../img/logo-mark.png');
  mask-image: url('../img/logo-mark.png');
}
/* On any dark ground the lockup goes blush, as it does on their navy flyers. */
.screen--navy .brand, .admin__nav .brand, .brand--light { color: var(--blush); }

/* ==========================================================================
   Typography
   ========================================================================== */
.h1 { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.18; letter-spacing: -.01em; }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.24; }
.h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.eyebrow {
  font-family: var(--font-display); font-weight: 400;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--blush-ink);
}
.script { font-family: var(--font-script); font-weight: 400; }
.body { font-size: 15px; line-height: 1.55; }
.small { font-size: 13px; line-height: 1.5; }
.muted { color: var(--ink-soft); }
.screen--navy .muted, .screen--navy .eyebrow { color: rgba(255,255,255,.72); }
.screen--navy .eyebrow { color: var(--blush); }

.rule { height: 1px; background: var(--line); border: 0; margin: 18px 0; }

/* ==========================================================================
   Buttons. Minimum tap target 44px. Blush buttons carry navy text (AA).
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--navy); color: var(--white); }
.btn--blush { background: var(--blush); color: var(--navy); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--quiet { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.screen--navy .btn--ghost { color: var(--white); border-color: rgba(255,255,255,.3); }

/* ==========================================================================
   Forms. 16px minimum on every control: anything smaller triggers iOS
   auto-zoom, and most of these RSVPs arrive on a phone.
   ========================================================================== */
.field { margin-bottom: 18px; }
.label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 7px; letter-spacing: .01em;
}
.label .req { color: var(--blush-ink); }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; line-height: 1.45; }

.input, .select, .textarea {
  width: 100%; font-size: 16px; /* iOS auto-zoom floor. Do not lower. */
  min-height: 48px; padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  color: var(--ink);
}
.textarea { min-height: 86px; resize: none; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: #9AA2AE; }
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--blush); outline-offset: 1px; border-color: var(--blush);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%235A6577' stroke-width='1.6'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
  padding-right: 38px;
}
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

/* Chips = the controlled-vocabulary multi-select (presenting problems, tags) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  font-size: 14px; font-weight: 500;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  cursor: pointer;
}
.chip[aria-pressed="true"], .chip.is-on {
  background: var(--blush); border-color: var(--blush); color: var(--navy); font-weight: 600;
}
.chip[aria-pressed="true"]::before, .chip.is-on::before { content: "✓"; font-size: 12px; }

/* Radio / checkbox rows */
.opt {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: 48px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--line-strong);
  border-radius: var(--r); cursor: pointer; margin-bottom: 8px;
}
.opt.is-on { border-color: var(--blush); background: var(--blush-soft); }
.opt__box {
  width: 20px; height: 20px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--line-strong); border-radius: 6px;
  background: var(--white); display: grid; place-items: center;
  font-size: 12px; color: var(--navy);
}
.opt__box--round { border-radius: 50%; }
.opt.is-on .opt__box { background: var(--blush); border-color: var(--blush); }
.opt__text { font-size: 15px; line-height: 1.4; }
.opt__text small { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* Availability grid (day x time-of-day) */
.grid-avail { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 6px; align-items: center; }
.grid-avail__h { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-align: center; letter-spacing: .02em; }
.grid-avail__d { font-size: 13px; font-weight: 600; padding-right: 6px; }
.grid-avail__c {
  height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--white); cursor: pointer; display: grid; place-items: center;
  font-size: 12px; color: transparent;
}
.grid-avail__c.is-on { background: var(--blush); border-color: var(--blush); color: var(--navy); }

/* Step progress */
.steps { display: flex; align-items: center; gap: 6px; padding: 0 16px 14px; flex: none; }
.steps__bar { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.steps__bar.is-done { background: var(--blush); }
.steps__n { font-size: 11px; font-weight: 600; color: var(--ink-soft); letter-spacing: .04em; }

/* ==========================================================================
   Cards & surfaces
   ========================================================================== */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px;
}
.card--flush { padding: 0; overflow: hidden; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }

.note {
  background: var(--blush-soft); border: 1px solid var(--blush-line);
  border-radius: var(--r); padding: 14px; font-size: 13px; line-height: 1.5;
}
.note--ok { background: var(--ok-soft); border-color: #CBE3D8; }
.note--warn { background: var(--warn-soft); border-color: #EBD9BF; }
.note--stop { background: var(--stop-soft); border-color: #EBCFCE; }

/* Tags & pills */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  border-radius: var(--r-pill);
  background: var(--blush-soft); color: var(--blush-ink);
}
.tag--navy { background: var(--navy); color: var(--white); }
.tag--free { background: var(--ok-soft); color: var(--ok); }
.tag--outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-soft); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--new      { background: var(--blush-soft); color: var(--blush-ink); }
.status--fees     { background: var(--warn-soft); color: var(--warn); }
.status--called   { background: #E7EDF5; color: #3D5578; }
.status--connected{ background: var(--ok-soft); color: var(--ok); }
.status--booked   { background: var(--navy); color: var(--white); }
.status--closed   { background: #ECE7E5; color: var(--ink-soft); }
.status--paid     { background: var(--ok-soft); color: var(--ok); }
.status--pending  { background: var(--warn-soft); color: var(--warn); }

/* Avatars */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--cream-deep); }
.avatar--sm { width: 32px; height: 32px; }
.avatar--md { width: 48px; height: 48px; }
.avatar--lg { width: 68px; height: 68px; }

/* ==========================================================================
   Events (CRO-34, public)
   ========================================================================== */
.event-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.event-card__cover { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--cream-deep); }
.event-card__body { padding: 14px; }
.event-card__title { font-family: var(--font-display); font-weight: 400; font-size: 19px; line-height: 1.22; }
.event-card__meta { display: flex; flex-direction: column; gap: 5px; margin: 10px 0 12px; }
.meta-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.meta-row svg { width: 14px; height: 14px; flex: none; color: var(--blush-ink); }

.capacity { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.capacity__track { flex: 1; height: 5px; border-radius: 3px; background: var(--cream-deep); overflow: hidden; }
/* display:block is load-bearing. This is a <span>, so without it the element
   stays inline, width and height are both ignored, and EVERY capacity bar on
   the board renders 0x0 while still looking like markup that should work. */
.capacity__fill { display: block; height: 100%; background: var(--blush); border-radius: 3px; }
.capacity__fill--full { background: var(--stop); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery img { aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); }

.presenter { display: flex; align-items: center; gap: 12px; }
.presenter__name { font-size: 14px; font-weight: 600; }
.presenter__role { font-size: 12px; color: var(--ink-soft); }

/* Sticky action bar at the bottom of a mobile screen */
.action-bar {
  flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--cream);
  display: flex; align-items: center; gap: 12px;
}
.action-bar__price { font-size: 13px; }
.action-bar__price b { display: block; font-size: 19px; font-family: var(--font-display); font-weight: 400; }

/* Home indicator */
.home-bar { flex: none; height: 22px; display: grid; place-items: center; }
.home-bar::after { content: ""; width: 134px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .25; }
.screen--navy .home-bar::after { background: var(--white); opacity: .3; }

/* ==========================================================================
   Anne's desk (desktop admin, 1280x800)
   ========================================================================== */
.admin { display: flex; width: 1280px; height: 800px; background: var(--cream); }
.admin__nav {
  width: 232px; flex: none; background: var(--navy); color: var(--white);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.admin__nav .brand { padding: 0 8px 22px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,.72); cursor: pointer;
}
.nav-link svg { width: 17px; height: 17px; }
.nav-link.is-on { background: rgba(255,255,255,.10); color: var(--white); font-weight: 600; }
.nav-sect {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.42); padding: 18px 10px 8px; font-weight: 600;
}
.admin__main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.admin__bar {
  height: 64px; flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--white);
}
.admin__bar h1 { font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.admin__content { flex: 1; overflow-y: auto; padding: 24px; }
.admin__content::-webkit-scrollbar { width: 0; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--white); }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--cream);
  white-space: nowrap;
}
.table td { padding: 13px 14px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table__wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.table b { font-weight: 600; }
.table small { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 2px; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat__k { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.stat__v { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin-top: 5px; }
.stat__sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ==========================================================================
   Matching engine (CRO-33, staff only). The rank is a RECOMMENDATION:
   every card states why, and Anne is the one who acts.
   ========================================================================== */
.match {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; display: flex; gap: 12px;
}
.match--top { border-color: var(--blush); box-shadow: inset 3px 0 0 var(--blush); }
.match__rank {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  background: var(--cream-deep); color: var(--ink-soft);
}
.match--top .match__rank { background: var(--blush); color: var(--navy); font-weight: 500; }
.match__name { font-size: 15px; font-weight: 600; }
.match__why { font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin-top: 4px; }
.match__score { margin-left: auto; text-align: right; flex: none; }
.match__score b { font-family: var(--font-display); font-size: 20px; font-weight: 400; }
.match__score span { display: block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }

/* Why-it-matched breakdown */
.why { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.why__b {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 600;
  background: var(--ok-soft); color: var(--ok);
}
.why__b--miss { background: var(--stop-soft); color: var(--stop); }
.why__b--soft { background: var(--cream-deep); color: var(--ink-soft); }

/* Email preview (autoresponder + templates) */
.email {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.email__head { padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--cream); }
.email__sub { font-size: 14px; font-weight: 600; }
.email__from { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.email__body { padding: 16px 14px; font-size: 13px; line-height: 1.6; }
.email__body p { margin-bottom: 11px; }
.email__body strong { font-weight: 600; }

/* Utilities */
.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.flex-1 { flex: 1; }
.center { text-align: center; }
