/* ============================================================
   Healing Forward Client Portal — styles
   Matches the Black Gurl Moves site design system exactly.
   Palette, type (Fraunces + DM Sans), and motion from blackgurlmoves.com.
   Phone-first responsive. ============================================================ */

:root{
  /* Brand palette — one value per family, matched to the BGM site :root */
  --bgm-ivory:#F7F1E7; --cream:#FBF8F1; --sand:#E5D6BE; --champagne:#E6D6BB;
  --terracotta:#B96B4B; --terracotta-btn:#AD5D3D; --terracotta-deep:#A0532F;
  --muted-gold:#B49A63; --antique-gold:#8C713F;
  --gold:#C9A227; --gold-muted:#A47B32;
  --espresso-mb:#352820; --ink:#3A322A;
  --espresso:#352820; --deep:#241B16;
  --ivory:var(--bgm-ivory); --clay:var(--terracotta); --clay-deep:var(--terracotta-deep);
  --fx-ease:cubic-bezier(.22,.61,.21,1);
  --serif:"Fraunces",Georgia,serif; --sans:"DM Sans",-apple-system,"Segoe UI",sans-serif;
  --radius:14px; --radius-sm:10px;
  --shadow:0 10px 30px rgba(53,40,32,.10);
  --shadow-lg:0 22px 60px rgba(28,19,13,.22);
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:var(--sans); background:var(--ivory); color:var(--ink);
  line-height:1.65; -webkit-font-smoothing:antialiased;
  min-height:100vh; min-height:100dvh;
}
img{max-width:100%;display:block}
a{color:var(--terracotta-deep)}
h1,h2,h3{font-family:var(--serif);font-weight:500;line-height:1.2;color:var(--espresso)}
button{font-family:var(--sans);cursor:pointer}

/* ---------- motion (mirrors the BGM site's fx system) ---------- */
.fx-ready .fx-up{opacity:0;translate:0 34px;transition:opacity .9s var(--fx-ease),translate .9s var(--fx-ease);transition-delay:var(--fx-d,0s)}
.fx-ready .fx-up.fx-in{opacity:1;translate:0 0}
.fx-ready .fx-zoom{animation:fx-zoom 2.8s var(--fx-ease) both;will-change:scale}
@keyframes fx-zoom{from{scale:1.14}to{scale:1}}
.fx-ready .fx-wipe{clip-path:inset(100% 0 0 0);transition:clip-path 1.3s var(--fx-ease);transition-delay:var(--fx-d,0s)}
.fx-ready .fx-wipe.fx-in{clip-path:inset(0 0 0 0)}
.fx-ready .fx-fade{opacity:0;transition:opacity .7s var(--fx-ease);transition-delay:var(--fx-d,0s)}
.fx-ready .fx-fade.fx-in{opacity:1}
@media (prefers-reduced-motion:reduce){
  .fx-ready .fx-up,.fx-ready .fx-fade{opacity:1!important;translate:0 0!important;transition:none!important}
  .fx-ready .fx-zoom{animation:none!important}
  .fx-ready .fx-wipe{clip-path:none!important}
  html{scroll-behavior:auto}
}

/* ---------- views ---------- */
.view{display:none;min-height:100vh;min-height:100dvh}
.view.active{display:block}

/* ---------- auth shell (login / create account) ---------- */
.auth-shell{position:relative;min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;background:var(--deep);overflow:hidden;padding:24px}
.auth-bg{position:absolute;inset:0}
.auth-bg img{width:100%;height:100%;object-fit:cover;opacity:.55}
.auth-veil{position:absolute;inset:0;background:linear-gradient(180deg,rgba(28,19,13,.55),rgba(28,19,13,.78))}
.auth-card{position:relative;z-index:2;background:var(--ivory);border-radius:var(--radius);padding:36px 32px;width:100%;max-width:430px;box-shadow:var(--shadow-lg)}
.auth-brand{display:flex;align-items:center;gap:14px;margin-bottom:26px}
.auth-ring{width:58px;height:58px;border-radius:50%;border:3px solid var(--gold);display:grid;place-items:center;font-family:var(--serif);font-size:22px;color:var(--espresso);background:var(--cream);flex:0 0 58px}
.auth-brand h1{font-size:26px}
.auth-brand p{font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--antique-gold);font-weight:600}
.auth-card h2{font-size:22px;margin-bottom:6px}
.auth-sub{font-size:14px;color:var(--ink);opacity:.75;margin-bottom:22px}

