/* benharveyfit ai — web. The "Jailhouse" design system, ported from the iOS app's
   Theme.swift: scratched charcoal concrete, one burnt rust accent, condensed poster type,
   numbered tiles, double rust frame, tally-mark streak. One accent. No second color. */

:root {
  --bg:        #161413;  /* near-black scratched concrete */
  --surface:   #211E1C;  /* lifted card/tile */
  --surface-hi:#2D2926;
  --rust:      #BF5430;  /* the one and only accent */
  --rust-mid:  rgba(191, 84, 48, 0.50);
  --rust-ghost:rgba(191, 84, 48, 0.22);
  --text:   #F2EFEA;
  --text70: rgba(242, 239, 234, 0.70);
  --text45: rgba(242, 239, 234, 0.45);
  --text25: rgba(242, 239, 234, 0.25);
  --hairline: rgba(255, 255, 255, 0.08);
  --corner: 14px;
  --tile-corner: 10px;
  --pad: 16px;
  --display: "Oswald", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

/* Faint concrete-grain wash so the black isn't flat. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(191,84,48,0.07), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  opacity: 0.9;
}

.wrap { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 28px 20px 64px; }

/* ── Display type helpers ─────────────────────────────────────── */
.display { font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; line-height: 0.98; }
.label   { font-family: var(--display); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.mono    { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ── Header / brand ───────────────────────────────────────────── */
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.brand { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 18px; letter-spacing: 0.04em; }
.brand .ai { color: var(--rust); }
/* tally-mark streak: four upright marks + a diagonal strike (the "5" tally), drawn in CSS
   so it renders identically everywhere (Oswald has no box-drawing glyphs). */
.tally { display: inline-flex; align-items: center; height: 16px; gap: 3px; }
.tally i { display: block; width: 2px; height: 15px; background: var(--rust); border-radius: 1px; }
.tally i.slash { width: 16px; height: 2px; margin-left: -16px; transform: rotate(-22deg); }
#whoami { font-size: 12px; color: var(--text45); display: flex; gap: 10px; align-items: center; }
#whoami a { color: var(--text70); text-decoration: none; border-bottom: 1px solid var(--hairline); cursor: pointer; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 22px 6px 8px; }
.hero h1 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(34px, 9vw, 50px); line-height: 0.94; letter-spacing: 0.005em; }
.hero h1 .rust { color: var(--rust); }
.hero p { margin: 18px auto 0; max-width: 420px; color: var(--text70); font-size: 15px; line-height: 1.5; }

/* The Protocol poster, in miniature — the brand. */
.poster { margin: 26px auto 6px; max-width: 360px; border: 1px solid var(--hairline); border-radius: var(--corner); background: var(--surface); padding: 18px 20px; text-align: left; }
.poster .ttl { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 13px; color: var(--text45); margin-bottom: 12px; }
.poster ol { list-style: none; display: grid; gap: 9px; }
.poster li { display: flex; gap: 12px; align-items: baseline; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 15px; }
.poster li .n { color: var(--rust); font-size: 12px; width: 18px; }
.poster .law { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--hairline); color: var(--rust); font-family: var(--display); font-weight: 700; letter-spacing: 0.08em; font-size: 13px; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px 20px; border: none; border-radius: var(--tile-corner); background: var(--rust); color: #160D08; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 16px; cursor: pointer; transition: transform .06s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--rust-mid); }
.btn.ghost:hover { background: rgba(191,84,48,0.08); filter: none; }
.btn.small { width: auto; padding: 10px 16px; font-size: 13px; }

.cta { margin: 28px auto 0; max-width: 360px; }
.fineprint { text-align: center; color: var(--text25); font-size: 12px; margin-top: 14px; }

/* ── Cards / sections ─────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--corner); padding: var(--pad); }
/* signature double rust frame */
.frame { position: relative; }
.frame::before { content: ""; position: absolute; inset: -5px; border-radius: calc(var(--corner) + 4px); border: 1px solid var(--rust-ghost); pointer-events: none; }
.frame::after  { content: ""; position: absolute; inset: 0;   border-radius: var(--corner); border: 1px solid var(--rust-mid); pointer-events: none; }

.hidden { display: none !important; }

/* ── Auth ─────────────────────────────────────────────────────── */
.auth { max-width: 380px; margin: 8px auto 0; }
.auth h2 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 24px; letter-spacing: 0.02em; text-align: center; margin-bottom: 4px; }
.auth .sub { text-align: center; color: var(--text45); font-size: 13px; margin-bottom: 22px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; color: var(--text45); margin-bottom: 6px; }
.field input { width: 100%; padding: 14px; background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--tile-corner); color: var(--text); font-size: 16px; font-family: var(--body); }
.field input:focus { outline: none; border-color: var(--rust-mid); }
.toggle { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text45); }
.toggle a { color: var(--rust); cursor: pointer; text-decoration: none; font-weight: 600; }
.msg { text-align: center; font-size: 13px; margin-top: 14px; min-height: 18px; }
.msg.err { color: var(--rust); }
.msg.ok  { color: var(--text70); }

