/* 요금제 화면(/pricing/): 소개 페이지 스타일(landing.css 변수·버튼·머리글) 위에 덧붙인다 */

/* ---------- 상단 ---------- */
.pricing-top { position: relative; overflow: hidden; background: var(--night); color: var(--night-ink); padding-bottom: 56px; }
.top-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; opacity: 0.95; pointer-events: none; }
/* 그림은 왼쪽에, 글은 오른쪽에: 글 쪽만 어둡게 눌러 읽기 쉽게 */
.pricing-top::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 16, 22, 0.6) 0, rgba(14, 16, 22, 0) 96px), linear-gradient(90deg, rgba(14, 16, 22, 0) 0%, rgba(14, 16, 22, 0.35) 32%, rgba(14, 16, 22, 0.7) 60%, rgba(14, 16, 22, 0.8) 100%); pointer-events: none; }
.pricing-head { padding-left: max(clamp(16px, 4vw, 48px), 34%) !important; }
@media (max-width: 860px) {
  .pricing-head { padding-left: clamp(16px, 4vw, 48px) !important; }
  .pricing-top::after { background: rgba(14, 16, 22, 0.72); }
}
.pricing-top > :not(.top-art) { position: relative; z-index: 1; }
.pricing-top .nav { position: relative; }
.nav-links a[aria-current="page"] { opacity: 1; font-weight: 650; }
.pricing-head { max-width: 1120px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 0; display: grid; justify-items: start; }
.pricing-head h1 { margin: 0; max-width: 16em; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.15; letter-spacing: -0.025em; }
.pricing-head .lead { max-width: 36em; }
.lang-note { max-width: 36em; margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); font-size: 14.5px; }
.lang-note a { color: inherit; font-weight: 650; }