/* ---------- forms ---------- */
.field{margin-bottom:16px}
.field label{display:block;font-size:13px;font-weight:600;letter-spacing:.02em;margin-bottom:7px;color:var(--espresso)}
.field .hint{font-weight:400;font-size:12.5px;opacity:.65;display:block;margin-top:4px}
input[type=text],input[type=email],input[type=password],input[type=tel],input[type=date],textarea,select{
  width:100%;border:1.5px solid var(--sand);border-radius:var(--radius-sm);
  background:#fff;padding:13px 14px;font-family:var(--sans);font-size:16px;color:var(--ink);
  min-height:48px;
}
input:focus,textarea:focus,select:focus{outline:2px solid var(--gold);outline-offset:2px;border-color:var(--gold)}
textarea{resize:vertical;min-height:110px;line-height:1.6}
.checks{display:grid;gap:10px;margin:6px 0 4px}
.check{display:flex;gap:12px;align-items:flex-start;background:#fff;border:1.5px solid var(--sand);border-radius:var(--radius-sm);padding:12px 14px;cursor:pointer;min-height:48px}
.check input{width:22px;height:22px;flex:0 0 22px;margin-top:2px;accent-color:var(--terracotta-btn)}
.check span{font-size:15px;line-height:1.55}
.check.read-check{background:var(--cream)}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:none;border-radius:999px;
  padding:15px 30px;font-size:16px;font-weight:600;min-height:52px;text-decoration:none;
  transition:transform .25s var(--fx-ease),box-shadow .25s var(--fx-ease),background .25s}
