/* ===== Your Inner Compass: paid assessment interface (Phase 2C2) =====
   Reuses the site's tokens (--ink, --violet, --line, --surface ...) and
   button classes. Calm and readable for a 66-question sitting: one card,
   generous type, restrained motion, no sticky overlay covering answers. */

.ica-shell { max-width: 640px; margin: 0 auto; padding: 8px 0 48px; }

/* ---- progress ---- */
.ica-progress { margin-bottom: 22px; }
.ica-progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ica-section {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--violet-deep); margin: 0;
}
.ica-count { font-size: 0.86rem; color: var(--ink-muted); margin: 0; }
.ica-bar {
  margin-top: 10px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden;
}
.ica-bar-fill {
  display: block; height: 100%; border-radius: 99px; background: var(--violet);
  transition: width 320ms ease;
}
.ica-progress-text { margin: 8px 0 0; font-size: 0.84rem; color: var(--ink-soft); }

/* ---- question card ---- */
.ica-card {
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface);
  padding: 26px 24px; margin: 0; box-shadow: 0 1px 2px rgba(30, 27, 46, 0.04);
}
/* A <legend> is positioned in the fieldset's border box by default, which
   would float the prompt outside the card. Floating it makes it flow
   normally inside the padding box while keeping the fieldset/legend
   semantics that screen readers rely on. */
.ica-prompt {
  float: left; width: 100%;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.32rem; line-height: 1.4; color: var(--ink); font-weight: 600;
  padding: 0; margin: 0 0 20px; text-wrap: balance;
}
.ica-card::after { content: ""; display: table; clear: both; }
/* the floated legend above must be cleared, or this flex container is
   squeezed alongside it, collapses to zero width and its options overflow */
.ica-options { clear: both; display: flex; flex-direction: column; gap: 10px; }

/* full label is the tap target, comfortably over 44px tall */
.ica-option {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; transition: border-color 140ms ease, background 140ms ease;
}
.ica-option:hover { border-color: var(--violet); }
.ica-option input[type="radio"] {
  width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--violet); margin: 0; cursor: pointer;
}
.ica-option-label { font-size: 1rem; line-height: 1.45; color: var(--ink); }
.ica-option.is-selected { border-color: var(--violet); background: var(--violet-soft); }
.ica-option:focus-within { outline: 3px solid var(--violet); outline-offset: 2px; }

/* forced choice reads as two considered options, never right vs wrong */
.ica-choice .ica-option { align-items: flex-start; padding: 16px; }
.ica-choice .ica-option-label { font-size: 1.02rem; }

/* ---- save status + nav ---- */
.ica-save-status {
  min-height: 1.3em; margin: 14px 0 0; font-size: 0.86rem; color: var(--ink-muted); text-align: right;
}
.ica-nav { display: flex; gap: 12px; margin-top: 20px; }
.ica-nav .btn { flex: 1; min-height: 48px; }
.ica-nav .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- shared states ---- */
.ica-state { max-width: 520px; margin: 48px auto; text-align: center; padding: 0 20px 40px; }
.ica-state-title { font-size: 1.5rem; line-height: 1.3; margin: 0 0 12px; color: var(--ink); }
.ica-state-body { color: var(--ink-soft); line-height: 1.6; margin: 0 0 22px; }
.ica-spinner {
  width: 28px; height: 28px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--violet);
  animation: ica-spin 800ms linear infinite;
}
@keyframes ica-spin { to { transform: rotate(360deg); } }

/* ---- review ---- */
.ica-review-head { max-width: 720px; margin: 0 auto 26px; text-align: center; padding: 0 4px; }
.ica-review-title { font-size: 1.8rem; margin: 0 0 8px; color: var(--ink); }
.ica-review-sub { color: var(--ink-soft); margin: 0; line-height: 1.6; }
.ica-review-block { max-width: 720px; margin: 0 auto 34px; }
.ica-review-block > h2 { font-size: 1.25rem; margin: 0 0 6px; color: var(--ink); }
.ica-review-note { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 14px; line-height: 1.55; }
.ica-review-section { margin-top: 20px; }
.ica-review-section h3 {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--violet-deep); margin: 0 0 8px;
}
.ica-review-list { list-style: none; margin: 0; padding: 0; }
.ica-review-item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.ica-review-q { color: var(--ink); line-height: 1.5; font-size: 0.96rem; }
.ica-review-n {
  display: inline-block; min-width: 2.1em; color: var(--ink-muted); font-variant-numeric: tabular-nums;
}
.ica-review-a {
  grid-column: 1; color: var(--violet-deep); font-weight: 600; font-size: 0.92rem; padding-left: 2.1em;
}
.ica-edit { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-height: 44px; padding: 0 8px; }
.ica-review-item.is-readonly .ica-review-a { color: var(--ink-soft); }
.ica-review-item.is-missing .ica-review-a { color: var(--coral); }

