/* ===========================================================================
   pcb-app.css — the one palette and component set for every Pocket City app
   page. Lives at /app/pcb-app.css.

   Before this file, each page carried its own private copy of the colour
   tokens inline, which is exactly why they drifted: the buy page ended up
   amber, the hub ended up a different black. Pages link this first, then add
   only what is genuinely their own.

   Adding a page in this folder: <link rel="stylesheet" href="./pcb-app.css">,
   then a <style> block for anything specific to that screen. Do not redefine
   a token in a page. If a page needs a new colour, it belongs here.
   =========================================================================== */

:root{
  /* ground and surfaces */
  --bg:#08090B;
  --panel:#181A20;
  --panel-2:#1F2229;
  --line:#252932;
  --line-2:#2F343E;

  /* type */
  --text:#FFFFFF;
  --muted:#AEB3BE;
  --dim:#7C828E;

  /* brand */
  --red:#EF1B24;
  --red-2:#F14C58;
  --red-dark:#6E0B10;
  --red-wash:rgba(239,27,36,.15);

  /* status — separate from brand on purpose, so "open" never reads as
     "on brand" and "full" never reads as "this is the action" */
  --ok:#2EA36B;      --ok-wash:rgba(46,163,107,.15);
  --warn:#D98324;    --warn-wash:rgba(217,131,36,.16);
  --bad:#EF1B24;     --bad-wash:rgba(239,27,36,.15);

  --radius-sm:9px;
  --radius:14px;
  --radius-lg:18px;
  --pill:99px;

  --font:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  font-variant-numeric:tabular-nums;
  -webkit-text-size-adjust:100%;
}

a{color:inherit}

.wrap{max-width:760px;margin:0 auto;padding:18px 18px 60px;position:relative}
.wrap--narrow{max-width:560px}

/* the single red bloom every app screen opens with */
.glow{position:fixed;top:-110px;right:-90px;width:300px;height:300px;border-radius:50%;
  background:var(--red);opacity:.12;filter:blur(60px);pointer-events:none;z-index:0}

.pcb-head{position:relative;z-index:1;padding:20px 0 4px}
.backlink{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;
  color:var(--muted);border:1px solid var(--line);padding:6px 12px;border-radius:var(--pill);
  text-decoration:none;margin:0 8px 16px 0}
.backlink:hover{border-color:var(--red);color:var(--text)}

h1{margin:0 0 6px;font-size:27px;font-weight:800;letter-spacing:-.025em;text-wrap:balance}
h2{font-size:17px;font-weight:700;letter-spacing:-.015em;margin:0}
.lede{margin:0 0 24px;color:var(--muted);font-size:15px;line-height:1.55;max-width:62ch}

.eyebrow{font-size:12px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;
  color:var(--muted);margin:0 0 10px}

