/* ── 쎄롬케어 견적 결제 ─────────────────────────────────────────────
   현장 진단 후 확정된 견적 금액을 결제하는 페이지.
   <768 풀스크린 / ≥768 가운데 카드 — estimate/styles.css 와 같은 셸 전략.

   ⚠️ 루트 styles.css 를 함께 로드하지 않습니다 (.btn/.dot 정의가 충돌).
   ───────────────────────────────────────────────────────────── */

:root {
  --brand: #ED7F1A;
  --brand-hover: #D8700F;
  --brand-600: #C9650A;
  --amber: #F6A24A;
  --ink: #181D27;
  --ink-2: #535862;
  --ink-3: #717680;
  --ink-4: #85888E;
  --footer: #0A0D12;
  --line: #E9EAEB;
  --line-2: #D5D7DA;
  --soft: #FAFAFA;
  --tint: #FEF6EE;
  --green: #067647;
  --green-bg: #ECFDF3;
  --green-line: #ABEFC6;
  --red: #B42318;
  --red-bg: #FEF3F2;
  --red-line: #FECDCA;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
::-webkit-scrollbar { width: 0; height: 0; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  scrollbar-width: none;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 80px; }

/* ── 헤더 ─────────────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hdr-logo img { height: 26px; width: auto; }
.hdr-help { font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.hdr-help b { color: var(--brand-600); }

/* ── 셸 ───────────────────────────────────────────────────────── */
.pay-shell { padding: 28px 20px 64px; }
@media (min-width: 768px) { .pay-shell { padding: 48px 20px 88px; } }
.pay-card { max-width: 520px; margin: 0 auto; }

/* ── 뷰 전환 — JS 로드 전에는 로딩 뷰만 보이도록 HTML 이 순서를 잡는다 ── */
.view[hidden] { display: none; }

/* ── 공통 타이포 ──────────────────────────────────────────────── */
.pay-eyebrow { font-size: 13px; font-weight: 700; color: var(--brand-600); letter-spacing: .04em; }
.pay-h1 { margin-top: 8px; font-size: 26px; line-height: 1.3; letter-spacing: -.03em; font-weight: 800; }
.pay-sub { margin-top: 10px; font-size: 15px; line-height: 1.65; color: var(--ink-2); font-weight: 500; }

/* ── 데모 배지 ────────────────────────────────────────────────── */
.pay-demo {
  margin-bottom: 16px; border-radius: 10px; background: #FFF8F0; border: 1px dashed #F0B87A;
  padding: 12px 16px; font-size: 13.5px; line-height: 1.6; color: #B45309; font-weight: 600;
}

/* ── 견적번호 입력 ────────────────────────────────────────────── */
.field { margin-top: 22px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.field input {
  width: 100%; height: 52px; padding: 0 16px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(237, 127, 26, .14); }
.field input::placeholder { color: #B7BAC0; }
.field-hint { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--ink-4); }

/* ── 금액 ─────────────────────────────────────────────────────── */
.amt {
  margin-top: 22px; border-radius: 16px; background: var(--tint); border: 1px solid #F0E2CE;
  padding: 24px; text-align: center;
}
.amt-k { font-size: 13px; font-weight: 700; color: var(--brand-600); }
.amt-v { margin-top: 8px; font-size: 38px; font-weight: 800; letter-spacing: -.035em; color: var(--ink); font-variant-numeric: tabular-nums; }
.amt-v em { font-style: normal; font-size: 24px; font-weight: 700; margin-left: 2px; }
.amt-d { margin-top: 8px; font-size: 13.5px; color: var(--ink-3); font-weight: 500; }

/* ── 내역 ─────────────────────────────────────────────────────── */
.box { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.box-h {
  padding: 14px 18px; background: var(--soft); border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.box-b { padding: 6px 18px 14px; }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: 14.5px; }
.row + .row { border-top: 1px solid #F2F3F4; }
.row-k { flex: none; color: var(--ink-2); font-weight: 500; line-height: 1.55; }
/* 값에는 "결제일로부터 최대 1개월" 같은 문장도 들어옵니다. nowrap 을 걸면
   flex 아이템이 줄어들지 못해 모바일에서 카드가 통째로 가로로 밀립니다. */
.row-v {
  min-width: 0; color: var(--ink); font-weight: 700; line-height: 1.5;
  font-variant-numeric: tabular-nums; text-align: right; word-break: keep-all;
}
.row-v small { display: block; font-weight: 500; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.row--total { border-top: 1px solid var(--line-2) !important; padding-top: 13px; }
.row--total .row-k { font-weight: 700; color: var(--ink); }
.row--total .row-v { color: var(--brand-600); font-size: 17px; }

/* ── 결제수단 ─────────────────────────────────────────────────── */
.methods { margin-top: 18px; display: grid; gap: 10px; }
.method {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px 18px; border-radius: 12px; background: #fff; cursor: pointer;
  border: 1px solid var(--line-2); font-family: inherit; text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.method:hover { background: var(--soft); }
.method.is-on { border-color: var(--brand); background: var(--tint); box-shadow: 0 0 0 1px var(--brand); }
.method-radio {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line-2); background: #fff; position: relative;
}
.method.is-on .method-radio { border-color: var(--brand); }
.method.is-on .method-radio::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand);
}
/* 라디오 오른쪽 텍스트 묶음 — min-width:0 이 없으면 flex 아이템이 줄지 않습니다 */
.method-tx { min-width: 0; }
.method-t { display: block; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.method-d { display: block; margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--ink-3); font-weight: 500; word-break: keep-all; }

/* ── 동의 ─────────────────────────────────────────────────────── */
.agree { margin-top: 20px; border: 1px solid var(--line); border-radius: 14px; padding: 6px 18px 14px; }
.agree-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.agree-row + .agree-row { border-top: 1px solid #F2F3F4; }
.agree-row.is-miss { animation: payShake .4s ease; }
@keyframes payShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.agree-cb {
  flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); cursor: pointer;
}
.agree-lb { flex: 1; font-size: 14px; line-height: 1.6; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.agree-lb b { color: var(--ink); font-weight: 700; }
.agree-view {
  flex: none; font-size: 13px; font-weight: 600; color: var(--ink-3);
  text-decoration: underline; text-underline-offset: 2px; padding-top: 1px;
}
.agree-view:hover { color: var(--brand-600); }

/* ── 버튼 ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; font-family: inherit; font-weight: 700; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-primary {
  width: 100%; height: 56px; margin-top: 20px; font-size: 17px; color: #fff; background: var(--brand);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary.is-locked { background: var(--line-2); color: #fff; }
.btn-text {
  width: 100%; height: 48px; margin-top: 8px; font-size: 15px; font-weight: 600;
  color: var(--ink-3); background: transparent;
}
.btn-text:hover { color: var(--ink); }

/* ── 결과 ─────────────────────────────────────────────────────── */
.result { text-align: center; padding-top: 12px; }
.result-mark {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
}
.result-mark svg { width: 34px; height: 34px; }
.result-mark--ok { background: var(--green-bg); border: 1px solid var(--green-line); color: var(--green); }
.result-mark--err { background: var(--red-bg); border: 1px solid var(--red-line); color: var(--red); }
.result-mark--wait { background: var(--tint); border: 1px solid #F0E2CE; color: var(--brand-600); }
.result h2 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.result p { margin-top: 10px; font-size: 15px; line-height: 1.65; color: var(--ink-2); font-weight: 500; }
.result .box { text-align: left; }

/* ── 스피너 ───────────────────────────────────────────────────── */
.spinner {
  width: 38px; height: 38px; margin: 40px auto 18px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand); animation: paySpin .8s linear infinite;
}
@keyframes paySpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .agree-row.is-miss { animation: none; }
}
.loading-t { text-align: center; font-size: 15px; color: var(--ink-3); font-weight: 600; }

/* ── 안내 배너 ────────────────────────────────────────────────── */
.notice {
  margin-top: 18px; border-radius: 12px; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.65; font-weight: 500;
}
.notice--info { background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); }
.notice--err { background: var(--red-bg); border: 1px solid var(--red-line); color: var(--red); }
.notice b { font-weight: 700; }

/* ── 하단 사업자 정보 (전자상거래법 §10 — 결제 화면에도 노출) ──── */
.pay-legal {
  max-width: 520px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.85; color: var(--ink-4); font-weight: 500;
}
.pay-legal-links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.pay-legal-links a { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.pay-legal-links a:hover { color: var(--brand-600); }

/* ── 토스트 ───────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  max-width: calc(100% - 40px); padding: 13px 20px; border-radius: 10px;
  background: rgba(24, 29, 39, .94); color: #fff; font-size: 14.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; text-align: center;
}
.toast.show { opacity: 1; }

@media (max-width: 767px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .pay-h1 { font-size: 23px; }
  .amt-v { font-size: 32px; }
  .hdr-help { display: none; }
}