/* ---- post-completion Results Summary (Phase 2B-R4.1) ----
   Derived-data only: no per-question list, so no grid/edit affordance
   is needed. Reuses the same tokens and card language as the rest of
   this file (--ink, --ink-soft, --violet-deep, --surface, --line). */
.ica-summary-head { max-width: 640px; margin: 0 auto 26px; text-align: center; padding: 0 4px; }
.ica-summary-title { font-size: 1.8rem; margin: 0 0 8px; color: var(--ink); }
.ica-summary-sub { color: var(--ink-soft); margin: 0; line-height: 1.6; }
.ica-summary-identity {
  max-width: 640px; margin: 0 auto 30px; text-align: center; padding: 22px 20px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface);
}
.ica-summary-identity-pills { font-weight: 700; font-size: 1.15rem; color: var(--violet-deep); margin: 0 0 6px; }
.ica-summary-disc { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
.ica-summary-block { max-width: 640px; margin: 0 auto 34px; }
.ica-summary-block > h2 { font-size: 1.25rem; margin: 0 0 14px; color: var(--ink); text-align: center; }
.ica-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.ica-summary-item {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  padding: 16px 18px; text-align: center;
}
.ica-summary-item-heading { font-size: 0.82rem; color: var(--ink-muted); margin: 0 0 6px; }
.ica-summary-item-label { font-weight: 700; color: var(--ink); margin: 0; }

/* ---- submit + completion ---- */
.ica-submit { max-width: 720px; margin: 0 auto; text-align: center; padding: 8px 0 56px; }
.ica-submit-note { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.6; margin: 0 0 14px; }
.ica-submit-error { color: var(--coral); font-size: 0.92rem; min-height: 1.3em; margin: 0 0 10px; }
.ica-submit .btn-xl { width: 100%; max-width: 380px; min-height: 52px; }
.ica-submit .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.ica-done { max-width: 560px; margin: 56px auto; text-align: center; padding: 0 20px 56px; }
.ica-done-mark { font-size: 2.4rem; color: var(--gold); display: block; margin-bottom: 10px; }
.ica-done-title { font-size: 1.7rem; line-height: 1.3; margin: 0 0 14px; color: var(--ink); }
.ica-done-body { color: var(--ink-soft); line-height: 1.65; margin: 0 0 26px; }
.ica-done-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ica-done-actions .btn { width: 100%; max-width: 320px; min-height: 48px; }

/* ---- identity (The Deeper You name capture) ---- */
.ica-identity { max-width: 480px; margin: 0 auto; padding: 8px 4px 0; }
.ica-identity-title { font-size: 1.5rem; line-height: 1.3; margin: 0 0 10px; color: var(--ink); }
.ica-identity-sub { color: var(--ink-soft); line-height: 1.6; margin: 0 0 24px; }
.ica-identity-form { display: flex; flex-direction: column; gap: 18px; }
.ica-identity-field { display: flex; flex-direction: column; gap: 6px; }
.ica-identity-label { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.ica-identity-field .text-input {
  width: 100%; min-height: 48px; box-sizing: border-box;
  font-size: 1rem; padding: 0 14px;
}
.ica-identity-error {
  color: var(--coral); font-size: 0.88rem; line-height: 1.5;
  margin: 0; min-height: 1.3em;
}
.ica-identity-form .btn-xl { width: 100%; min-height: 52px; margin-top: 4px; }

@media (min-width: 560px) {
  .ica-identity { padding-top: 16px; }
}

/* ---- entrance, restrained ---- */
.ica-enter { animation: ica-in 260ms ease both; }
@keyframes ica-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- mobile ---- */
@media (max-width: 480px) {
  .ica-shell { padding-top: 4px; }
  .ica-card { padding: 20px 16px; border-radius: 14px; }
  .ica-prompt { font-size: 1.16rem; }
  .ica-option { padding: 12px 14px; }
  .ica-option-label { font-size: 0.96rem; }
  .ica-nav { flex-direction: column-reverse; }
  .ica-nav .btn { width: 100%; }
  .ica-review-title { font-size: 1.5rem; }
  .ica-review-item { grid-template-columns: 1fr; }
  .ica-edit { grid-column: 1; grid-row: auto; justify-self: start; padding-left: 0; }
}
@media (max-width: 360px) {
  .ica-prompt { font-size: 1.08rem; }
  .ica-review-n { min-width: 1.9em; }
  .ica-review-a { padding-left: 1.9em; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .ica-enter { animation: none; }
  .ica-bar-fill { transition: none; }
  .ica-spinner { animation-duration: 2s; }
  .ica-option { transition: none; }
}

/* ============ Inner Compass commerce (Phase 2D4) ============
   The paid offer card on the result page, and the payment-success
   confirmation screen. Both inherit the site's existing tokens and
   button classes so they read as part of TypeKingdom, not as a
   bolted-on checkout. */

/* ---- offer card (replaces the waitlist only when sales are enabled) ---- */
.icc-offer { text-align: left; }
.icc-offer-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  margin: 0 0 .5rem;
}
.icc-offer-body { margin: 0 0 .75rem; line-height: 1.6; }
.icc-offer-price { margin: 0 0 .75rem; }
.icc-offer-facts { margin: 0 0 1.15rem; padding-left: 1.15rem; line-height: 1.55; }
.icc-offer-facts li { margin: 0 0 .35rem; }
.icc-cta {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;              /* comfortably above the 44px target */
  font-weight: 600;
  padding: .85rem 1.25rem;
  text-align: center;
  white-space: normal;           /* wrap cleanly rather than force overflow */
}
.icc-offer-support { margin: .75rem 0 0; font-size: .92rem; opacity: .85; }
.icc-offer-terms:empty { display: none; }
.icc-offer-note { margin: .5rem 0 0; min-height: 1.2em; }

@media (min-width: 560px) {
  /* V4P.65: the original free-result teaser panel is wide enough that
     18rem always fit; the V4P.64 marketing surfaces (homepage Flagship
     card, #/deeper-you hero/comparison card) sit inside a much narrower
     grid card at these same widths, where a fixed 18rem floor exceeded
     the card's own padded content width and pushed the button past the
     card's right edge. min() keeps the original wide-panel sizing intent
     wherever there is room for it, and shrinks to the actual available
     width -- never beyond it -- wherever there is not. */
  .icc-cta { width: auto; min-width: min(18rem, 100%); max-width: 100%; }
}

/* ---- shared buyer-identity modal (V4P.67) ----
   Reuses the exact tokens and shape of the site's existing dialog
   (.mr-share-backdrop/.mr-share-panel in css/styles.css) rather than
   inventing a second modal style: same centring, same 20px mobile
   backdrop margin, same surface/radius/shadow. Escape and an explicit
   close control dismiss it, matching that same existing pattern --
   deliberately no backdrop-click dismissal, for the same consistency. */
.icc-modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(30, 27, 46, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.icc-modal-backdrop[hidden] { display: none; }
.icc-modal-panel {
  position: relative;
  background: var(--surface); border-radius: var(--radius); padding: 28px;
  max-width: 460px; width: 100%; box-shadow: var(--shadow);
  max-height: calc(100vh - 40px); overflow-y: auto; box-sizing: border-box;
}
.icc-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; min-height: 0; border-radius: 999px; border: none;
  background: var(--paper); color: var(--ink-soft); font-size: 1.3rem;
  line-height: 1; cursor: pointer;
}
.icc-modal-close:hover { color: var(--ink); }
.icc-modal-close:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* ---- payment-success states ---- */
.icc-state {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) 0;
  text-align: center;
}
.icc-state-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.25;
  margin: 0 0 .75rem;
}
.icc-state-title:focus { outline: none; }
.icc-state-title:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.icc-state-body { line-height: 1.6; margin: 0 0 1.5rem; }