/* ---- surfaces ---- */
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px 18px}
.card--flat{background:#ffffff0d;border-color:#ffffff14}

.state{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
  padding:26px;text-align:center;color:var(--muted);font-size:14px;line-height:1.55}
.state--error{border-color:rgba(239,27,36,.4);color:#F5A3A6}
.state--empty{border-style:dashed}

/* ---- controls ---- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;
  font-family:inherit;font-size:14px;font-weight:700;border-radius:var(--radius-sm);
  padding:10px 16px;border:1px solid transparent;cursor:pointer;text-decoration:none;
  white-space:nowrap;line-height:1.2}
.btn:disabled,.btn[disabled]{opacity:.45;cursor:not-allowed}
.btn--primary{background:var(--red);color:#fff}
.btn--primary:hover:not(:disabled){filter:brightness(1.08)}
.btn--ghost{background:transparent;color:var(--muted);border-color:var(--line)}
.btn--ghost:hover:not(:disabled){border-color:var(--red);color:var(--text)}
.btn--block{width:100%}
.btn--lg{padding:14px 20px;font-size:15px;border-radius:var(--radius)}

label{display:block;font-size:12px;font-weight:600;text-transform:uppercase;
  letter-spacing:.05em;color:var(--muted);margin:0 0 6px}
input,select,textarea{width:100%;background:#12151B;color:var(--text);
  border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:16px;
  font-family:inherit}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--red)}
textarea{min-height:110px;resize:vertical;line-height:1.5}
.field{margin-bottom:14px}
.field:last-child{margin-bottom:0}
.hint{font-size:12.5px;color:var(--dim);line-height:1.5;margin-top:6px}

/* ---- badges ---- */
.badge{display:inline-block;font-size:11px;font-weight:800;letter-spacing:.04em;
  text-transform:uppercase;padding:5px 11px;border-radius:var(--pill);white-space:nowrap}
.badge--ok{background:var(--ok-wash);color:#6EE7A8}
.badge--warn{background:var(--warn-wash);color:#F0C674}
.badge--bad{background:var(--bad-wash);color:#FF8085}
.badge--neutral{background:#ffffff14;color:#C7CAD2}

/* ---- people ---- */
.avatar{border-radius:50%;object-fit:cover;flex:none;background:var(--panel-2);
  border:1px solid var(--line);display:flex;align-items:center;justify-content:center;
  font-weight:800;color:#fff;overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar--sm{width:26px;height:26px;font-size:10px}
.avatar--md{width:40px;height:40px;font-size:13px}
.avatar--lg{width:84px;height:84px;font-size:26px}
.avatar--brand{background:linear-gradient(135deg,var(--red),var(--red-dark));border-color:transparent}

/* a trainer's name wherever it appears, clickable through to their profile */
.who{display:inline-flex;align-items:center;gap:7px;text-decoration:none;
  border-radius:var(--pill);padding:3px 10px 3px 3px;background:#ffffff0d;
  border:1px solid #ffffff14;font-size:12.5px;font-weight:600;color:#DFE2E8}
.who:hover{border-color:var(--red);color:#fff}

/* ---- segmented control ---- */
.seg{display:inline-flex;background:var(--panel);border:1px solid var(--line);
  border-radius:var(--pill);padding:3px;gap:2px}
.seg button{background:none;border:none;font-family:inherit;font-size:13px;font-weight:700;
  color:var(--muted);padding:8px 18px;border-radius:var(--pill);cursor:pointer}
.seg button[aria-pressed="true"]{background:var(--red);color:#fff}

/* ---- modal, dark like everything else ---- */
.modal{position:fixed;inset:0;background:rgba(4,5,7,.72);backdrop-filter:blur(3px);
  display:flex;align-items:center;justify-content:center;padding:16px;z-index:60}
.modal[hidden]{display:none!important}
.modal-card{background:var(--panel);color:var(--text);border:1px solid var(--line-2);
  border-radius:var(--radius-lg);max-width:430px;width:100%;padding:22px;
  max-height:88vh;overflow:auto;position:relative;box-shadow:0 24px 60px -20px #000}
.modal-card h3{margin:0 0 14px;font-size:18px;font-weight:800;letter-spacing:-.02em}
.modal-summary{background:var(--panel-2);border-radius:10px;padding:11px 13px;
  font-size:13.5px;color:#DFE2E8;margin-bottom:16px;line-height:1.45}
.modal-actions{display:flex;gap:9px;margin-top:16px}
.modal-actions .btn{flex:1}
.modal-msg{font-size:13.5px;line-height:1.5;margin-top:12px;color:var(--muted)}
.modal-msg--error{color:#F5A3A6}
.modal-msg--success{color:#6EE7A8}
.modal-msg a{color:var(--red-2);font-weight:700}
.modal-x{position:absolute;top:12px;right:14px;background:none;border:none;font-size:22px;
  line-height:1;cursor:pointer;color:var(--dim);padding:0}
.modal-x:hover{color:var(--text)}

/* ---- footer ---- */
.pcb-foot{border-top:1px solid var(--line);padding:22px 0;color:var(--muted);
  font-size:12.5px;margin-top:26px;position:relative;z-index:1;line-height:1.6}
.pcb-foot a{color:var(--red-2)}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}

@media (prefers-reduced-motion: reduce){
  *{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

/* pcb-social */
.pcb-socials{display:inline-flex;align-items:center;gap:2px}
.pcb-soc{width:40px;height:40px;display:grid;place-items:center;border-radius:11px;color:#fff;text-decoration:none;transition:color .15s,background .15s}
.pcb-soc:hover{color:#EF1B24;background:rgba(255,255,255,.06)}
.pcb-soc svg{display:block}
.pcb-head .pcb-socials{gap:6px;vertical-align:top;margin:0 0 16px 0}
.pcb-head .pcb-soc{width:29px;height:29px;border:1px solid var(--line);border-radius:var(--pill);color:var(--muted)}
.pcb-head .pcb-soc:hover{border-color:var(--red);color:var(--text);background:transparent}
.pcb-head .pcb-soc svg{width:15px;height:15px}
/* /pcb-social */

/* pcb-safe-area */
.pcb-head{padding-top:calc(20px + env(safe-area-inset-top,0px))}
/* /pcb-safe-area */
