/* ==========================================================================
   Salesforce Readiness Review — /scope/
   Loads after site.css and reuses its tokens.
   Built mobile-first: the base rules are the phone layout, and the sidebar
   and multi-column grids are added at breakpoints. Touch targets are kept at
   or above 44px, which is what actually drives the option sizing below.
   ========================================================================== */

:root {
  --tone-good: #2F7D5E;
  --tone-ok:   #A97426;
  --tone-warn: #C1662B;
  --tone-bad:  #B3402F;
  --tone-none: #B9B4A9;
  --stick-top: 60px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --tone-good: #5FBF95;
    --tone-ok:   #D9A455;
    --tone-warn: #E0894C;
    --tone-bad:  #E4705E;
    --tone-none: #4A515B;
  }
}
@media (min-width: 700px) { :root { --stick-top: 72px; } }

.hide-xs { display: none; }
@media (min-width: 560px) { .hide-xs { display: inline; } }

/* --- Hero --------------------------------------------------------------- */
.rev-hero { padding: clamp(2.25rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.25rem); }
.rev-hero h1 { font-size: clamp(1.75rem, 6.4vw, 3rem); max-width: 22ch; }
.rev-hero .lede { margin-top: 1.1rem; font-size: clamp(1rem, 3.6vw, 1.2rem); }
.rev-hero strong { color: var(--ink); font-weight: 600; }