.period { display: inline-flex; margin-top: 28px; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); gap: 4px; }
.period button { border: 0; border-radius: 999px; padding: 9px 20px; background: transparent; color: var(--night-ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.period button small { font-size: 12px; font-weight: 700; color: #9fb6f5; margin-left: 6px; }
.period button.on { background: #fff; color: #17171a; }
.period button.on small { color: var(--accent); }
.period button:focus-visible { outline: 3px solid #9fb6f5; outline-offset: 2px; }

/* ---------- 요금제 카드 ---------- */
.pricing { max-width: 1120px; margin: -28px auto 0; padding: 0 clamp(16px, 4vw, 48px) 64px; position: relative; z-index: 2; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.loading { grid-column: 1 / -1; color: var(--muted); background: var(--surface); padding: 24px; border-radius: var(--radius); }

.plan { position: relative; display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.plan:hover { transform: translateY(-2px); }
.plan-art { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #ece9e1; border-bottom: 1px solid var(--line); }
.plan-body { display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 22px; flex: 1; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.tag.solid { background: var(--accent); color: var(--accent-ink); }

.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; min-height: 48px; }
.price .approx { flex-basis: 100%; color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 2px; }
.fx-note { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.price strong { font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.price span { color: var(--muted); font-size: 15px; font-weight: 600; }
.price.word strong { font-size: 30px; }
.pending-note { margin: -4px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 650; text-align: center; }
.bill { margin-top: -8px; color: var(--accent); font-size: 13.5px; font-weight: 650; min-height: 18px; }

.credits { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.credits b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.credits span { font-size: 13px; color: var(--muted); font-weight: 600; }
.credits small { font-size: 13.5px; color: var(--ink); }

.plan .btn { width: 100%; justify-content: center; }
.plan .btn.ghost { color: var(--ink); border-color: var(--line); background: transparent; }
.plan .btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.feat { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.feat li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; line-height: 1.45; }
.feat li::before { content: ''; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5' fill='none' stroke='%232f5bd3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.feat li.no { color: var(--muted); }
.feat li.no::before { background: var(--line) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 8h6' fill='none' stroke='%235f5f66' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* 추천(프로)과 지금 요금제 */
.plan.featured { border: 2px solid var(--accent); box-shadow: 0 2px 4px rgba(47, 91, 211, 0.08), 0 20px 44px rgba(47, 91, 211, 0.18); transform: translateY(-8px); }
.plan.featured:hover { transform: translateY(-10px); }
.plan.featured .credits { background: var(--accent-soft); border-color: transparent; }
.plan.current { border-color: var(--accent); }
.plan.trial .plan-art { filter: saturate(0.85); }

/* ---------- 충전팩 ---------- */
.topup { display: grid; grid-template-columns: 220px 1fr auto; align-items: center; gap: 24px; margin-top: 28px; padding: 18px 24px 18px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.topup[hidden] { display: none; }
.topup-art { width: 220px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #ece9e1; }
.topup-body { display: grid; gap: 6px; justify-items: start; text-align: left; }
.topup-body h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -0.01em; }
.topup-body p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 34em; }
.topup-buy { display: grid; gap: 12px; justify-items: end; text-align: right; }
.topup-price strong { display: block; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.topup-price span { font-size: 13px; color: var(--muted); }

/* ---------- 알아 두실 것 ---------- */
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.notes h3 { margin: 0 0 6px; font-size: 15px; }
.notes p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ---------- 가운데 확인 창 ---------- */
.pay-dialog { width: min(440px, calc(100vw - 32px)); padding: 28px 26px 22px; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(10, 12, 20, 0.35); }
.pay-dialog::backdrop { background: rgba(14, 16, 22, 0.55); backdrop-filter: blur(2px); }
.pay-dialog h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.015em; text-align: center; }
.dlg-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.dlg-close:hover { background: var(--bg); }
.dlg-close[hidden] { display: none; }
.dlg-art { display: block; width: 140px; height: 140px; margin: -6px auto 10px; border-radius: 50%; object-fit: cover; box-shadow: 0 8px 24px rgba(20, 20, 30, 0.12); }
.dlg-art[hidden] { display: none; }
.dlg-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft) center / 26px no-repeat; }
.dlg-icon[hidden] { display: none; }
.dlg-icon.up { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 19V5M5.5 11.5L12 5l6.5 6.5' fill='none' stroke='%232f5bd3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.dlg-icon.down { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5.5 12.5L12 19l6.5-6.5' fill='none' stroke='%232f5bd3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.dlg-icon.warn { background-color: #fdecec; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7v6M12 16.5v.5' fill='none' stroke='%23c2412d' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.dlg-icon.wait { background: transparent; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.9s linear infinite; width: 44px; height: 44px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dlg-icon.wait { animation-duration: 3s; } }
.dlg-lead { margin: 0 0 14px; text-align: center; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.dlg-lead:empty { display: none; }
.dlg-rows { margin: 0; padding: 4px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.dlg-rows:empty { display: none; }
.dlg-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.dlg-rows div:last-child { border-bottom: 0; }
.dlg-rows dt { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.dlg-rows dd { margin: 0; text-align: right; font-weight: 700; font-size: 15px; }
.dlg-rows dd .from { color: var(--muted); font-weight: 600; }
.dlg-rows dd .arrow { color: var(--accent); margin: 0 6px; }
.dlg-rows dd small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; margin-top: 2px; }
.dlg-note { margin: 12px 2px 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; text-align: center; }
.dlg-note:empty { display: none; }
.dlg-actions { display: flex; gap: 10px; margin-top: 20px; }
.dlg-actions .btn { flex: 1; justify-content: center; white-space: nowrap; padding-left: 12px; padding-right: 12px; }
.dlg-actions .btn.ghost { color: var(--ink); border-color: var(--line); background: transparent; }
.dlg-actions:empty { display: none; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1000px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan.featured { transform: none; }
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topup { grid-template-columns: 1fr; padding: 18px; text-align: left; }
  .topup-art { width: 100%; }
  .topup-buy { justify-items: stretch; text-align: left; }
  .topup-buy .btn { justify-content: center; }
}
@media (max-width: 560px) {
  .plans { grid-template-columns: 1fr; }
  .notes { grid-template-columns: 1fr; }
  .nav-links a:not([lang]) { display: none; }
  .top-art { object-position: 30% center; }
}

/* 요금제 카드는 /api/plans 응답 뒤에 그려져 「불러오는 중」 한 줄이 카드 8장으로 바뀐다. 그 전에는 카드 아래 내용과
   바닥글을 자리 그대로 보이지 않게 둬서, 카드가 들어올 때 밀리지 않게 한다(SB-CLS-008). 스크립트가 멈춰도 4초 뒤 보인다 */
body.plans-pending main.pricing > :not(#plans), body.plans-pending > footer { visibility: hidden; animation: plans-wait 0s 4s forwards; }
@keyframes plans-wait { to { visibility: visible; } }
@media print { body.plans-pending main.pricing > :not(#plans), body.plans-pending > footer { visibility: visible; animation: none; } }