/* ── Scan / upload ────────────────────────────────────────────── */
.scan-head { text-align: center; margin-bottom: 18px; }
.scan-head h2 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 26px; letter-spacing: 0.02em; }
.scan-head p { color: var(--text45); font-size: 13px; margin-top: 6px; }
.drop { border: 1.5px dashed var(--rust-mid); border-radius: var(--corner); background: var(--surface); padding: 40px 20px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: rgba(191,84,48,0.06); border-color: var(--rust); }
.drop .icon { font-size: 34px; color: var(--rust); }
.drop .big { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 18px; letter-spacing: 0.04em; margin-top: 10px; }
.drop .small { color: var(--text45); font-size: 12px; margin-top: 6px; }
.privacy-note { text-align: center; color: var(--text45); font-size: 12px; margin-top: 16px; line-height: 1.5; }

/* hero drop box — the front-and-center entry point, bigger than the in-flow variant */
.hero-drop { margin-top: 26px; padding: 52px 20px; }
.hero-drop .icon { font-size: 42px; }
.hero-drop .big { font-size: 21px; margin-top: 12px; }

/* the "what you get" chips under the drop box */
.chips { display: flex; justify-content: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.chips span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 1px solid var(--hairline); border-radius: 999px; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; color: var(--text70); }
.chips b { color: var(--rust); font-weight: 700; }

/* slim Protocol strip — credibility/context below the fold, no longer the hero */
.proto-strip { margin: 30px auto 0; max-width: 420px; text-align: center; border-top: 1px solid var(--hairline); padding-top: 22px; }
.proto-strip .ttl { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: var(--text45); }
.proto-strip .rules { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.proto-strip .rules span { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 13px; color: var(--text70); }
.proto-strip .rules b { color: var(--rust); font-weight: 700; font-size: 11px; margin-right: 3px; }
.proto-strip .law { margin-top: 14px; color: var(--rust); font-family: var(--display); font-weight: 700; letter-spacing: 0.08em; font-size: 13px; }

/* score gate — the locked-in photo above the signup form */
.gate-photo { text-align: center; margin-bottom: 20px; }
.gate-photo img { max-width: 150px; max-height: 190px; border-radius: var(--tile-corner); border: 1px solid var(--rust-mid); object-fit: cover; }
.gate-photo .lock { margin-top: 9px; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; color: var(--rust); }

/* loading */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(22,13,8,0.35); border-top-color: #160D08; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scanning { text-align: center; padding: 50px 20px; }
.scanning .big { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 20px; margin-top: 18px; }
.scanning .small { color: var(--text45); font-size: 13px; margin-top: 8px; }
.barspin { width: 40px; height: 40px; border: 3px solid var(--rust-ghost); border-top-color: var(--rust); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }

/* ── Result ───────────────────────────────────────────────────── */
.result .banner { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: var(--text45); text-align: center; margin-bottom: 16px; letter-spacing: 0.02em; }
.score-card { text-align: center; padding: 26px var(--pad) 22px; }
.score-card .lab { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; color: var(--text45); }
.score-num { font-family: var(--display); font-weight: 700; color: var(--rust); font-size: 92px; line-height: 0.9; margin: 6px 0; }
.score-num .band { font-size: 26px; color: var(--text45); font-weight: 600; }
.conf { font-size: 12px; color: var(--text45); }
.conf.low { color: var(--rust); }

.subs { margin-top: 20px; display: grid; gap: 12px; }
.sub { }
.sub .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.sub .name { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; color: var(--text70); }
.sub .val { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--text); }
.track { height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.track > i { display: block; height: 100%; background: var(--rust); border-radius: 4px; }

.plan { margin-top: 24px; }
.plan .ttl { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 14px; color: var(--text45); margin-bottom: 12px; }
.plan-item { display: flex; gap: 13px; padding: 13px 0; border-top: 1px solid var(--hairline); }
.plan-item .num { font-family: var(--display); font-weight: 700; color: var(--rust); font-size: 16px; min-width: 22px; }
.plan-item .body .note { font-size: 14px; line-height: 1.4; }
.plan-item .body .act { color: var(--text70); font-size: 13px; margin-top: 4px; line-height: 1.4; }
.plan-item .body .act .rule { color: var(--rust); font-family: var(--display); font-weight: 700; letter-spacing: 0.04em; }

.next { text-align: center; margin-top: 22px; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 13px; color: var(--text45); }
.next b { color: var(--text); }
.rescan { margin-top: 10px; }
.share-hint { text-align: center; color: var(--text45); font-size: 12px; margin-top: 12px; min-height: 16px; }
#share-canvas { position: absolute; left: -9999px; top: -9999px; }

footer { text-align: center; margin-top: 40px; color: var(--text25); font-size: 11px; line-height: 1.7; }
footer a { color: var(--text45); text-decoration: none; }
