/* =========================================================================
   API 투자전략센터 — 시작하기 (Onboarding) page
   Progress stepper · API-type tabs · env cards · key fields ·
   tutorial mini-steps · run/response · completion CTA
   ========================================================================= */

/* ---------- AI-learning Excel download band ---------- */
.ai-band { border-top: 1px solid var(--border); background: var(--bg-2); padding-block: clamp(48px, 6vw, 80px); }
.ai-band__card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(20px, 4vw, 66px); align-items: center;
  padding: clamp(28px, 4vw, 38px) clamp(20px, 4vw, 50px) clamp(28px, 4vw, 44px);
  border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-card);
}
.ai-band__tx { position: relative; z-index: 1; }
.ai-band__tx .eyebrow { margin-bottom: 0.8rem; }
.ai-band__tx h2 { font-size: clamp(1.5rem, 2.6vw, 1.82rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
.ai-band__tx p { color: var(--text-2); font-size: var(--fs-text-md); line-height: var(--lh-text-md); margin-top: 14px; max-width: 560px; }
.ai-band__how { display: flex; gap: 10px 22px; margin-top: 24px; flex-wrap: wrap; }
.ai-band__how-item { display: flex; align-items: center; gap: 10px; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-2); font-weight: 500; }
.ai-band__how-item .n { width: 24px; height: 24px; border-radius: var(--r-pill); display: grid; place-items: center; flex-shrink: 0; font-family: var(--font-sans); font-size: var(--fs-no); line-height: var(--lh-no); font-weight: 700; background: var(--surface-blue); border: 1px solid var(--chip-border); color: var(--accent-cyan); }

/* right: compact file-download widget */
.ai-band__file-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; }
.ai-band__file { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-float); transition: transform 0.2s var(--ease), border-color 0.2s; }
.ai-band__file:hover { transform: translateY(-2px); border-color: var(--border-glow); background: var(--surface-solid); }
.ai-band__file-ic { width: 62px; height: 63px; flex-shrink: 0; display: block; }
.ai-band__file-ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ai-band__file-meta b { display: block; font-size: var(--fs-text-md); line-height: var(--lh-text-md); white-space: nowrap; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.ai-band__file-meta span { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--text-inactive); }
.ai-band__file-note { display: flex; gap: 9px; font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--text-dim); }
.ai-band__file-note svg { width: 15px; height: 15px; color: var(--text-dim); flex-shrink: 0; margin-top: 2px; }

@media (max-width: 860px) {
  .ai-band__card { grid-template-columns: 1fr; }
  .ai-band__file-wrap { width: 100%; }
  .ai-band__file { width: 100%; }
}

/* ---------- start.html sticky step tabs: uses shared .gstep-tabs (chrome.css) ---------- */
.start-doc { padding-top: clamp(32px, 4vw, 52px); }
@media (max-width: 560px) {
  .start-doc { padding-top: 0; }
}


/* tab panes */
.tab-pane { display: none; }
.tab-pane.active { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .tab-pane.active { animation: fadeUp 0.4s var(--ease-out); }
}
@keyframes fadeUp { from { transform: translateY(10px); } to { transform: none; } }

/* ---------- step panel ---------- */
.start-step { position: relative; scroll-margin-top: 160px; }
.start-step__head { display: flex; align-items: center; gap: 16px; padding: 24px 28px; border-bottom: 1px solid var(--border); }
.start-step__titles { flex: 1; min-width: 0; }
.start-step__titles .k { display: block; font-family: var(--font-sans); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-accent); letter-spacing: 0.04em; font-weight: 600; }
.start-step__titles h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 800; letter-spacing: -0.02em; margin-top: 3px; }
.start-step__state { font-size: 0.8rem; font-family: var(--font-sans); padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--text-dim); white-space: nowrap; }

