/**
 * pack.css
 *
 * Shared styles for all scenario pack pages.
 * Scoped under body.pack-page so tokens never bleed into other pages.
 * Load order: style.css first, then this file.
 *
 * Used by:
 *   agency-comparison.html
 *   rematch-decision.html
 *   ceaf-escrow-review.html
 *   pause-exit-decision.html
 *   lawyer-prep.html
 *   resolution-mediation.html
 */

/* ── Design tokens ─────────────────────────────────────────────────────── */
body.pack-page {
  --warm:       #C8882A;
  --warm-light: #f5ede0;
  --warm-muted: #e8d5b8;
  --ink:        #1a1714;
  --ink-muted:  #6b6459;
  --ink-faint:  #9e958a;
  --surface:    #faf8f5;
  --white:      #ffffff;
  --border:     #e4ddd4;
  --red:        #c0392b;
  --green:      #27735e;
  --sidebar-w:  280px;
  --radius:     8px;

  background: var(--surface);
}

/* ── Loading screen ────────────────────────────────────────────────────── */
body.pack-page #loading-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--surface); z-index: 100; gap: 16px;
}

body.pack-page .loading-dots { display: flex; gap: 8px; }

body.pack-page .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warm); animation: packPulse 1.2s ease-in-out infinite;
}
body.pack-page .dot:nth-child(2) { animation-delay: .2s; }
body.pack-page .dot:nth-child(3) { animation-delay: .4s; }

@keyframes packPulse {
  0%, 80%, 100% { opacity: .3; transform: scale(.8); }
  40%           { opacity: 1;  transform: scale(1); }
}

body.pack-page .loading-text { font-size: .85rem; color: var(--ink-muted); }

/* ── Gate screen ───────────────────────────────────────────────────────── */
body.pack-page #gate-screen {
  display: none;
  min-height: 100vh;
  align-items: center; justify-content: center;
  padding: 24px;
}

body.pack-page .gate-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

body.pack-page .gate-eyebrow {
  font-size: .7rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--warm); margin-bottom: 12px;
}
body.pack-page .gate-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem; font-weight: 600;
  color: var(--ink); margin-bottom: 12px; line-height: 1.2;
}
body.pack-page .gate-sub {
  font-size: .9rem; color: var(--ink-muted);
  line-height: 1.6; margin-bottom: 20px;
}
body.pack-page .gate-modules {
  background: var(--warm-light);
  border-radius: var(--radius);
  padding: 16px 20px; margin: 0 0 24px; text-align: left;
}
body.pack-page .gate-modules p {
  font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--warm); margin-bottom: 10px;
}
body.pack-page .gate-modules ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
body.pack-page .gate-modules li {
  font-size: .83rem; color: var(--ink-muted);
  padding-left: 14px; position: relative;
}
body.pack-page .gate-modules li::before { content: "—"; position: absolute; left: 0; color: var(--warm); }
body.pack-page .gate-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem; font-weight: 600; color: var(--ink);
}
body.pack-page .gate-price-note { font-size: .8rem; color: var(--ink-faint); margin: 4px 0 24px; }

body.pack-page .btn-buy {
  display: block; width: 100%;
  background: var(--warm); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 14px 24px; font-size: .95rem;
  font-family: 'Figtree', sans-serif; font-weight: 500;
  cursor: pointer; transition: opacity .2s; margin-bottom: 12px;
}
body.pack-page .btn-buy:hover    { opacity: .88; }
body.pack-page .btn-buy:disabled { opacity: .5; cursor: not-allowed; }
body.pack-page .btn-signin {
  display: block; font-size: .82rem; color: var(--ink-muted);
  text-decoration: none; padding: 8px;
}
body.pack-page .btn-signin:hover { color: var(--warm); }
body.pack-page #gate-error { margin-top: 16px; font-size: .85rem; color: var(--red); display: none; }

/* ── App shell ─────────────────────────────────────────────────────────── */
body.pack-page #app { display: none; min-height: 100vh; }
body.pack-page main { display: block !important; }

