/* JBC Client Lounge — Jodie Brim Creative brand */
@font-face { font-family: "Blacker Pro Display"; src: url("../fonts/BlackerProDisplay-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Blackstone"; src: url("../fonts/Blackstone.woff2") format("woff2"); font-display: swap; }

:root {
  --navy: #273041;
  --pumpkin: #C38E40;
  --peanut: #9C7B5D;
  --almond: #F2EEEA;
  --white: #FFFFFF;
  --black: #0F1413;
  --line: #E2DBD3;        /* almond, one step darker, for quiet dividers */
  --pumpkin-soft: #F3E6D2;
  --danger: #A2412E;

  --display: "Blacker Pro Display", "Cormorant Garamond", Georgia, serif;
  --script: "Blackstone", "Brush Script MT", cursive;
  --body: "Lato", "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --gutter: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--almond);
  color: var(--navy);
  font: 400 16px/1.55 var(--body);
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-underline-offset: 3px; text-decoration-color: var(--pumpkin); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pumpkin); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--display); font-weight: 300; line-height: 1.1; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2rem, 7vw, 2.75rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
.script { font-family: var(--script); font-size: 2.1rem; line-height: 1; color: var(--pumpkin); display: block; margin-bottom: 6px; }
.muted { color: var(--peanut); }
.small { font-size: 0.875rem; }

/* ---------- Page frame ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 8px; }
.topbar .mark { width: 44px; height: 44px; }
.topbar nav { display: flex; gap: 18px; font-size: 0.95rem; }
.topbar nav a, .linkbtn { color: var(--navy); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.footer { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.85rem; color: var(--peanut); }
.footer a { color: var(--peanut); }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--navy);
  background: var(--navy); color: var(--white); font-weight: 700; letter-spacing: 0.02em; cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.secondary { background: transparent; color: var(--navy); }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 0.9rem; }

.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.field > span em { font-style: normal; font-weight: 400; color: var(--peanut); }
input[type=email], input[type=text], input[type=date], input[inputmode=numeric], textarea, select {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); font-size: 16px; /* 16px stops iPhone zooming in */
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--pumpkin); box-shadow: 0 0 0 3px var(--pumpkin-soft); }
.code-input { letter-spacing: 0.5em; text-align: center; font-size: 1.6rem !important; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 0.92rem; cursor: pointer; }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip input:focus-visible + span { outline: 2px solid var(--pumpkin); outline-offset: 2px; }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--white); border-left: 3px solid var(--pumpkin); margin: 0 0 16px; }
.notice.error { border-left-color: var(--danger); color: var(--danger); }

/* ---------- Sign in ---------- */
.signin { padding-top: 7vh; }
.signin .logo { width: 220px; margin: 0 auto 36px; }
.signin h1 { margin-bottom: 10px; }
.signin p.lead { margin: 0 0 24px; }

/* ---------- The send circle (the one bold moment) ---------- */
.hello { margin: 14px 0 22px; }
.sender {
  position: relative; width: min(74vw, 270px); aspect-ratio: 1; margin: 6px auto 26px;
  border-radius: 50%; background: var(--navy); color: var(--white);
  display: grid; place-items: center; text-align: center; cursor: pointer;
  border: 0; padding: 0;
}
.sender img { width: 34%; margin: 0 auto 10px; }
.sender .label { font-weight: 700; font-size: 1.02rem; display: block; }
.sender .sub { font-size: 0.85rem; opacity: 0.75; display: block; margin-top: 2px; }
.sender svg.ring { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
.sender svg.ring circle { fill: none; stroke-width: 3; }
.sender svg.ring .track { stroke: var(--line); }
.sender svg.ring .bar[stroke-dashoffset="100"] { opacity: 0; }
.sender svg.ring .bar { stroke: var(--pumpkin); stroke-linecap: round; transition: stroke-dashoffset 0.4s ease; }
.sender.busy { cursor: default; }
@media (prefers-reduced-motion: reduce) { .sender svg.ring .bar { transition: none; } }

/* ---------- Selected files ---------- */
.picked { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 0 0 22px; }
.tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--line); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile img[data-file]:not([src]) { visibility: hidden; }  /* no broken-image icon while loading */
.tile { background: var(--line) url("../img/submark.png") center / 34% no-repeat; }
.tile.no-thumb img { display: none; }
.tile .kind { position: absolute; left: 6px; bottom: 6px; background: rgba(39,48,65,0.82); color: #fff; font-size: 0.72rem; padding: 2px 7px; border-radius: 999px; }
.tile .x { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.92); color: var(--navy); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.tile .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.6); }
.tile .prog i { display: block; height: 100%; width: 0; background: var(--pumpkin); }
.tile.done::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--pumpkin); color: #fff; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; }
.tile.failed { outline: 2px solid var(--danger); }