/* each numbered item (head+intro, 1-1, 1-2, …) gets its own box */
.step-card { position: relative; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); margin-bottom: 22px; overflow: hidden; transition: border-color 0.3s, box-shadow 0.3s; }
.step-card__body { padding: 24px 26px 28px; color: var(--text-2); }
@media (max-width: 560px) {
  .step-card { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; border-left: none; border-right: none; margin-bottom: 10px; }
  .start-step__head { padding: 20px; gap: 12px; }
  .start-step__state { display: none; }
}
.step-card__body p.intro { line-height: 1.7; margin-bottom: 0; }
.step-card__body p code, .step-card__body li code { font-family: var(--font-mono); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--chip-text); background: var(--chip-bg); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--chip-border); }
.step-card__body h3 { color: var(--text); font-size: var(--fs-title-sub); line-height: var(--lh-title-sub); font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 9px; }
.step-card__body h3 .n { height: 24px; min-width: 30px; padding: 0 7px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-sans); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); background: var(--accent-prime); color: var(--text-wh); border: 1px solid var(--chip-border); white-space: nowrap; flex-shrink: 0; }

/* step footer action */
.start-step__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.start-step__foot .hint { font-size: var(--fs-text-md); line-height: var(--lh-text-md); color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.start-step__foot .hint svg { width: 16px; height: 16px; color: var(--text-2); }

/* ---------- env install cards ---------- */
.env-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.env-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); }
.env-card__logo { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-solid); border: 1px solid var(--border); flex-shrink: 0; }
.env-card__logo svg { width: 26px; height: 26px; }
.env-card__tx b { display: block; font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 700; }
.env-card__tx span { font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--text-dim); }
.env-card__tx a { color: var(--chip-text); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); font-weight: 600; }
@media (max-width: 560px) { .env-cards { grid-template-columns: 1fr; } }

/* ---------- key fields ---------- */
.key-field { margin-bottom: 12px; }
.key-field label { display: block; font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); font-weight: 600; color: var(--text-2); margin-bottom: 16px; }
.key-field__input { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 16px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--code-bg); transition: border-color 0.2s; }
.key-field__input:focus-within { border-color: var(--border-glow); }
.key-field__input input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--code-text); font-family: var(--font-mono); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); letter-spacing: 0.02em; padding: 9px 0; }
.key-field__input input::placeholder { color: #4b5675; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--code-file); transition: color 0.18s, background-color 0.18s; flex-shrink: 0; }
.icon-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.copied { color: var(--color-success); }
.icon-btn .eye-off { display: none; }
.icon-btn.show .eye-on { display: none; } .icon-btn.show .eye-off { display: block; }

/* ---------- tutorial mini-steps ---------- */
.mini-steps { display: flex; flex-direction: column; gap: 14px; }
.mini { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.mini__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.mini__ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(91,168,255,0.12); border: 1px solid rgba(91,168,255,0.3); color: var(--accent-prime); flex-shrink: 0; }
.mini__ic svg { width: 19px; height: 19px; }
.mini__ic.done { background: rgba(43,214,110,0.16); border-color: rgba(43,214,110,0.45); color: var(--color-success); }
.mini__titles { flex: 1; min-width: 0; }
.mini__titles b { display: block; font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 700; }
.mini__titles span { font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--text-dim); }
.mini__endpoint { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--chip-text); padding: 4px 10px; border-radius: var(--r-pill); background: var(--chip-bg); border: 1px solid var(--chip-border); white-space: nowrap; }
.mini__body { padding: 0 18px 18px; }
.mini__body .codeblock { margin-top: 4px; }

/* run row */
.run-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.run-btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: var(--r-pill);
  font-weight: 600; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--on-accent); background: var(--accent-prime);
  box-shadow: 0 8px 22px -10px var(--glow-cyan); transition: transform 0.2s var(--ease), box-shadow 0.2s, opacity 0.2s;
}
.run-btn svg { width: 16px; height: 16px; }
.run-btn:hover { transform: translateY(-2px); }
.run-btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.run-status { font-family: var(--font-sans); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--text-dim); display: inline-flex; align-items: center; gap: 7px; }
.run-status .spin { width: 13px; height: 13px; border: 2px solid var(--border-strong); border-top-color: var(--accent-cyan); border-radius: 50%; animation: spin 0.7s linear infinite; }
.run-status.ok { color: var(--color-success); }
@keyframes spin { to { transform: rotate(360deg); } }