/* Top nav */
body.pack-page .top-nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
body.pack-page .nav-left  { display: flex; align-items: center; gap: 12px; }
body.pack-page .nav-right { display: flex; align-items: center; gap: 16px; }
body.pack-page .nav-email { font-size: .8rem; color: var(--ink-faint); }
body.pack-page .nav-logo img { height: 28px; display: block; }
body.pack-page .nav-back {
  font-size: .82rem; color: var(--ink-muted);
  text-decoration: none; transition: color .15s;
}
body.pack-page .nav-back:hover { color: var(--warm); }
body.pack-page .btn-signout {
  font-size: .8rem; color: var(--ink-muted);
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 12px; cursor: pointer;
  font-family: 'Figtree', sans-serif; transition: border-color .2s;
}
body.pack-page .btn-signout:hover { border-color: var(--warm); color: var(--warm); }
body.pack-page .menu-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 4px; color: var(--ink);
}

/* App body layout */
body.pack-page .app-body { display: flex; min-height: calc(100vh - 56px); }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
body.pack-page .sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--white); border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky; top: 56px;
  height: calc(100vh - 56px); overflow-y: auto;
}
body.pack-page .sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(26,23,20,.4); z-index: 30;
}
body.pack-page .sidebar-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint); padding: 0 20px; margin-bottom: 12px;
}
body.pack-page .sidebar-progress { padding: 0 20px; margin-bottom: 20px; }
body.pack-page .progress-bar     { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
body.pack-page .progress-fill    { height: 100%; background: var(--warm); border-radius: 2px; transition: width .4s ease; width: 0%; }
body.pack-page .progress-text    { font-size: .72rem; color: var(--ink-faint); margin-top: 6px; }

body.pack-page .module-nav { list-style: none; }
body.pack-page .module-nav-item button {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 10px 20px; display: flex; align-items: center; gap: 10px;
  font-family: 'Figtree', sans-serif; font-size: .83rem; color: var(--ink-muted);
  transition: background .15s, color .15s; border-left: 3px solid transparent;
}
body.pack-page .module-nav-item button:hover { background: var(--warm-light); color: var(--ink); }
body.pack-page .module-nav-item.active button {
  background: var(--warm-light); color: var(--warm);
  border-left-color: var(--warm); font-weight: 600;
}
body.pack-page .module-nav-item.started button::after {
  content: "•"; color: var(--warm); margin-left: auto; font-size: 1.1rem;
}
body.pack-page .module-num  { font-size: .68rem; font-weight: 700; color: var(--ink-faint); min-width: 18px; }
body.pack-page .module-nav-item.active .module-num { color: var(--warm); }
body.pack-page .module-icon { font-size: .9rem; opacity: .6; }

/* ── Content area ──────────────────────────────────────────────────────── */
body.pack-page .content-area { flex: 1; padding: 36px 48px; max-width: 1100px; min-width: 0; }

body.pack-page .module-header  { margin-bottom: 28px; }
body.pack-page .module-eyebrow {
  font-size: .68rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--warm); margin-bottom: 8px;
}
body.pack-page .module-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem; font-weight: 600; color: var(--ink); line-height: 1.2; margin-bottom: 10px;
}
body.pack-page .module-desc { font-size: .9rem; color: var(--ink-muted); line-height: 1.65; max-width: 640px; }

/* ── Section headings ──────────────────────────────────────────────────── */
body.pack-page .section-head {
  font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; font-weight: 600;
  color: var(--ink); margin: 28px 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Form fields ────────────────────────────────────────────────────────── */
body.pack-page .field-group  { margin-bottom: 20px; }
body.pack-page .field-label  { display: block; font-size: .8rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }

body.pack-page input[type="text"],
body.pack-page textarea,
body.pack-page select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'Figtree', sans-serif; font-size: .88rem; color: var(--ink);
  background: var(--white); resize: vertical; transition: border-color .2s; line-height: 1.5;
}
body.pack-page input[type="text"]:focus,
body.pack-page textarea:focus  { outline: none; border-color: var(--warm); }
body.pack-page textarea        { min-height: 80px; }
body.pack-page textarea.tall   { min-height: 120px; }