.details { background: var(--white); border-radius: var(--radius); padding: 18px 18px 6px; margin-bottom: 18px; }
.details summary { cursor: pointer; font-weight: 700; padding-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }

/* ---------- Sent history ---------- */
.history { margin-top: 44px; }
.history h2 { margin-bottom: 4px; }
.batch { padding: 18px 0; border-bottom: 1px solid var(--line); }
.batch-head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; margin-bottom: 10px; }
.batch-note { margin: 0 0 10px; white-space: pre-wrap; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.thumbs .tile .remove { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 999px; background: rgba(255,255,255,0.94); padding: 4px 9px; font-size: 0.75rem; cursor: pointer; color: var(--danger); }
.empty { padding: 26px 0; color: var(--peanut); }

/* ---------- Studio (wider) ---------- */
.studio .wrap { max-width: 1180px; }
.studio-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .studio-grid { grid-template-columns: 300px 1fr; align-items: start; } }
.clients { background: var(--white); border-radius: var(--radius); padding: 8px; }
.client-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; padding: 12px 12px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; }
.client-btn[aria-current="true"] { background: var(--almond); }
.client-btn .name { font-weight: 700; }
.client-btn .meta { font-size: 0.82rem; color: var(--peanut); }
.badge { min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--pumpkin); color: #fff; font-size: 0.8rem; font-weight: 700; text-align: center; }
.panel { background: var(--white); border-radius: var(--radius); padding: 22px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 8px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 12px; }
.file { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.file .tile { border-radius: 0; }
.file .tile.is-new::before { content: "New"; position: absolute; top: 6px; left: 6px; z-index: 1; background: var(--pumpkin); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.file .info { padding: 10px; font-size: 0.82rem; display: grid; gap: 8px; }
.file .fname { word-break: break-all; color: var(--navy); }
.file .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.file .acts .btn { min-height: 34px; padding: 0 12px; font-size: 0.8rem; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 6px; font-size: 0.78rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.toolbar .switch { margin-bottom: 0; }
dialog { border: 0; border-radius: var(--radius); padding: 24px; max-width: 460px; width: calc(100% - 32px); color: var(--navy); }
dialog::backdrop { background: rgba(39,48,65,0.45); }
.switch { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

/* ---------- Help / legal pages ---------- */
.prose { max-width: 640px; }
.prose h1 { margin: 18px 0 14px; }
.prose h2 { margin: 30px 0 10px; font-size: 1.45rem; }
.prose p, .prose li { line-height: 1.65; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 0.95rem; box-shadow: 0 8px 24px rgba(39,48,65,0.25); z-index: 50; max-width: calc(100% - 32px); }

/* Drag & drop overlay (desktop) */
.drop-overlay { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 24px;
  background: var(--navy); pointer-events: none; }
.drop-overlay.show { display: grid; }
.drop-overlay > div { border: 2px dashed var(--pumpkin); border-radius: 24px; color: var(--white); text-align: center;
  width: min(520px, 100%); padding: 56px 24px; }
.drop-overlay strong { display: block; font-size: 1.5rem; margin-bottom: 6px; }
.drop-overlay span { opacity: 0.8; }

/* "Put the Lounge on your phone" card */
.hs-card { background: var(--white); border-radius: var(--radius-sm); border-left: 3px solid var(--pumpkin); padding: 16px 18px; margin: 0 0 22px; }
.hs-card h2 { font-size: 1.15rem; margin: 0 0 4px; }
.hs-card .steps { margin: 12px 0 14px; }
.hs-card .toolbar { gap: 16px; align-items: center; }
.hs-dialog { max-width: min(460px, calc(100% - 32px)); }
.hs-dialog h2 { margin-bottom: 10px; }
