/* =========================================================
   The Protection Assessment — assessment.css
   A focused, private, guided experience. Same brand system as
   the homepage: Playfair Display + Inter, ink / off-white /
   lavender / powder-blue. No gradients, no imagery, restraint.
   ========================================================= */

:root {
  --ink: #0a0a0a;
  --white: #ffffff;
  --paper: #f7f6f4;
  --lav: #C9B8E8;          /* lavender accent — selection + primary button */
  --lav-soft: #f2ecfa;     /* soft lavender selection fill */
  --lav-line: #d9c9f0;
  --pow: #B8D4E8;          /* powder blue accent */
  --pow-soft: #eef6fc;
  --line: #e7e4ec;
  --muted: #6b6b73;
  --ink-soft: #3a3a42;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --dur: 0.22s;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

em { font-family: var(--serif); font-style: italic; }

/* ---------- Top bar ---------- */

.abar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: rgba(247, 246, 244, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.abar__logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.abar__logo em { font-weight: 500; }

.abar__exit {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.abar__exit:hover { color: var(--ink); border-color: var(--lav-line); }

/* ---------- Progress ---------- */

.aprogress {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}
.aprogress[hidden] { display: none; }

.aprogress__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  flex: 1 1 auto;
}
.aseg {
  height: 4px;
  border-radius: 999px;
  background: #e4e0ea;
  transition: background var(--dur) var(--ease);
}
.aseg.is-done { background: var(--lav); }

.aprogress__label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Stage + screens ---------- */

.astage {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.ascreen { display: none; }
.ascreen.is-active { display: block; }

.ascreen__inner { max-width: 620px; }
.ascreen__inner--center { text-align: center; margin: 0 auto; }

/* directional slide-in */
.ascreen.is-active[data-dir="fwd"] { animation: aSlideFwd var(--dur) var(--ease) both; }
.ascreen.is-active[data-dir="back"] { animation: aSlideBack var(--dur) var(--ease) both; }

@keyframes aSlideFwd {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes aSlideBack {
  from { opacity: 0; transform: translateX(-26px); }
  to   { opacity: 1; transform: none; }
}

/* subtle content stagger */
.ascreen.is-active .aeyebrow { animation: aRise 0.34s var(--ease) both; animation-delay: 0.02s; }
.ascreen.is-active .atitle,
.ascreen.is-active .aquestion { animation: aRise 0.36s var(--ease) both; animation-delay: 0.05s; }
.ascreen.is-active .alead,
.ascreen.is-active .asupport { animation: aRise 0.38s var(--ease) both; animation-delay: 0.09s; }
.ascreen.is-active .acards,
.ascreen.is-active .aform,
.ascreen.is-active .adetail { animation: aRise 0.4s var(--ease) both; animation-delay: 0.13s; }

@keyframes aRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Typography ---------- */

.aeyebrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7a6ca6;
  margin-bottom: 18px;
}

.atitle {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.atitle--sm { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.atitle--xs { font-size: clamp(1.4rem, 3vw, 1.8rem); }

.aquestion {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.alead {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-top: 20px;
  max-width: 54ch;
}
.ascreen__inner--center .alead { margin-left: auto; margin-right: auto; }

.asupport {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 14px;
}

/* opening detail row */
.adetail {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin-top: 26px;
}
.adetail li {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding-left: 18px;
}
.adetail li::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--lav);
}

.afine {
  margin-top: 22px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 52ch;
}
.ascreen__inner--center .afine { margin-left: auto; margin-right: auto; }
.afine--left { text-align: left; margin-top: 6px; }
.afine a { text-decoration: underline; text-decoration-color: var(--lav); text-underline-offset: 2px; }

/* ---------- Answer cards ---------- */

.acards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.acard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  min-height: 66px;
  padding: 16px 18px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.acard:hover { border-color: var(--lav-line); }
.acard:active { transform: scale(0.985); }

.acard__label {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

.acard__mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #cfcbd6;
  position: relative;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
/* multi-select marks read as rounded squares */
.ascreen[data-select="multi"] .acard__mark { border-radius: 7px; }

/* Long-label questions read better as a single stacked column */
.acards--stack { grid-template-columns: 1fr; }

/* Rank badge (Q4) — a calm ordinal chip instead of a checkbox */
.acard__rank {
  flex: 0 0 auto;
  min-width: 34px;
  height: 26px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1.5px solid #d3cfe0;
  border-radius: 999px;
  background: transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.acard.is-ranked { border-color: var(--lav); background: var(--lav-soft); }
.acard.is-ranked .acard__rank { color: var(--ink); border-color: var(--lav); background: var(--lav); }

/* Rank reorder panel */
.arank {
  margin-top: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.arank[hidden] { display: none; }
.arank__label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.arank__list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.arank__item { display: flex; align-items: center; gap: 12px; }
.arank__chip {
  flex: 0 0 auto; min-width: 34px; height: 26px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--ink);
  background: var(--lav); border-radius: 999px;
}
.arank__name { flex: 1 1 auto; font-size: 0.95rem; color: var(--ink); line-height: 1.35; }
.arank__moves { flex: 0 0 auto; display: inline-flex; gap: 6px; }
.arank__btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.arank__btn:hover { border-color: var(--lav-line); color: var(--ink); }
.arank__btn:disabled { opacity: 0.4; cursor: not-allowed; }
.arank__btn--x { color: var(--muted); font-size: 18px; }

.acard[aria-pressed="true"] {
  border-color: var(--lav);
  background: var(--lav-soft);
}
.acard[aria-pressed="true"] .acard__mark {
  border-color: var(--lav);
  background: var(--lav);
}
.acard[aria-pressed="true"] .acard__mark::after {
  content: "";
  position: absolute;
  left: 7px; top: 3.5px;
  width: 6px; height: 11px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Controls / buttons ---------- */

.acontrols {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 32px;
}
.acontrols--center { justify-content: center; }
.acontrols--result { flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 36px; }

.abtn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 26px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  line-height: 1;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform 0.12s var(--ease), opacity var(--dur) var(--ease);
}
.abtn:active { transform: scale(0.97); }

.abtn--primary { background: var(--lav); color: var(--ink); }
.abtn--primary:hover { background: #bfa9e2; }
.abtn--primary:disabled {
  background: #ece8f2;
  color: #a9a4b5;
  cursor: not-allowed;
  opacity: 1;
}
.abtn--primary:disabled:active { transform: none; }

/* Powder-blue brand variant (soft blue) — same shape as --primary. */
.abtn--pow { background: var(--pow); color: var(--ink); }
.abtn--pow:hover { background: #a6c9e0; }
.abtn--pow:disabled {
  background: #e8eff5;
  color: #9fb0bd;
  cursor: not-allowed;
  opacity: 1;
}
.abtn--pow:disabled:active { transform: none; }

.abtn--ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}
.abtn--ghost:hover { color: var(--ink); border-color: var(--lav-line); }
.abtn--ghost:disabled {
  color: #b7b2c2;
  border-color: #ece8f2;
  cursor: not-allowed;
}
.abtn--ghost:disabled:active { transform: none; }

/* Follow-up request confirmation / recovery line. */
.rfollowup__status {
  margin-top: 14px;
  font-size: 0.95rem;
  color: var(--muted);
}
.rfollowup__status[data-kind="ok"] {
  color: #2f7d4f;
  font-weight: 600;
}

.arw { transition: transform var(--dur) var(--ease); }
.abtn:hover .arw:not(.arw--l) { transform: translateX(3px); }
.abtn:hover .arw--l { transform: translateX(-3px); }

.atextlink {
  font-size: 14px;
  font-weight: 600;
  color: #7a6ca6;
  text-decoration: underline;
  text-decoration-color: var(--lav);
  text-underline-offset: 3px;
}
.atextlink:hover { color: var(--ink); }

/* ---------- Lead form ---------- */

.aform { margin-top: 28px; }

.afield-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.afield { margin-bottom: 16px; }

.afield label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.afield input,
.aselectwrap select {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  transition: border-color var(--dur) var(--ease);
}
.afield input:focus,
.aselectwrap select:focus { outline: none; border-color: var(--lav); }
.afield input::placeholder { color: #a9a4b5; }

.aselectwrap { position: relative; }
.aselectwrap::after {
  content: "";
  position: absolute;
  right: 16px; top: 50%;
  width: 8px; height: 8px;
  margin-top: -6px;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.aselectwrap select { appearance: none; -webkit-appearance: none; padding-right: 40px; }

.acheck {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}
.acheck input {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: #8a79ba;
}
.acheck--req { color: var(--ink); font-weight: 500; }

/* ---------- Transition loader ---------- */

.aloader {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}
.aloader span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--lav);
  animation: aPulse 1.1s var(--ease) infinite;
}
.aloader span:nth-child(2) { animation-delay: 0.16s; background: #cfc3e6; }
.aloader span:nth-child(3) { animation-delay: 0.32s; background: var(--pow); }
@keyframes aPulse {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-6px); }
}

/* ---------- Result ---------- */

.rblock {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.rblock:first-of-type { margin-top: 30px; }
/* When a block is hidden (e.g. the personalized-summary block with no validated AI
   reflection), it must fully collapse — explicit rule so no future display value
   can outrank the UA [hidden] rule. */
.rblock[hidden] { display: none; }

.rlabel {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.rbody {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 60ch;
}

.rblock--split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; }
.rblock--split > div { min-width: 0; }

.rpriority { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rpriority__item { display: flex; align-items: center; gap: 12px; }
.rpriority__rank {
  flex: 0 0 auto; min-width: 34px; height: 26px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--ink);
  background: var(--lav-soft); border: 1.5px solid var(--lav); border-radius: 999px;
}
.rpriority__name { font-size: 1rem; color: var(--ink); line-height: 1.4; }

.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.rcard { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.rcard__title { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; color: var(--ink); margin-bottom: 6px; }
.rcard__body { font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft); }

.rchips { display: flex; flex-wrap: wrap; gap: 9px; }
.rchip {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--pow-soft);
  border: 1px solid #d3e6f4;
  border-radius: 999px;
  padding: 7px 15px;
}

.rbadges { display: flex; flex-wrap: wrap; gap: 12px; }
.rbadge {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--lav-soft);
  border: 1.5px solid var(--lav);
  border-radius: 12px;
  padding: 16px 22px;
}
.rbadge--pow { background: var(--pow-soft); border-color: var(--pow); }

.rboundary {
  margin-top: 26px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 64ch;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ---------- Modal ---------- */

.amodal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.amodal[hidden] { display: none; }

.amodal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.44);
  animation: aFade 0.2s var(--ease) both;
}
.amodal__box {
  position: relative;
  z-index: 1;
  max-width: 460px;
  width: 100%;
  background: var(--paper);
  border-radius: 16px;
  padding: 34px 30px 30px;
  animation: aPop 0.22s var(--ease) both;
}
.amodal__close {
  position: absolute;
  top: 12px; right: 14px;
  width: 34px; height: 34px;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.amodal__close:hover { color: var(--ink); }
.amodal .aeyebrow { color: #7a6ca6; }
.amodal .alead { margin-top: 14px; font-size: 0.96rem; }
.amodal .acontrols { margin-top: 24px; }

@keyframes aFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .astage { padding: 28px 20px 60px; }
  .acards { grid-template-columns: 1fr; }
  .rblock--split { grid-template-columns: 1fr; gap: 22px; }
  .rcards { grid-template-columns: 1fr; }
  .afield-row { grid-template-columns: 1fr; gap: 0; }
  .acontrols { gap: 10px; }
  .abtn { padding: 14px 20px; }
  .aquestion { max-width: none; }
  .aprogress { padding-top: 16px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .ascreen.is-active[data-dir] { animation: none; }
}

/* ---------- Result: personalized summary states + focus list + notice ---------- */

.rfocus { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rfocus__item { position: relative; padding-left: 22px; line-height: 1.5; }
.rfocus__item::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.55; }

.rbody--muted { opacity: 0.85; }

.rpending { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid rgba(0,0,0,0.10); border-radius: 12px; background: rgba(0,0,0,0.02); }
/* The display:flex above outranks the UA [hidden] rule, so the loader must be
   explicitly hidden when the summary resolves — otherwise it spins forever. */
.rpending[hidden] { display: none; }
.rspin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.2); border-top-color: currentColor; display: inline-block; animation: rspin 0.9s linear infinite; flex: none; }
@keyframes rspin { to { transform: rotate(360deg); } }

.rreflection { display: grid; gap: 14px; }
.rreflection[hidden] { display: none; }
.rreflection__p { margin: 0; line-height: 1.6; }
.rmicro { margin: 10px 0 0; font-size: 0.86rem; opacity: 0.7; }

.rnotice { margin: 14px 0 22px; padding: 14px 16px; border: 1px solid rgba(0,0,0,0.12); border-radius: 12px; background: rgba(0,0,0,0.03); line-height: 1.5; }

/* Honeypot: kept in the DOM, kept out of sight and off the tab order. */
.ahp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.afooter { text-align: center; padding: 34px 20px 46px; font-size: 0.9rem; opacity: 0.75; }
.afooter a { color: inherit; }

@media (prefers-color-scheme: dark) {
  .rpending { border-color: rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); }
  .rspin { border-color: rgba(255,255,255,0.25); border-top-color: currentColor; }
  .rnotice { border-color: rgba(255,255,255,0.16); background: rgba(255,255,255,0.05); }
}
