/* 구매 페이지 — 홈페이지(style.css) 색·모양을 그대로 이어 쓴다 */
.buy { background: var(--soft); }
.buy [hidden] { display: none !important; }
.buy .top { background: rgba(255, 255, 255, .86); }
.top-right { display: flex; align-items: center; gap: 14px; }
.secure { margin: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.secure svg { width: 17px; height: 17px; color: var(--ok); }

.co { position: relative; overflow: hidden; padding: 28px 0 96px; }
.co .glow { inset: -30% -10% auto; height: 620px; opacity: .8; }
.co-in { position: relative; max-width: 1040px; }
.back { display: inline-block; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 0; }
.back:hover { color: var(--ink); }

.co-steps { list-style: none; padding: 0; margin: 18px 0 26px; display: flex; gap: 8px; flex-wrap: wrap; }
.co-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); font-size: 14px; font-weight: 600; }
.co-steps li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--soft); font-size: 12px; }
.co-steps li.on { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-sm); }
.co-steps li.on span { background: var(--blue); color: #fff; }
.co-steps li.ok span { background: var(--ok-soft); color: var(--ok); }
.co-steps li.ok { color: var(--ink-2); }

.co-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.co-grid > * { min-width: 0; }

/* 주문 요약 */
.sum { position: sticky; top: 84px; background: var(--card); border-radius: 24px; padding: 26px; box-shadow: 0 0 0 1px var(--line), var(--shadow); display: grid; gap: 20px; }
.prod { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; }
.prod img { border-radius: 14px; box-shadow: 0 2px 4px rgba(91, 61, 240, .18), 0 10px 22px -10px rgba(91, 61, 240, .45); }
.prod-name { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.prod-name b { color: var(--blue); font-weight: 700; }
.prod-meta { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.prod-price { font-size: 17px; letter-spacing: -0.02em; }
.incl { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.incl li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: 14.5px; }
.incl li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.5' stroke='%232563EB' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }

/* 프로모션 코드 — 접힌 글자 링크 → 한 줄 입력칸(버튼이 칸 안에) → 적용된 칩 */
.lines > .promo { display: grid; gap: 8px; justify-content: stretch; }
.promo-open { justify-self: start; padding: 0; border: 0; background: none; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--blue); cursor: pointer; }
.promo-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.promo-field { display: flex; align-items: center; height: 44px; padding: 4px 4px 4px 14px; border-radius: 11px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .15s; }
.promo-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px rgba(91, 61, 240, .12); }
.promo-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: 500 15px var(--font); letter-spacing: .01em; color: var(--ink); outline: none; }
.promo-field input::placeholder { color: var(--muted); font-weight: 400; }
#code { text-transform: uppercase; }
#code::placeholder { text-transform: none; }
.promo-field button { flex: none; height: 100%; padding: 0 14px; border: 0; border-radius: 8px; background: var(--soft); color: var(--ink); font: 600 14px var(--font); cursor: pointer; transition: background .15s; }
.promo-field button:hover { background: var(--line); }
.promo-field button[disabled] { color: var(--muted); cursor: default; }
.promo.is-bad .promo-field { box-shadow: inset 0 0 0 1.5px #EF4444; }
.promo-chip { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border-radius: 8px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--ink-2); }
.chip svg { width: 14px; height: 14px; color: var(--muted); }
.chip b { font-weight: 600; letter-spacing: .02em; color: var(--ink); }
.chip button { width: 20px; height: 20px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.chip button:hover { background: var(--line); color: var(--ink); }
.promo-chip dd { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.promo-msg { margin: 0; font-size: 13px; color: #DC2626; }
.promo-msg:empty { display: none; }

.lines { margin: 0; display: grid; gap: 10px; font-size: 15px; }
.lines > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.lines > div[hidden] { display: none; }
.lines dt { color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lines dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.lines .total { padding-top: 14px; border-top: 1px solid var(--line); align-items: flex-start; }
.lines .total dt { color: var(--ink); font-weight: 700; font-size: 16px; }
.lines .total dd span { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.lines .total dd small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 4px; max-width: 200px; }
.sum.is-free .total dd span { color: var(--ok); }
.sum-fine { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.sum-fine b { color: var(--ink-2); font-weight: 600; }
.sum-fine a { color: var(--ink-2); }

/* 결제 */
.pay { background: var(--card); border-radius: 24px; padding: 30px 30px 26px; box-shadow: 0 0 0 1px var(--line), var(--shadow); min-height: 520px; }
.pay-head h2 { font-size: 24px; letter-spacing: -0.035em; }
.pay-head p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.checkout-container { margin-top: 18px; }
.checkout-container:empty { display: none; }
.pay-err { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14.5px; }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(91, 61, 240, .25), 0 8px 20px -8px rgba(91, 61, 240, .6); border-radius: 14px; height: 52px; font-size: 16px; }
.btn-blue:hover { background: #4527D6; }

/* 결제 연결 전 미리보기 */
.preview { margin-top: 22px; display: grid; gap: 14px; }
.preview-tag { margin: 0; justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; }
.sk { display: grid; gap: 6px; }
.sk span { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.sk i { display: block; height: 46px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-2); background: #fff; }
.sk-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sk-pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-pay i { height: 44px; border-radius: 12px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.sk-pay i:first-child { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.preview-note { margin: 0; color: var(--muted); font-size: 13px; }

/* 완료 */
.done { margin-top: 8px; display: grid; gap: 12px; justify-items: center; text-align: center; padding: 26px 8px 8px; outline: none; }
.done-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.done-ic svg { width: 32px; height: 32px; }
.done.is-wait .done-ic { background: var(--blue-soft); color: var(--blue); animation: none; }
.done.is-wait .done-ic svg { display: none; }
.done.is-wait .done-ic::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(91, 61, 240, .2); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.done.is-bad .done-ic { background: var(--warn-soft); color: var(--warn); }
.done h2 { font-size: 26px; letter-spacing: -0.035em; }
.done > p { margin: 0; color: var(--ink-2); max-width: 440px; }
.done code { font: 13px var(--mono); background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.done-box { width: 100%; max-width: 440px; margin-top: 10px; display: grid; gap: 18px; text-align: left; }
.done-box[hidden] { display: none; }
.dl { justify-content: flex-start; border-radius: 14px; padding: 15px 18px; }
.dl span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; }
.dl small { font-weight: 500; font-size: 12.5px; opacity: .7; margin-top: 2px; }
.again { display: grid; gap: 8px; }
.again input { font: 13px var(--mono); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .co-grid { grid-template-columns: 1fr; }
  .sum { position: static; }
}
@media (max-width: 560px) {
  .co { padding-top: 16px; }
  .co-steps li { padding-right: 11px; font-size: 13px; }
  .sum, .pay { padding: 20px; border-radius: 20px; }
  .secure { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .done-ic { animation: none; } }
/* 라이선스 번호 (2026-11-28) */
.lic-box { margin-top: 4px; }
.lic-box input { font: 600 15px var(--mono); letter-spacing: .04em; }
.lic-box .btn { margin-top: 2px; }