.icc-progress {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  margin: 0 0 1.5rem; font-size: .95rem;
}
.icc-spinner {
  width: 1.05rem; height: 1.05rem; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: icc-spin 900ms linear infinite;
  opacity: .65;
}
/* The state is always ALSO announced in text, so motion is never the only
   way the loading state is conveyed. */
.icc-spinner.is-static { animation: none; border-right-color: currentColor; opacity: .35; }
@keyframes icc-spin { to { transform: rotate(360deg); } }

.icc-actions {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
  margin: 0 0 1.5rem;
}
.icc-actions .btn { min-height: 44px; }

/* ---- recovery form ---- */
.icc-recovery {
  border-top: 1px solid rgba(128, 128, 128, .25);
  padding-top: 1.25rem; margin-top: .5rem; text-align: left;
}
.icc-recovery-label { display: block; font-weight: 600; margin: 0 0 .4rem; font-size: .95rem; }
.icc-recovery-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.icc-recovery-row .text-input { flex: 1 1 14rem; min-width: 0; min-height: 44px; }
.icc-recovery-row .btn { min-height: 44px; flex: 0 0 auto; }
.icc-recovery-note { margin: .5rem 0 0; min-height: 1.2em; }

/* nothing may push the page sideways at any supported width */
#view-inner-compass-payment-success, .icc-offer { overflow-x: hidden; }

