/* Happ setup guide (includes/happ-guide.php) — used by /buy-code and /buy-code/success.
 *
 * Everything is hg-* prefixed: both buy-code pages already define a .bc-step with different meanings,
 * so the guide keeps its own namespace. Tokens come from ds.css, which the page must link first.
 *
 * The inner two-column panel uses auto-fit rather than a media query on purpose — the guide renders in a
 * 1120px container on /buy-code and a 720px one on /buy-code/success, so it has to answer to its
 * container, not the viewport.
 */

.hg {
  font-family: var(--font-sans);
  color: var(--ink-950);
  background: var(--ink-50);
  padding: 8px 0 72px;
}
.hg * { box-sizing: border-box; }

.hg-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- section header ------------------------------------------------------ */
.hg-head { max-width: 640px; margin: 0 auto 28px; text-align: center; }
.hg-eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-600);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--r-pill);
  padding: 5px 14px;
}
.hg-head h2 {
  font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
  color: var(--ink-950);
  margin: 16px 0 0;
}
.hg-head p { font-size: 15.5px; line-height: 1.6; color: var(--ink-500); margin: 12px 0 0; }

/* --- accordion ----------------------------------------------------------- */
.hg-list { display: flex; flex-direction: column; gap: 14px; }

.hg-item {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.hg-item[open] { border-color: var(--brand-300); box-shadow: var(--shadow-md); }

.hg-sum {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px;
  cursor: pointer;
  list-style: none;
}
.hg-sum::-webkit-details-marker { display: none; }
.hg-sum::marker { content: ''; }
.hg-sum:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; border-radius: var(--r-xl); }

.hg-ic {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: var(--r-lg);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
}
.hg-ic svg { width: 21px; height: 21px; }

.hg-sum-txt { flex: 1; min-width: 0; }
.hg-title { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--ink-950); }
.hg-blurb { display: block; font-size: 14px; line-height: 1.55; color: var(--ink-500); margin-top: 5px; }

.hg-plus {
  flex-shrink: 0;
  width: 30px; height: 30px; margin-top: 4px;
  border-radius: 50%;
  border: 1px solid var(--ink-200);
  background: var(--ink-50);
  color: var(--ink-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 400; line-height: 1;
  transition: transform .25s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out);
}
.hg-item[open] .hg-plus {
  transform: rotate(45deg);
  color: var(--brand-600);
  border-color: var(--brand-300);
}

/* A closed <details> hides its panel outright, so height can't be transitioned without JS.
   Fade the opened panel in instead — the toggle still reads as deliberate. */
.hg-panel {
  border-top: 1px solid var(--ink-150);
  padding: 20px;
  animation: hg-in .22s var(--ease-out);
}
@keyframes hg-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hg-panel { animation: none; }
  .hg-plus { transition: none; }
}

/* --- panel columns ------------------------------------------------------- */
.hg-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

.hg-box {
  background: var(--ink-50);
  border: 1px solid var(--ink-150);
  border-radius: var(--r-lg);
  padding: 18px;
}
.hg-box-label {
  font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 14px;
}

/* download cards */
.hg-dls { display: flex; flex-direction: column; gap: 10px; }
.hg-dl {
  display: block;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--ink-200);
  background: #fff;
  text-decoration: none;
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out);
}
.hg-dl:hover { border-color: var(--ink-300); background: #fff; }
.hg-dl.is-primary { border-color: var(--brand-200); background: var(--brand-50); }
.hg-dl.is-primary:hover { border-color: var(--brand-600); }
.hg-dl-kind {
  display: block;
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-400);
}
.hg-dl.is-primary .hg-dl-kind { color: var(--brand-600); }
.hg-dl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; }
.hg-dl-name {
  font-size: 14px; font-weight: 700; color: var(--ink-950);
  overflow-wrap: anywhere;
}
.hg-dl-ext { flex-shrink: 0; color: var(--ink-400); display: flex; }
.hg-dl.is-primary .hg-dl-ext { color: var(--brand-600); }
.hg-dl-ext svg { width: 15px; height: 15px; }

.hg-note { font-size: 13px; line-height: 1.55; color: var(--ink-500); margin: 14px 0 0; }

/* quick-start steps */
.hg-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hg-steps li { display: flex; gap: 11px; }
.hg-n {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800;
}
.hg-s { font-size: 14px; line-height: 1.6; color: var(--ink-700); padding-top: 3px; }

/* good to know */
.hg-tips {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(16, 185, 129, .22);
  background: rgba(16, 185, 129, .06);
}
.hg-tips .hg-box-label { color: var(--success); }
.hg-tips ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.hg-tips li { display: flex; gap: 11px; font-size: 13.5px; line-height: 1.6; color: var(--ink-700); }
.hg-dot {
  flex-shrink: 0;
  width: 6px; height: 6px; margin-top: 8px;
  border-radius: 50%;
  background: var(--success);
}

/* closing call to action — only /how-to-connect passes $opts['cta']; the funnel pages have their
   own checkout right above the guide and pass nothing. */
.hg-cta { margin-top: 28px; text-align: center; }
.hg-cta a {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  background: var(--brand-600);
  color: #fff;
  font-size: 15px; font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-brand);
  transition: background .18s var(--ease-out), transform .18s var(--ease-out);
}
.hg-cta a:hover { background: var(--brand-700); transform: translateY(-1px); }

@media (max-width: 600px) {
  .hg { padding-bottom: 48px; }
  .hg-wrap { padding: 0 16px; }
  .hg-head h2 { font-size: 25px; }
  .hg-sum, .hg-panel { padding: 16px; }
  .hg-blurb { font-size: 13.5px; }
}