/* --- Gate (role + cloud) ------------------------------------------------- */
.gate { display: grid; gap: 1.75rem; padding-bottom: 1.5rem; }
@media (min-width: 780px)  { .gate { grid-template-columns: 1fr 1fr; gap: 2.25rem; } }
@media (min-width: 1120px) { .gate { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

.gate__label {
  font-family: var(--font-body); font-size: 1.08rem; font-weight: 600; letter-spacing: -.012em;
}
.gate__hint { color: var(--slate); font-size: .89rem; margin-top: .4rem; line-height: 1.6; }
.gate__opts { display: grid; gap: .55rem; margin-top: 1rem; }

.gopt { position: relative; display: block; cursor: pointer; }
.gopt input { position: absolute; opacity: 0; width: 0; height: 0; }
.gopt__box {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem .95rem; background: var(--paper); min-height: 44px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.gopt:hover .gopt__box { border-color: var(--slate-dim); }
.gopt input:checked + .gopt__box {
  border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent);
}
.gopt input:focus-visible + .gopt__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.gopt__t { display: block; font-weight: 500; font-size: .95rem; }
.gopt__meta {
  display: block; font-family: var(--font-mono); font-size: .68rem; font-weight: 400;
  letter-spacing: .04em; color: var(--accent); margin-top: .2rem;
}
.gopt__d { display: block; color: var(--slate); font-size: .83rem; margin-top: .18rem; line-height: 1.45; }

.gate__wait {
  color: var(--slate-dim); font-size: .9rem; padding-bottom: clamp(3rem, 8vw, 5rem);
  max-width: 60ch; line-height: 1.65;
}

/* --- Sticky progress ---------------------------------------------------- */
.rev-sticky {
  position: sticky; top: var(--stick-top); z-index: 40;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-block: 1px solid var(--line);
}
.rev-sticky__inner {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center;
  gap: .5rem .75rem; padding-block: .6rem;
}
.rev-sticky__prog { grid-column: 1 / -1; order: 3; }
.rev-sticky__bar { height: 4px; border-radius: 100px; background: var(--paper-3); overflow: hidden; }
.rev-sticky__bar span {
  display: block; height: 100%; width: 0; background: var(--accent);
  transition: width .3s cubic-bezier(.4,0,.2,1);
}
.rev-sticky__text {
  display: block; margin-top: .35rem; font-family: var(--font-mono);
  font-size: .68rem; color: var(--slate-dim); letter-spacing: .04em;
}
.rev-jump {
  order: 1; grid-column: 1; min-width: 0; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: .5rem .6rem; font-size: .85rem; color: var(--ink); min-height: 44px;
}
.rev-sticky__score { order: 2; display: flex; align-items: baseline; gap: .4rem; }
.rev-sticky__label { display: none; }
.rev-sticky__score strong {
  font-family: var(--font-display); font-size: 1.28rem; font-weight: 500; letter-spacing: -.02em;
}
.rev-clear { order: 2; white-space: nowrap; }

@media (min-width: 940px) {
  .rev-sticky__inner { grid-template-columns: minmax(0,1fr) 14rem auto auto; }
  .rev-sticky__prog { grid-column: 1; order: 1; }
  .rev-jump { display: none; }
  .rev-sticky__score { order: 3; }
  .rev-sticky__label {
    display: inline; font-family: var(--font-mono); font-size: .64rem;
    letter-spacing: .14em; text-transform: uppercase; color: var(--slate-dim);
  }
  .rev-clear { order: 4; }
}

.badge { font-size: .7rem; font-weight: 500; padding: .16rem .5rem; border-radius: 100px; border: 1px solid currentColor; }
.badge[data-tone="good"] { color: var(--tone-good); }
.badge[data-tone="ok"]   { color: var(--tone-ok); }
.badge[data-tone="warn"] { color: var(--tone-warn); }
.badge[data-tone="bad"]  { color: var(--tone-bad); }
.badge[data-tone="none"] { color: var(--tone-none); }
.btn--sm { padding: .45rem .75rem; font-size: .82rem; min-height: 44px; }

/* --- Layout ------------------------------------------------------------- */
.rev-layout { display: grid; gap: 2rem; padding-block: 2rem clamp(3.5rem, 8vw, 5.5rem); }
@media (min-width: 940px) {
  .rev-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: 3.5rem; }
}
.rev-side { display: none; }
@media (min-width: 940px) {
  .rev-side { display: block; position: sticky; top: calc(var(--stick-top) + 76px); align-self: start; }
}

.revnav { display: flex; flex-direction: column; }
.revnav__step {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--slate-dim); margin: 1.25rem 0 .45rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line);
}
.revnav__step:first-child { margin-top: 0; }
.revnav__item {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  padding: .4rem 0 .4rem .7rem; margin-left: -.7rem; text-decoration: none;
  color: var(--slate); font-size: .875rem; border-left: 2px solid transparent;
  transition: color .15s ease;
}
.revnav__item:hover { color: var(--ink); }
.revnav__item.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
.revnav__count { font-family: var(--font-mono); font-size: .66rem; color: var(--slate-dim); flex: none; }
.revnav__count.is-done { color: var(--tone-good); }

/* --- Questions ---------------------------------------------------------- */
.qsec { padding-bottom: clamp(2rem, 5vw, 3rem); scroll-margin-top: calc(var(--stick-top) + 90px); }
.qsec__head { margin-bottom: 1.35rem; }
.qsec__step {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.qsec__head h2 {
  font-family: var(--font-body); font-size: clamp(1.2rem, 4.4vw, 1.42rem);
  font-weight: 600; letter-spacing: -.015em; margin-top: .35rem;
}
.qsec__head > p { color: var(--slate); font-size: .92rem; margin-top: .4rem; max-width: 62ch; line-height: 1.6; }
.qsec__meter { height: 2px; background: var(--line); margin-top: 1rem; border-radius: 100px; overflow: hidden; }
.qsec__meter span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s cubic-bezier(.4,0,.2,1); }

.q { padding: 1.25rem 0; border-top: 1px solid var(--line-soft); }
.q:first-of-type { border-top: 0; }
.q__text { font-weight: 500; font-size: clamp(.97rem, 3.7vw, 1rem); letter-spacing: -.008em; line-height: 1.45; }
.q__help { color: var(--slate-dim); font-size: .845rem; margin-top: .3rem; max-width: 62ch; line-height: 1.55; }
.q__opts { display: grid; gap: .45rem; margin-top: .85rem; }
@media (min-width: 700px) { .q__opts { grid-template-columns: 1fr 1fr; } }