/* response preview */
.response { margin-top: 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--code-bg); overflow: hidden; max-height: 0; opacity: 0; transition: max-height 0.4s var(--ease), opacity 0.3s; }
.response.show { max-height: 340px; opacity: 1; }
.response__bar { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.07); font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); }
.response__bar .ok { width: 8px; height: 8px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 8px rgba(43,214,110,0.7); }
.response__bar .status { color: var(--color-success); } .response__bar .ms { margin-left: auto; color: var(--accent-cyan); }
.response__body { padding: 14px 16px; font-family: var(--font-mono); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--code-text); white-space: pre-wrap; overflow-x: auto; }

/* ---------- completion CTA (Figma node 793-3151) ---------- */
.complete-cta {
  margin: 30px 0;
  flex-direction: column; align-items: center; text-align: center;
  display: none;
}
.complete-cta.show { display: flex; animation: fadeUp 0.6s var(--ease-out); }
.complete-cta__row { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.complete-cta__check { position: relative; z-index: 1; display: inline-flex; color: #5bf09a; flex-shrink: 0; }
.complete-cta__check svg { width: 46px; height: 46px; }
.complete-cta__check svg path { stroke-dasharray: 24; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .complete-cta__check svg path { stroke-dashoffset: 24; }
  .complete-cta.burst .complete-cta__check svg path { animation: check-draw 0.7s var(--ease-out) forwards; }
}
@keyframes check-draw { to { stroke-dashoffset: 0; } }
.complete-cta__row h3 { position: relative; z-index: 1; margin: 0; color: var(--text); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 800; letter-spacing: -0.02em; }
.complete-cta p { color: var(--text-2); font-size: var(--fs-text-md); line-height: var(--lh-text-md); margin: 0; }
.complete-cta__btn { margin-top: 20px; display: inline-flex; align-items: center; gap: 6px; padding: 10px 26px; border-radius: var(--r-pill); background: var(--accent-prime); color: var(--text-wh); font-weight: 600; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.complete-cta__btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px var(--glow-cyan); }
@media (max-width: 640px) {
  .run-btn, .run-btn:hover, .complete-cta__btn, .complete-cta__btn:hover { box-shadow: none; }
}

/* confetti burst — fires once around the check + heading when the step completes */
.confetti { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 0; }
.confetti i { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 2px; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  /* starts after the check finishes drawing (0.7s), plus each particle's own stagger */
  .complete-cta.burst .confetti i { animation: confetti-burst 0.9s var(--ease-out) forwards; animation-delay: calc(0.7s + var(--pd, 0s)); }
}
@keyframes confetti-burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5) rotate(0); }
  65% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(var(--r)); }
}
.complete-cta__btn svg { width: 18px; height: 18px; }

/* ---------- TAB layout: only the selected step is shown ---------- */
.start-step { display: none; }
.start-step.shown { display: block; }
.gstep-tab { cursor: pointer; }

/* code language tabs (Python / cURL / JavaScript) */
.code-langset { margin-top: 4px; }
.code-langs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.code-lang { position: relative; padding: 10px 16px; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 600; color: var(--text-dim); transition: color 0.18s; }
.code-lang::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-prime); transform: scaleX(0); transition: transform 0.24s var(--ease); }
.code-lang:hover { color: var(--text-2); }
.code-lang.active { color: var(--text); }
.code-lang.active::after { transform: scaleX(1); }
.code-langpane { display: none; }
.code-langpane.active { display: block; }