@media (prefers-reduced-motion: reduce) {
  .icc-spinner { animation: none; border-right-color: currentColor; opacity: .35; }
}

/* ---------- The Deeper You: web report (Phase B5C.12G) ---------- */
.ica-report { max-width: 720px; margin: 0 auto; padding: 24px 20px 64px; }
.ica-report-toolbar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
  margin: 0 0 28px;
}
.ica-report-toolbar .btn { min-height: 44px; }
.ica-report-header { text-align: center; margin: 0 0 32px; }
.ica-report-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; color: var(--ink-soft); margin: 0 0 6px; }
.ica-report-title { font-size: 1.9rem; line-height: 1.25; margin: 0 0 10px; color: var(--ink); }
.ica-report-identity { color: var(--ink-soft); font-size: 1rem; margin: 0; }
.ica-report-sections { display: flex; flex-direction: column; gap: 30px; }
.ica-report-section { border-top: 1px solid rgba(128, 128, 128, .2); padding-top: 22px; }
.ica-report-section:first-child { border-top: none; padding-top: 0; }
.ica-report-heading { font-size: 1.25rem; line-height: 1.35; margin: 0 0 8px; color: var(--ink); }
.ica-report-lede { color: var(--ink-soft); font-style: italic; margin: 0 0 10px; }
.ica-report-band-label, .ica-report-disc-label, .ica-report-disc-name {
  font-weight: 700; margin: 0 0 8px; color: var(--ink);
}
.ica-report-body-text { line-height: 1.7; margin: 0 0 10px; color: var(--ink); }
.ica-report-callback { line-height: 1.7; margin: 10px 0 0; font-style: italic; color: var(--ink-soft); }
.ica-report-transition { text-align: center; font-style: italic; color: var(--ink-soft); margin: 0; }
.ica-report-print-help { margin-top: 36px; text-align: center; color: var(--ink-soft); font-size: .9rem; }

/* nothing here may push the page sideways at any supported width */
#view-inner-compass-report { overflow-x: hidden; }

/* ---------- print / save as PDF ----------
   A proper printed report, not the website printed badly: site chrome,
   every interactive control and the print-help note itself are hidden.
   The plain-black-on-white text safety net below predates the premium
   V3 report visual system (Phase B5C.12G) and was written for the OLDER,
   plain-HTML report body (reportBodyHtml()'s ica-report-section /
   ica-report-heading fallback, only ever used when the renderer script
   fails to load -- never for a real customer). It is intentionally
   scoped OFF .ica-report-v2 (the premium renderer's own class) so a
   real customer's printed Deeper You report keeps its designed violet/
   gold print palette (css/inner-compass-report.css already sets its own
   safe, print-appropriate background: #fff there) instead of being
   silently flattened by this older !important rule. */
@media print {
  .site-header, .site-footer,
  .ica-report-toolbar, .ica-report-print-help,
  .ica-state-actions {
    display: none !important;
  }
  html, body { background: #fff !important; }
  .ica-report { max-width: none; margin: 0; padding: 0; }
  .ica-report:not(.ica-report-v2), .ica-report:not(.ica-report-v2) * {
    color: #000 !important; background: transparent !important;
  }
  .ica-report-section { break-inside: avoid; page-break-inside: avoid; }
  .ica-report-heading { break-after: avoid; page-break-after: avoid; }
  a[href]::after { content: ""; }  /* never print a URL after a link */
  @page { margin: 18mm 16mm; }
}