.qopt { position: relative; display: block; cursor: pointer; }
.qopt input { position: absolute; opacity: 0; width: 0; height: 0; }
.qopt__box {
  display: flex; align-items: center; min-height: 46px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .6rem .85rem; background: var(--paper); font-size: .9rem; line-height: 1.4;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.qopt:hover .qopt__box { border-color: var(--slate-dim); }
.qopt input:checked + .qopt__box {
  border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent);
}
.qopt input:focus-visible + .qopt__box { outline: 2px solid var(--accent); outline-offset: 2px; }
/* "Not sure" reads as a legitimate answer, not a failure to answer. */
.qopt--unsure .qopt__box { border-style: dashed; color: var(--slate); }
.qopt--unsure input:checked + .qopt__box { border-style: solid; color: var(--ink); }

.q__clear {
  margin-top: .6rem; background: none; border: 0; cursor: pointer; padding: .35rem 0;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em;
  color: var(--slate-dim); text-decoration: underline; text-underline-offset: .25em;
}
.q__clear:hover { color: var(--ink); }

/* --- Fields ------------------------------------------------------------- */
.fields { display: grid; gap: .9rem; }
@media (min-width: 640px) { .fields--2 { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-size: .83rem; font-weight: 500; color: var(--slate); margin-bottom: .35rem; }
.opt-tag { font-weight: 400; color: var(--slate-dim); font-size: .76rem; }
.field input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: .7rem .85rem; font-size: 1rem; color: var(--ink); min-height: 46px;
  transition: border-color .15s ease;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* --- Results ------------------------------------------------------------ */
.results { border-top: 1px solid var(--line); padding-top: clamp(2rem, 5vw, 3rem); scroll-margin-top: calc(var(--stick-top) + 90px); }
.results__h { font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; margin: 2.25rem 0 .9rem; display: flex; align-items: center; gap: .55rem; }
.results__n { font-family: var(--font-mono); font-size: .7rem; color: var(--paper); background: var(--ink); border-radius: 100px; padding: .1rem .48rem; }
.results__none, .results__empty { color: var(--slate); font-size: .92rem; margin-top: 1.25rem; line-height: 1.65; }
.results__empty { padding: 1.75rem 0; border-top: 1px solid var(--line); }

.scorecard { display: grid; gap: .5rem; }
.score { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: center; padding: .35rem 0; }
.score__track { grid-column: 1 / -1; order: 3; height: 6px; background: var(--paper-3); border-radius: 100px; overflow: hidden; }
@media (min-width: 620px) {
  .score { grid-template-columns: 13rem 1fr 4.5rem; }
  .score__track { grid-column: auto; order: 0; }
}
.score__name { font-size: .9rem; text-decoration: none; color: var(--ink); }
.score__name:hover { color: var(--accent-ink); text-decoration: underline; }
.score__track span { display: block; height: 100%; border-radius: 100px; transition: width .35s cubic-bezier(.4,0,.2,1); }
.score__track span[data-tone="good"] { background: var(--tone-good); }
.score__track span[data-tone="ok"]   { background: var(--tone-ok); }
.score__track span[data-tone="warn"] { background: var(--tone-warn); }
.score__track span[data-tone="bad"]  { background: var(--tone-bad); }
.score__track span[data-tone="none"] { background: var(--tone-none); }
.score__val { font-family: var(--font-mono); font-size: .74rem; text-align: right; }
.score__val[data-tone="good"] { color: var(--tone-good); }
.score__val[data-tone="ok"]   { color: var(--tone-ok); }
.score__val[data-tone="warn"] { color: var(--tone-warn); }
.score__val[data-tone="bad"]  { color: var(--tone-bad); }
.score__val[data-tone="none"] { color: var(--slate-dim); }

.findings { list-style: none; padding: 0; display: grid; gap: .7rem; }
.finding {
  border: 1px solid var(--line); border-left: 3px solid var(--tone-warn);
  border-radius: var(--radius); background: var(--paper-2); padding: .9rem 1rem;
}
.finding[data-sev="high"] { border-left-color: var(--tone-bad); }
.finding__sec {
  display: block; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--slate-dim); margin-bottom: .3rem;
}
.finding p { font-size: .9rem; color: var(--slate); line-height: 1.6; }

