/* ===========================================================================
   Pro-Fillment AI — shared brand system (brand.css)
   Single source of truth for design tokens + base + common components.
   Loaded by the hub and every new journey module. RTL-first, logical props.
   Mirrors the tokens in the (self-contained) install guide so the whole
   journey looks like one product.
   =========================================================================== */

/* ---------------------------- Brand tokens ------------------------------- */
:root{
  --bg:#F4F7FB; --surface:#FFFFFF; --surface-2:#EEF2F8;
  --ink:#16243F; --ink-soft:#5A6678; --line:#E2E8F1;
  --brand:#1FAEC4; --brand-strong:#0E8497; --brand-2:#5A57B5; --brand-soft:#E4F5F8;
  --grad:linear-gradient(135deg,#1FAEC4 0%,#5A57B5 100%);
  --grad-bright:linear-gradient(135deg,#37C8DC 0%,#9B98EC 100%);
  --navy:#16284A; --navy-deep:#0B1124;
  --safe:#15A38F; --safe-soft:#DEF3EF;
  --warn-soft:#FCEED6; --warn-ink:#9A6212;
  --info:#5A57B5; --info-soft:#ECEBF7;
  --radius:20px; --radius-sm:12px; --radius-lg:24px;
  --shadow:0 10px 30px rgba(22,40,74,.10), 0 2px 6px rgba(22,40,74,.06);
  --shadow-sm:0 2px 8px rgba(22,40,74,.07);
  --shadow-lg:0 20px 50px rgba(22,40,74,.16);
  --maxw:820px;
  --font:'Heebo','Assistant','Rubik',system-ui,'Segoe UI',Arial,sans-serif;
  --mono:'SFMono-Regular',ui-monospace,'Cascadia Code','Consolas','Courier New',monospace;
}

/* ------------------------------- Base ------------------------------------ */
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{margin:0; font-family:var(--font); background:var(--bg); color:var(--ink); font-size:18px; line-height:1.7; -webkit-font-smoothing:antialiased;}
@media (prefers-reduced-motion:reduce){ html{scroll-behavior:auto;} *{animation:none !important; transition:none !important;} }
h1,h2,h3{line-height:1.3; margin:0 0 .4em;}
h1{font-size:clamp(1.8rem,5.2vw,2.7rem); font-weight:900; letter-spacing:-.01em;}
h2{font-size:clamp(1.35rem,4vw,1.85rem); font-weight:800;}
h3{font-size:1.12rem; font-weight:700;}
p{margin:0 0 1rem;}
a{color:var(--brand-strong); text-underline-offset:3px;}
a:hover{color:var(--brand);}
ul{margin:0 0 1rem; padding-inline-start:1.3em;} li{margin-bottom:.5em;}
strong{font-weight:700;}
:focus-visible{outline:3px solid var(--brand); outline-offset:2px; border-radius:6px;}
h1:focus,h2:focus,h3:focus{outline:none;}
.grad{background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;}
[hidden]{display:none !important;}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}

/* numbers / latin fragments inside RTL — keep them from visually flipping */
.ltr{direction:ltr; unicode-bidi:isolate; text-align:start;}

/* ------------------------------- Logo ------------------------------------ */
.brand-logo{display:inline-flex; align-items:center; gap:10px; font-weight:800; line-height:1;}
.brand-logo .ai{color:var(--brand);}
.brand-logo svg.lg{width:34px; height:34px; flex:0 0 auto;}
.brand-logo .logo-img{height:34px; width:auto; display:inline-block; flex:0 0 auto;}
.brand-mini{display:inline-flex; align-items:center; gap:7px; font-weight:800; font-size:.92rem; color:var(--ink); white-space:nowrap;}
.brand-mini .ai{color:var(--brand);}
.brand-mini svg.lg{width:24px; height:24px; flex:0 0 auto;}
.brand-mini .logo-img{height:24px; width:auto; display:inline-block; flex:0 0 auto;}
@media (max-width:620px){ .brand-mini .txt{display:none;} }

/* ------------------------------ Buttons ---------------------------------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; border:0; cursor:pointer;
  font-family:inherit; font-weight:800; font-size:1rem; border-radius:12px; padding:13px 24px; min-height:50px;
  text-decoration:none; transition:.15s; white-space:nowrap;}
.btn-primary{background:var(--grad); color:#fff; box-shadow:0 6px 16px rgba(31,174,196,.30);}
.btn-primary:hover{filter:brightness(1.06); color:#fff;}
.btn-ghost{background:var(--surface); color:var(--ink); border:1px solid var(--line);}
.btn-ghost:hover{border-color:var(--brand); background:var(--brand-soft);}
.btn-soft{background:var(--surface-2); color:var(--ink); }
.btn-soft:hover{background:var(--brand-soft);}
.btn[disabled]{opacity:.5; cursor:not-allowed; filter:none;}

/* ------------------------------- Cards ----------------------------------- */
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:26px 22px; margin-block:20px;}
@media (min-width:640px){ .card{padding:32px 32px;} }