/* ---------- download link button ---------- */
.dl-link { display: inline-flex; align-items: center; gap: 9px; margin: 4px 0 4px; }

/* ---------- screenshot placeholders ---------- */
.shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 16px; }
.shot-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 34px 18px; border-radius: var(--r-md); border: 1px dashed var(--border-strong); background: repeating-linear-gradient(135deg, rgba(255,255,255,0.015) 0 14px, transparent 14px 28px), var(--surface-2); min-height: 132px; }
.shot-ph__ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--text-inactive); background: var(--surface); border: 1px solid var(--border); margin-bottom: 16px; }
.shot-ph__ic svg { width: 22px; height: 22px; }
.shot-ph b { font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 600; color: var(--text-2); }
.shot-ph span { font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--text-inactive); }
.shot-ph--wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .shot-grid { grid-template-columns: 1fr; } }

/* real screenshot figure */
.shot-img { margin: 0; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface-2); overflow: hidden; }
.shot-img img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--border); }
.shot-img figcaption { padding: 10px 14px; font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--text-dim); }
.shot-img figcaption b { color: var(--text-2); font-weight: 600; }

/* ---------- editor / tool download card ---------- */
.tool-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); margin: 8px 0 16px; max-width: 420px; }
.tool-card__logo { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-solid); border: 1px solid var(--border); flex-shrink: 0; }
.tool-card__logo svg { width: 26px; height: 26px; }
.tool-card__tx { flex: 1; min-width: 0; }
.tool-card__tx b { display: block; font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 700; }
.tool-card__tx span { font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--text-dim); }
.tool-card__badge { font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 700; color: #fff; background: var(--accent-prime); padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; }

/* ---------- success callout (green) ---------- */
.callout--ok { border-color: rgba(43,214,110,0.32); background: rgba(43,214,110,0.1); }
.callout--ok .callout__icon { background: rgba(43,214,110,0.16); color: var(--color-success); }
.callout--ok .callout__icon svg { width: 18px; height: 18px; }

/* response-ok pill (200 OK) */
.resp-ok { font-family: var(--font-sans); font-size: 0.7rem; font-weight: 700; color: var(--color-success); background: rgba(43,214,110,0.16); border: 1px solid rgba(43,214,110,0.4); padding: 2px 8px; border-radius: var(--r-pill); margin-right: 6px; }

/* ---------- mini flow row (token → header → call → response) ---------- */
.flow-row { display: flex; align-items: flex-start; gap: 0; margin: 6px 0 16px; flex-wrap: wrap; }
.flow-node { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; flex: 1; min-width: 92px; }
.flow-node__chip { font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 600; color: var(--text-2); padding: 9px 14px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); white-space: nowrap; }
.flow-node.on .flow-node__chip { color: var(--on-accent); background: var(--accent-prime); border-color: transparent; }
:root[data-theme="light"] .flow-node.on .flow-node__chip { color: #fff; }
.flow-node__cap { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--text-inactive); }
.flow-arrow { display: flex; align-items: center; height: 38px; color: var(--text-inactive); flex-shrink: 0; padding: 0 2px; }
.flow-arrow svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .step-card__body { padding: 16px 16px 24px;}
  .flow-row { flex-direction: column; align-items: stretch; }
  .flow-node { flex-direction: row; justify-content: space-between; }
  .flow-arrow { transform: rotate(90deg); height: 22px; align-self: center; }
}

/* ---------- green check list ---------- */
.chk-list { display: flex; flex-direction: column; gap: 11px; margin: 6px 0 8px; }
.chk-list li { display: flex; align-items: center; gap: 11px; font-size: var(--fs-text-md); line-height: var(--lh-text-md); color: var(--text-2); }
.chk-list li svg { width: 19px; height: 19px; color: var(--color-success); flex-shrink: 0; }
.chk-list li b { color: var(--text); font-weight: 600; }
.chk-list li code { font-family: var(--font-mono); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--chip-text); background: var(--chip-bg); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--chip-border); }