/* --- Takeaway / submit -------------------------------------------------- */
.takeaway, .analysis {
  margin-top: 2.25rem; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.2rem, 4vw, 1.9rem); background: var(--paper-2);
}
.analysis { border-left: 3px solid var(--accent); }
.takeaway h3, .analysis h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.takeaway__lede, .analysis p { color: var(--slate); font-size: .92rem; margin-top: .55rem; line-height: 1.7; }
.takeaway__row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.takeaway__row .btn { flex: 1 1 14rem; justify-content: center; }
.takeaway__note, .analysis__note, .analysis__why {
  color: var(--slate-dim); font-size: .83rem; margin-top: .9rem; line-height: 1.65; max-width: 68ch;
}

.reqs { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .4rem; }
.reqs li {
  font-size: .87rem; color: var(--slate); padding-left: 1.6rem; position: relative; line-height: 1.5;
}
.reqs li::before {
  content: "\2717"; position: absolute; left: 0; top: -.05em;
  font-size: .95em; color: var(--tone-warn);
}
.reqs li[data-met="true"] { color: var(--slate-dim); }
.reqs li[data-met="true"]::before { content: "\2713"; color: var(--tone-good); }

.analysis .fields { margin-top: 1.25rem; }
.analysis #btnSend { margin-top: 1rem; }
@media (max-width: 559px) { .analysis #btnSend, .takeaway__row .btn { width: 100%; justify-content: center; } }

.sendmsg {
  margin-top: .8rem; font-size: .87rem; line-height: 1.6; color: var(--tone-warn);
  max-width: 64ch; display: flex; gap: .5rem; align-items: baseline;
}
.sendmsg::before { content: "!"; font-family: var(--font-mono); font-weight: 600; flex: none; }

/* --- Privacy notice ----------------------------------------------------- */
.notice {
  position: fixed; z-index: 80; left: 1rem; right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--radius); padding: 1.15rem 1.2rem 1.2rem;
  box-shadow: 0 18px 48px -18px rgba(0,0,0,.45);
  transform: translateY(140%); opacity: 0;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
}
.notice[data-show="true"] { transform: translateY(0); opacity: 1; }
@media (min-width: 700px) { .notice { left: auto; right: 1.5rem; bottom: 1.5rem; max-width: 26rem; } }

.notice h2 { font-family: var(--font-body); font-size: .98rem; font-weight: 600; padding-right: 1.75rem; }
.notice p { color: var(--slate); font-size: .855rem; line-height: 1.62; margin-top: .6rem; }
.notice strong { color: var(--ink); font-weight: 600; }
.notice code {
  font-family: var(--font-mono); font-size: .85em; background: var(--paper-3);
  padding: .06em .32em; border-radius: 3px;
}
.notice__x {
  position: absolute; top: .5rem; right: .5rem; width: 34px; height: 34px;
  background: none; border: 0; cursor: pointer; color: var(--slate-dim); font-size: .9rem;
  border-radius: var(--radius);
}
.notice__x:hover { color: var(--ink); background: var(--paper-2); }
.notice__ok { margin-top: 1rem; width: 100%; justify-content: center; }

/* --- Toast -------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 90;
  max-width: min(34rem, calc(100vw - 2rem));
  background: var(--ink); color: var(--paper); padding: .75rem 1.1rem;
  border-radius: var(--radius); font-size: .86rem; line-height: 1.5; text-align: center;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.5);
}