/* ------------------------------ Callouts --------------------------------- */
.callout{border-radius:var(--radius-sm); padding:16px 18px; margin-block:16px; border:1px solid transparent;}
.callout p:last-child{margin-bottom:0;}
.callout .ct{font-weight:700; display:flex; align-items:center; gap:8px; margin-bottom:6px;}
.callout.tip{background:var(--info-soft); border-color:#d6d5ef;} .callout.tip .ct{color:var(--info);}
.callout.warn{background:var(--warn-soft); border-color:#f3dcae;} .callout.warn .ct{color:var(--warn-ink);}
.callout.safe{background:var(--safe-soft); border-color:#bfe5dc;} .callout.safe .ct{color:var(--safe);}
.callout.reassure{background:var(--brand-soft); border-color:#c5e9ef;} .callout.reassure .ct{color:var(--brand-strong);}

/* ------------------------------- Footer ---------------------------------- */
footer.pf{margin-top:48px; background:linear-gradient(160deg,var(--navy) 0%, var(--navy-deep) 100%); color:#9fb0c9;}
footer.pf .fin{max-width:var(--maxw); margin-inline:auto; padding:36px 18px; text-align:center;}
footer.pf .brand-logo{justify-content:center; color:#fff; font-size:1.05rem; margin-bottom:10px;}
footer.pf .tag{color:#9fb6d6; font-size:.92rem; font-weight:600;}
footer.pf .verify{color:#6f7f9c; font-size:.78rem; margin-top:12px;}

/* ------------------------- Confetti (shared) ----------------------------- */
.confetti{position:fixed; top:-20px; width:11px; height:14px; z-index:99; pointer-events:none; border-radius:2px; animation:pf-fall linear forwards;}
@keyframes pf-fall{to{transform:translateY(104vh) rotate(540deg); opacity:.9;}}

/* -------------------------- Toast (shared) ------------------------------- */
.toast{position:fixed; inset-block-end:24px; inset-inline:0; margin-inline:auto; width:max-content; max-width:90%;
  background:var(--ink); color:#fff; font-weight:800; padding:13px 24px; border-radius:999px;
  box-shadow:0 12px 34px rgba(0,0,0,.28); z-index:90; opacity:0; transform:translateY(12px); transition:.28s; pointer-events:none;}
.toast.show{opacity:1; transform:translateY(0);}

/* ===================== Shared chrome (hub + modules) ===================== */
/* Sticky header + progress rule */
header.app{position:sticky; top:0; z-index:50; background:rgba(244,247,251,.94); backdrop-filter:saturate(140%) blur(8px);}
header.app .topbar{max-width:var(--maxw); margin-inline:auto; display:flex; align-items:center; gap:10px 12px; padding:9px 16px;}
header.app .prog-chip{margin-inline-start:auto; display:inline-flex; align-items:center; gap:8px; font-weight:800; font-size:.86rem; color:var(--brand-strong); background:var(--surface-2); padding:6px 13px; border-radius:999px;}
header.app .prog-chip .pc-dot{width:8px;height:8px;border-radius:50%;background:var(--grad);}
header.app .icon-reset{border:0; background:transparent; cursor:pointer; color:var(--ink-soft); font-size:1.05rem; padding:7px; border-radius:10px; min-height:36px; min-width:36px;}
header.app .icon-reset:hover{background:var(--surface-2); color:var(--ink);}
.grad-rule{height:4px; background:var(--surface-2);}
.grad-rule .fill{height:100%; width:0%; background:var(--grad); transition:width .6s cubic-bezier(.2,.8,.2,1);}
.back-journey{display:inline-flex; align-items:center; gap:6px; text-decoration:none; font-family:inherit; font-weight:700; font-size:.85rem; color:var(--brand-strong); background:var(--surface-2); padding:7px 13px; border-radius:999px; min-height:36px;}
.back-journey:hover{background:var(--brand-soft); color:var(--brand-strong);}
@media (max-width:620px){ .back-journey .bj-txt{display:none;} }

/* Journey stepper: station-level "where am I" (mindset/install.html/automation
   hub omitted — it already shows the full path). Mirrored inline in
   install.html, which stays deliberately dependency-free; keep both in sync. */
.pf-stepper{display:flex; align-items:center; max-width:var(--maxw); margin-inline:auto;
  padding:10px 16px 12px; border-block-end:1px solid var(--line); background:var(--surface);}
.ps-step{display:flex; align-items:center; gap:6px; flex:1 1 auto; min-width:0;
  text-decoration:none; color:inherit; font-family:inherit;}
a.ps-step{cursor:pointer;}
.ps-dot{flex:0 0 auto; width:22px; height:22px; border-radius:50%; display:grid; place-items:center;
  font-size:.68rem; font-weight:900; background:var(--surface-2); color:var(--ink-soft);
  border:2px solid var(--line); transition:.15s;}
.ps-label{font-size:.74rem; font-weight:700; color:var(--ink-soft); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; transition:.15s;}
.ps-step.is-done .ps-dot{background:var(--safe); border-color:var(--safe); color:#fff;}
.ps-step.is-done .ps-label{color:var(--ink);}
.ps-step.is-now .ps-dot{background:var(--grad); border-color:transparent; color:#fff; box-shadow:0 0 0 3px var(--brand-soft);}
.ps-step.is-now .ps-label{color:var(--ink); font-weight:800;}
.ps-step.is-locked{opacity:.6;}
.ps-step.is-locked .ps-dot{background:var(--surface-2); border-style:dashed;}
a.ps-step:hover .ps-dot{border-color:var(--brand);}
.ps-line{flex:0 0 16px; height:2px; background:var(--line); margin:0 2px; align-self:center;}
.ps-line.is-done{background:var(--safe);}
@media (max-width:620px){
  .pf-stepper{padding:9px 12px 11px;}
  .ps-label{display:none;}
  .ps-step.is-now .ps-label{display:inline;}   /* the current station keeps its name on a phone */
  .ps-line{flex-basis:12px;}
}

/* Section heading */
.sec-head{display:flex; align-items:flex-start; gap:14px; margin-bottom:10px;}
.sec-emoji{flex:0 0 auto; width:46px; height:46px; border-radius:14px; display:grid; place-items:center; font-size:1.3rem; background:var(--grad); color:#fff; box-shadow:0 6px 14px rgba(31,174,196,.30);}
.sec-head .titles{flex:1 1 auto; min-width:0;}
.sec-head .titles p{margin:.2em 0 0; color:var(--ink-soft); font-size:.97rem;}

/* Chips (single/multi select) */
.chips{display:flex; flex-wrap:wrap; gap:9px;}
.chip{border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; font-family:inherit; font-weight:600; font-size:.96rem; padding:10px 16px; border-radius:999px; min-height:44px; transition:.15s;}
.chip:hover{border-color:var(--brand); background:var(--brand-soft);}
.chip[aria-pressed="true"]{background:var(--grad); color:#fff; border-color:transparent; box-shadow:0 4px 12px rgba(31,174,196,.30);}
.chip[disabled]{opacity:.45; cursor:not-allowed;}
.chip[disabled]:hover{border-color:var(--line); background:var(--surface);}

/* ------------------- Week strip (the "Tuesday" motif) -------------------- */
/* A 7-day Sun–Sat row. Work days are plain; Shabbat is a soft rest; the
   highlighted "rest" day (Tuesday) gets the brand gradient + a coffee badge,
   so it reads as a second weekend in the middle of the week. */
.weekstrip{display:flex; gap:6px; flex-wrap:wrap; margin:2px 0 0;}
.weekstrip .wd{flex:0 0 auto; width:38px; height:42px; border-radius:11px; display:grid; place-items:center;
  background:var(--surface-2); color:var(--ink-soft); font-weight:800; font-size:.98rem; border:1px solid var(--line);}
.weekstrip .wd.dim{opacity:.5;}
.weekstrip .wd.shabbat{background:var(--brand-soft); color:var(--brand-strong); border-color:#c5e9ef;}
.weekstrip .wd.rest{background:var(--grad); color:#fff; border-color:transparent; box-shadow:0 5px 14px rgba(31,174,196,.32); position:relative;}
.weekstrip .wd.rest::after{content:"☕"; position:absolute; top:-10px; inset-inline-end:-7px; font-size:.85rem; filter:drop-shadow(0 1px 1px rgba(0,0,0,.18));}
.weekstrip-cap{margin:11px 0 0; font-size:.88rem; color:var(--ink-soft); font-weight:600;}
.weekstrip-cap strong{color:var(--brand-strong); font-weight:800;}
/* keep all 7 days on one row on narrow screens (tight inside the hook callout) */
@media (max-width:480px){
  .weekstrip{gap:4px;}
  .weekstrip .wd{width:32px; height:38px; font-size:.88rem;}
}