body.pack-page .autosave-tag {
  display: inline-block; font-size: .7rem; color: var(--green);
  margin-top: 4px; opacity: 0; transition: opacity .3s;
}
body.pack-page .autosave-tag.visible { opacity: 1; }

/* ── Note / info boxes ─────────────────────────────────────────────────── */
body.pack-page .note-box {
  background: var(--warm-light); border: 1px solid var(--warm-muted);
  border-radius: var(--radius); padding: 14px 18px;
  font-size: .85rem; color: var(--ink-muted); line-height: 1.65; margin-bottom: 24px;
}

/* ── Info cards (M1 intro type) ────────────────────────────────────────── */
body.pack-page .info-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px;
}
body.pack-page .info-card-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem; font-weight: 600; color: var(--ink); margin-bottom: 8px;
}
body.pack-page .info-card-body {
  font-size: .88rem; color: var(--ink-muted); line-height: 1.7; margin: 0;
}

/* ── Comparison table ──────────────────────────────────────────────────── */
body.pack-page .comparison-section { margin-bottom: 40px; }
body.pack-page .comparison-prompt  {
  font-size: .84rem; color: var(--ink-muted); line-height: 1.6; margin-bottom: 14px;
}
body.pack-page .table-wrap { overflow-x: auto; }
body.pack-page .comparison-table {
  width: 100%; border-collapse: collapse; font-size: .85rem;
  min-width: 600px;
}
body.pack-page .comparison-table thead th {
  background: var(--warm-light);
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink);
  padding: 10px 12px; text-align: left;
  border-bottom: 2px solid var(--warm-muted);
}
body.pack-page .comparison-table .th-label { width: 220px; }
body.pack-page .comparison-table tbody tr { border-bottom: 1px solid var(--border); }
body.pack-page .comparison-table tbody tr:nth-child(even) { background: #faf7f2; }
body.pack-page .comparison-table tbody tr:hover { background: var(--warm-light); }
body.pack-page .comparison-table td { padding: 4px 6px; vertical-align: top; }
body.pack-page .row-label {
  font-size: .8rem; font-weight: 500; color: var(--ink);
  padding: 10px 12px; width: 220px; vertical-align: middle;
}
body.pack-page .cell-textarea {
  width: 100%; min-width: 140px; min-height: 60px; border: none;
  background: transparent; padding: 8px;
  font-family: 'Figtree', sans-serif; font-size: .82rem; color: var(--ink);
  outline: none; resize: vertical; line-height: 1.5;
}
body.pack-page .cell-textarea:focus { background: #fff8f0; border-radius: 4px; }
body.pack-page .cell-input {
  width: 100%; border: none; background: transparent; padding: 8px;
  font-family: 'Figtree', sans-serif; font-size: .82rem; color: var(--ink); outline: none;
}
body.pack-page .cell-input:focus { background: #fff8f0; border-radius: 4px; }
body.pack-page .cell-select {
  width: 100%; border: none; background: transparent; padding: 6px;
  font-family: 'Figtree', sans-serif; font-size: .82rem; color: var(--ink);
  outline: none; cursor: pointer; appearance: auto;
}

/* ── Promise tracker ───────────────────────────────────────────────────── */
body.pack-page .promise-table .th-label { width: 180px; }

/* ── Playbook cards ────────────────────────────────────────────────────── */
body.pack-page .playbook-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
body.pack-page .playbook-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--white); transition: border-color .2s;
}
body.pack-page .playbook-card.open { border-color: var(--warm); }
body.pack-page .playbook-header {
  width: 100%; background: none; border: none; cursor: pointer;
  padding: 14px 18px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  font-family: 'Figtree', sans-serif;
}
body.pack-page .playbook-title { font-weight: 600; font-size: .9rem; color: var(--ink); text-align: left; }
body.pack-page .playbook-chevron {
  color: var(--warm); font-size: 1rem; transition: transform .2s; flex-shrink: 0;
}
body.pack-page .playbook-card.open .playbook-chevron { transform: rotate(90deg); }
body.pack-page .playbook-body {
  display: none; padding: 4px 18px 20px;
  border-top: 1px solid var(--border);
}
body.pack-page .playbook-card.open .playbook-body { display: block; }
body.pack-page .pb-section      { margin-top: 14px; }
body.pack-page .pb-section-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--warm); margin-bottom: 6px;
}
body.pack-page .pb-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
body.pack-page .pb-list li {
  font-size: .84rem; color: var(--ink-muted); padding-left: 14px; position: relative; line-height: 1.55;
}
body.pack-page .pb-list li::before { content: "—"; position: absolute; left: 0; color: var(--warm); }