.btn:active{transform:scale(.98)}
.btn-primary{background:var(--terracotta-btn);color:var(--ivory);box-shadow:0 8px 20px rgba(173,93,61,.35)}
.btn-primary:hover{background:var(--terracotta-deep)}
.btn-secondary{background:var(--espresso);color:var(--ivory)}
.btn-secondary:hover{background:var(--deep)}
.btn-ghost{background:transparent;color:var(--espresso);border:1.5px solid var(--sand)}
.btn-block{width:100%}
.btn-row{display:flex;gap:12px;margin-top:22px}
.btn-row .btn{flex:1}
.btn:disabled{opacity:.5;cursor:not-allowed}
.form-error{display:none;background:#fbe9e4;border:1.5px solid #d98873;color:#8a3b28;border-radius:var(--radius-sm);padding:12px 14px;font-size:14px;margin-bottom:16px}
.form-error.show{display:block}
.auth-switch{text-align:center;margin-top:20px;font-size:14.5px}

/* ---------- top bar ---------- */
.topbar{position:sticky;top:0;z-index:50;background:rgba(247,241,231,.96);backdrop-filter:blur(8px);border-bottom:1px solid var(--sand)}
.topbar-in{max-width:1100px;margin:0 auto;padding:12px 20px;display:flex;align-items:center;gap:14px}
.topbar .brand-mini{display:flex;align-items:center;gap:10px;font-family:var(--serif);font-size:18px;color:var(--espresso);text-decoration:none}
.brand-mini .dot{width:34px;height:34px;border-radius:50%;border:2.5px solid var(--gold);display:grid;place-items:center;font-size:15px;background:var(--cream);flex:0 0 34px}
.topbar nav{margin-left:auto;display:flex;gap:4px;align-items:center}
.navlink{border:none;background:none;padding:10px 14px;border-radius:999px;font-size:14.5px;font-weight:600;color:var(--ink);min-height:44px}
.navlink.active{background:var(--espresso);color:var(--ivory)}
.navlink:hover{background:var(--sand)}

/* ---------- progress bar (gold on espresso) ---------- */
.progress-wrap{background:var(--espresso);padding:18px 0 16px;color:var(--ivory)}
.progress-in{max-width:1100px;margin:0 auto;padding:0 20px}
.progress-label{font-family:var(--serif);font-size:19px;margin-bottom:10px;display:flex;justify-content:space-between;align-items:baseline}
.progress-label small{font-family:var(--sans);font-size:13px;opacity:.75}
.progress-track{height:8px;background:rgba(247,241,231,.18);border-radius:99px;overflow:hidden}
.progress-fill{height:100%;background:linear-gradient(90deg,var(--gold-muted),var(--gold));border-radius:99px;transition:width .8s var(--fx-ease)}

/* ---------- page layout ---------- */
.page{max-width:1100px;margin:0 auto;padding:26px 20px 70px}
.page-narrow{max-width:760px}
.hero-strip{border-radius:var(--radius);overflow:hidden;margin-bottom:26px;box-shadow:var(--shadow);position:relative}
.hero-strip img{width:100%;height:200px;object-fit:cover}
.hero-strip .strip-cap{position:absolute;left:0;right:0;bottom:0;padding:34px 24px 18px;background:linear-gradient(180deg,transparent,rgba(28,19,13,.72));color:var(--ivory)}
.hero-strip .strip-cap h2{color:var(--ivory);font-size:26px}
.sec-head{font-size:30px;margin-bottom:6px}
.sec-sub{opacity:.7;margin-bottom:24px;font-size:15.5px}

/* ---------- stage list (dashboard) ---------- */
.stage-list{display:grid;gap:12px;margin:22px 0}
.stage-row{display:flex;align-items:center;gap:16px;background:#fff;border:1.5px solid var(--sand);border-radius:var(--radius);padding:16px 18px;text-align:left;width:100%;min-height:72px;transition:border-color .25s,box-shadow .25s var(--fx-ease)}
button.stage-row{cursor:pointer}
.stage-row:hover:not(:disabled){border-color:var(--gold-muted);box-shadow:var(--shadow)}
.stage-row:disabled{opacity:.75;cursor:default}
.stage-check{width:44px;height:44px;flex:0 0 44px;border-radius:50%;border:2.5px solid var(--gold-muted);display:grid;place-items:center;font-size:20px;color:var(--gold-muted);background:var(--cream)}
.stage-row.done .stage-check{background:var(--gold);border-color:var(--gold);color:#fff}
.stage-row.current{border-color:var(--terracotta);box-shadow:var(--shadow)}
.stage-row.locked{opacity:.55}
.stage-meta{flex:1}
.stage-meta strong{display:block;font-family:var(--serif);font-size:18px;font-weight:500;color:var(--espresso)}
.stage-meta small{font-size:13px;opacity:.65}
.stage-tag{font-size:11.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:5px 11px;border-radius:99px;background:var(--sand);color:var(--espresso);white-space:nowrap}
.stage-tag.read{background:#e8e0cf}
.stage-tag.sign{background:var(--espresso);color:var(--gold)}

/* ---------- stage screen ---------- */
.stage-shell{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.stage-body{padding:30px 28px}
.read-block{background:var(--cream);border-left:4px solid var(--gold);border-radius:0 var(--radius-sm) var(--radius-sm) 0;padding:20px 22px;margin-bottom:22px}
.read-block h3{font-size:20px;margin-bottom:10px}
.read-block p{margin-bottom:12px;font-size:15.5px}
.read-block ul{margin:0 0 12px 20px;font-size:15.5px}
.read-block li{margin-bottom:6px}
.method-letters{display:grid;gap:8px;margin:14px 0}
.method-letters div{background:#fff;border:1px solid var(--sand);border-radius:var(--radius-sm);padding:10px 14px;font-size:14.5px}
.method-letters b{color:var(--terracotta-deep)}
.mode-label{display:inline-block;font-size:11.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;padding:6px 13px;border-radius:99px;margin-bottom:16px}
.mode-label.read{background:#e8e0cf;color:var(--espresso)}
.mode-label.fill{background:var(--terracotta);color:#fff}
.mode-label.sign{background:var(--espresso);color:var(--gold)}

/* ---------- signature card ---------- */
.sig-card{background:var(--ivory);border:2px solid var(--sand);border-radius:var(--radius);padding:24px;margin-top:24px}
.sig-card:focus-within{border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,162,39,.25)}
.sig-card h3{font-size:20px;margin-bottom:6px}
.sig-card p{font-size:14px;opacity:.75;margin-bottom:16px}
.sig-grid{display:grid;gap:14px}
@media(min-width:640px){.sig-grid{grid-template-columns:1fr 1fr}}
.sig-final{border-color:var(--gold);background:linear-gradient(180deg,#fffdf7,var(--ivory))}
.finish-btn{font-size:18px;padding:17px 34px}

/* ---------- completion ---------- */
.complete-hero{text-align:center;padding:20px 0 8px}
.complete-hero img{border-radius:var(--radius);box-shadow:var(--shadow);margin:0 auto 26px;max-height:340px;width:100%;object-fit:cover}
.complete-hero h2{font-size:34px;margin-bottom:10px}
.complete-hero p{max-width:560px;margin:0 auto 8px;font-size:16.5px}

/* ---------- admin ---------- */
.admin-tabs{display:flex;gap:8px;margin-bottom:24px;flex-wrap:wrap}
.admin-card{background:#fff;border:1.5px solid var(--sand);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;margin-bottom:22px}
.admin-card-h{padding:18px 22px;border-bottom:1px solid var(--sand);display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.admin-card-h h3{font-size:20px}
.admin-card-b{padding:20px 22px}
.search-row{display:flex;gap:10px;margin-bottom:16px}
.search-row input{flex:1}
.table-wrap{overflow-x:auto;margin:0 -22px;padding:0 22px}
table.dir{width:100%;border-collapse:collapse;font-size:14px;min-width:900px}
table.dir th{text-align:left;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--antique-gold);padding:10px 12px;border-bottom:2px solid var(--sand);white-space:nowrap;cursor:pointer;user-select:none}
table.dir th:hover{color:var(--terracotta-deep)}
table.dir th .arrow{font-size:10px;margin-left:4px}
table.dir td{padding:11px 12px;border-bottom:1px solid #efe7d6;vertical-align:top}
table.dir tr.rowlink{cursor:pointer}
table.dir tr.rowlink:hover td{background:var(--cream)}
.pill{display:inline-block;font-size:12px;font-weight:700;padding:4px 11px;border-radius:99px;background:var(--sand);white-space:nowrap}
.pill.ok{background:#dcebd4;color:#2e5b26}
.pill.warn{background:#f5e3c8;color:#8a5a17}
.pill.info{background:#d9e6f2;color:#274b6b}
.mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px}
.detail-group{margin-bottom:26px}
.detail-group h4{font-family:var(--serif);font-size:19px;color:var(--espresso);margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--sand)}
.qa{margin-bottom:14px}
.qa .q{font-weight:600;font-size:14px;color:var(--espresso)}
.qa .a{font-size:14.5px;white-space:pre-wrap;background:var(--cream);border-radius:var(--radius-sm);padding:10px 14px;margin-top:5px}
.qa .a.empty{opacity:.45;font-style:italic}
.sig-rec{display:flex;gap:10px;align-items:center;background:var(--cream);border-radius:var(--radius-sm);padding:10px 14px;margin-bottom:8px;font-size:14px}
.stage-ctl{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px dashed #e5dcc8;font-size:14.5px}
.stage-ctl:last-child{border-bottom:none}
.stage-ctl .grow{flex:1}
.mini-btn{border:1.5px solid var(--sand);background:#fff;border-radius:99px;padding:8px 16px;font-size:13px;font-weight:600;min-height:40px}
.mini-btn:hover{border-color:var(--terracotta);color:var(--terracotta-deep)}

/* site content editor */
.ed-table{width:100%;border-collapse:collapse;font-size:14px}
.ed-table th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--antique-gold);padding:8px;border-bottom:2px solid var(--sand)}
.ed-table td{padding:8px;border-bottom:1px solid #efe7d6;vertical-align:top}
.ed-table input,.ed-table textarea,.ed-table select{font-size:14px;padding:9px 10px;min-height:42px}
.ed-table textarea{min-height:70px}
.ed-row-add{margin-top:12px}
.toggle{position:relative;width:52px;height:30px;flex:0 0 52px}
.toggle input{opacity:0;width:100%;height:100%;position:absolute;cursor:pointer;margin:0;min-height:30px}
.toggle .tk{position:absolute;inset:0;background:#d8cdb4;border-radius:99px;transition:background .25s}
.toggle .tk::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;transition:left .25s var(--fx-ease);box-shadow:0 2px 5px rgba(0,0,0,.2)}
.toggle input:checked + .tk{background:var(--terracotta-btn)}
.toggle input:checked + .tk::after{left:25px}
.log-list{font-size:13px;max-height:180px;overflow:auto;background:var(--cream);border-radius:var(--radius-sm);padding:12px 16px}
.log-list div{padding:4px 0;border-bottom:1px dashed #e5dcc8}

/* ---------- toast ---------- */
.toast{position:fixed;left:50%;bottom:26px;translate:-50% 20px;background:var(--espresso);color:var(--ivory);
  padding:14px 24px;border-radius:99px;font-size:14.5px;font-weight:600;opacity:0;pointer-events:none;
  transition:opacity .4s var(--fx-ease),translate .4s var(--fx-ease);z-index:200;box-shadow:var(--shadow-lg);max-width:90vw;text-align:center}
.toast.show{opacity:1;translate:-50% 0}
.toast.gold{border:1.5px solid var(--gold)}

/* ---------- misc ---------- */
.kicker{font-size:12.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--antique-gold);margin-bottom:8px}
.divider{height:1px;background:var(--sand);margin:26px 0}
.nojs{max-width:560px;margin:80px auto;padding:30px;text-align:center;background:#fff;border-radius:var(--radius);box-shadow:var(--shadow)}
.loading{display:flex;align-items:center;justify-content:center;min-height:60vh;flex-direction:column;gap:16px;color:var(--antique-gold)}
.spinner{width:44px;height:44px;border-radius:50%;border:4px solid var(--sand);border-top-color:var(--gold);animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.empty-state{text-align:center;padding:40px 20px;opacity:.65}
@media(min-width:700px){
  .hero-strip img{height:260px}
  .stage-body{padding:38px 44px}
  .auth-card{padding:44px 42px}
}

/* ---------- billing (pay view + admin payments) ---------- */
.stat-row{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:6px}
.stat{flex:1;min-width:130px;background:var(--cream);border-radius:var(--radius-sm);padding:18px 14px;text-align:center}
.stat small{display:block;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--antique-gold);font-weight:700;margin-bottom:8px}
.stat strong{font-family:var(--serif);font-size:30px;color:var(--espresso);font-weight:500}
.due-input{max-width:130px}
.pay-receipt{text-align:center;padding:38px 26px}
.pay-receipt .big-check{font-size:52px;margin-bottom:10px;color:var(--terracotta-deep)}