/* ── Decision guide ────────────────────────────────────────────────────── */
body.pack-page .decision-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--white); margin-bottom: 12px; overflow: hidden;
}
body.pack-page .decision-card.recommend-yes  { border-color: var(--green); }
body.pack-page .decision-card.recommend-no   { border-color: var(--red); }
body.pack-page .decision-card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
body.pack-page .decision-badge {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 4px;
  flex-shrink: 0;
}
body.pack-page .decision-badge-yes  { background: rgba(39,115,94,.12); color: var(--green); }
body.pack-page .decision-badge-no   { background: rgba(192,57,43,.1);  color: var(--red); }
body.pack-page .decision-badge-wait { background: var(--warm-light);   color: var(--warm); }
body.pack-page .decision-condition  { font-size: .88rem; color: var(--ink); font-weight: 500; }
body.pack-page .decision-card-body  { padding: 14px 18px; font-size: .84rem; color: var(--ink-muted); line-height: 1.65; }

/* ── Tracker table (shared with negotiation) ───────────────────────────── */
body.pack-page .tracker-table-wrap { overflow-x: auto; margin-bottom: 16px; }
body.pack-page .tracker-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
  min-width: 700px; background: var(--white);
}
body.pack-page .tracker-table thead th {
  background: var(--warm-light); font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; padding: 10px;
  text-align: left; border-bottom: 2px solid var(--warm-muted);
}
body.pack-page .tracker-table tbody tr { border-bottom: 1px solid var(--border); }
body.pack-page .tracker-table tbody tr:nth-child(even) { background: #faf7f2; }
body.pack-page .tracker-table tbody tr:hover { background: var(--warm-light); }
body.pack-page .tracker-table td { padding: 4px 6px; vertical-align: top; border-right: 1px solid var(--border); }
body.pack-page .tracker-table td:last-child { border-right: none; }
body.pack-page .tracker-tip {
  margin-top: 16px; font-size: .8rem; color: var(--ink-muted);
  font-style: italic; border-left: 3px solid var(--warm); padding-left: 12px;
}

/* ── Shared action buttons ─────────────────────────────────────────────── */
body.pack-page .btn-add-row {
  background: none; border: 1px dashed var(--warm-muted);
  border-radius: var(--radius); padding: 8px 16px;
  font-size: .82rem; color: var(--warm); cursor: pointer;
  font-family: 'Figtree', sans-serif; transition: background .15s;
  margin-top: 8px;
}
body.pack-page .btn-add-row:hover { background: var(--warm-light); }
body.pack-page .btn-copy {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 16px;
  font-size: .82rem; color: var(--ink-muted); cursor: pointer;
  font-family: 'Figtree', sans-serif; transition: border-color .15s, color .15s;
}
body.pack-page .btn-copy:hover { border-color: var(--warm); color: var(--warm); }
body.pack-page .btn-copy.copied { border-color: var(--green); color: var(--green); }
body.pack-page .print-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 16px;
  font-size: .82rem; color: var(--ink-muted); cursor: pointer;
  font-family: 'Figtree', sans-serif; transition: border-color .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
body.pack-page .print-btn:hover { border-color: var(--warm); color: var(--warm); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body.pack-page .menu-toggle  { display: block; }
  body.pack-page .sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .25s ease;
    z-index: 35;
  }
  body.pack-page .sidebar.open { transform: translateX(0); }
  body.pack-page .sidebar-overlay.active { display: block; }
  body.pack-page .content-area { padding: 24px 20px; }
}

@media (max-width: 480px) {
  body.pack-page .gate-card { padding: 32px 24px; }
  body.pack-page .module-title { font-size: 1.55rem; }
}
