/* 여행 계산기 — 일본 여행 엔화·면세 계산기
   공통 스타일 (index.html, privacy.html) */

:root {
  --navy: #12233f;
  --navy-soft: #1d3557;
  --ink: #1a2233;
  --muted: #5b677c;
  --line: #e3e8f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --brand: #2f6fed;
  --brand-dark: #1f55c4;
  --teal: #0f9d8a;
  --amber: #c97a0a;
  --red: #d14836;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(18, 35, 63, 0.08);
  --shadow-sm: 0 2px 8px rgba(18, 35, 63, 0.06);
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR",
    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  word-break: keep-all;
  overflow-wrap: break-word;
}

img { max-width: 100%; }

.wrap {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  padding: 0.6rem 1rem;
  z-index: 50;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 35, 63, 0.96);
  backdrop-filter: blur(8px);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, #2f6fed, #0f9d8a);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.02rem; letter-spacing: -0.01em; }
.brand-text small { font-size: 0.72rem; color: #b8c6dd; letter-spacing: 0.02em; }

.site-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: #d9e3f5;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---------- 히어로 ---------- */
.hero {
  background:
    radial-gradient(900px 320px at 12% -10%, rgba(47, 111, 237, 0.55), transparent 60%),
    radial-gradient(700px 300px at 90% 0%, rgba(15, 157, 138, 0.35), transparent 60%),
    linear-gradient(160deg, #12233f 0%, #1d3557 100%);
  color: #fff;
  padding: 3.2rem 0 3.6rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: #9fd8ce;
  font-weight: 600;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.22;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0;
  max-width: 46rem;
  color: #dbe5f5;
  font-size: 1.02rem;
}
.hero-lead strong { color: #fff; }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
}
.hero-badges li {
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e7eefb;
}

/* ---------- 카드 공통 ---------- */
.content {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 2.2rem 0 3.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  scroll-margin-top: 84px;
}

.card-head h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.step {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e8efff;
  color: var(--brand-dark);
  font-size: 0.95rem;
  font-weight: 700;
}

.card-desc {
  margin: 0 0 1.3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- 폼 ---------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field label, .field-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #33415c;
}

input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 0.72rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fbfcfe;
  border: 1.5px solid #d6ddeb;
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #64718a 50%), linear-gradient(135deg, #64718a 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }

.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix input { padding-right: 2.6rem; }
.input-suffix .suffix {
  position: absolute;
  right: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.hint { margin: 0; font-size: 0.78rem; color: var(--muted); }
.hint.error { color: var(--red); font-weight: 600; margin-top: 0.3rem; }

.check-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 1.1rem;
  font-size: 0.88rem;
  color: #3b4a66;
  cursor: pointer;
}
.check-line input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; flex: none; }

.rate-row {
  margin-bottom: 1.2rem;
}
.rate-row .field { max-width: 470px; }
.rate-input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.rate-input .input-suffix { flex: 1 1 180px; min-width: 0; }
.rate-input .btn { flex: none; white-space: nowrap; }

.field-amount { margin-bottom: 1rem; }
.field-amount input { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em; }

.quick-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.chip {
  border: 1px solid #d6ddeb;
  background: #fff;
  color: #37456a;
  font-size: 0.82rem;
  font-family: inherit;
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); background: #f2f6ff; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.segmented { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.segmented label {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #d6ddeb;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #34405c;
  background: #fbfcfe;
  transition: all 0.15s;
}
.segmented input { accent-color: var(--brand); margin: 0; }
.segmented label:has(input:checked) {
  border-color: var(--brand);
  background: #eef4ff;
  color: var(--brand-dark);
  font-weight: 600;
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  border: 1.5px solid transparent;
  padding: 0.78rem 1.4rem;
  transition: transform 0.08s, background 0.15s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(140deg, var(--brand), #3f86ff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.28);
  margin-bottom: 1.3rem;
}
.btn-primary:hover { background: linear-gradient(140deg, var(--brand-dark), var(--brand)); }

.btn-ghost {
  background: #fff;
  border-color: #d6ddeb;
  color: #3c4a68;
}
.btn-ghost:hover { border-color: #b9c4d8; background: #f7f9fd; }

.btn-small { padding: 0.5rem 0.9rem; font-size: 0.84rem; }

/* ---------- 결과 ---------- */
.result {
  border-top: 1px dashed var(--line);
  padding-top: 1.2rem;
}

.result-summary {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.result-label { font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.result-summary strong {
  font-size: clamp(1.6rem, 4vw, 2.05rem);
  letter-spacing: -0.02em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.sub-value { font-size: 0.92rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.pay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.pay-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: #fbfcfe;
}
.pay-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #33415c;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.pay-card.best { border-color: rgba(15, 157, 138, 0.55); background: #f2fbf9; }
.tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  background: #dff5f0;
  color: #0b7a6b;
  letter-spacing: 0.01em;
}
.tag-warn { background: #fff2dd; color: #a05f04; }
.pay-amount {
  margin: 0 0 0.3rem;
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.pay-note { margin: 0; font-size: 0.76rem; color: var(--muted); }

.result-list {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.result-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.62rem 0.95rem;
  font-size: 0.9rem;
}
.result-list li + li { border-top: 1px solid #eef1f7; }
.result-list li > span:first-child { color: var(--muted); }
.result-list li > span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.result-list li.strong { background: #f4f8ff; }
.result-list li.strong > span:last-child { color: var(--brand-dark); font-size: 1rem; }

.note {
  margin: 0.8rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  background: #f7f9fd;
  border-left: 3px solid #c9d7ef;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
}
.note strong { color: #3a4a68; }

.notice {
  margin: 0 0 1.2rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(140deg, #eef4ff, #f3fbf9);
  border: 1px solid #d9e6fb;
  font-size: 0.88rem;
}
.notice strong { display: block; margin-bottom: 0.4rem; color: var(--brand-dark); }
.notice li strong { display: inline; margin: 0; color: inherit; }
.notice ul { margin: 0; padding-left: 1.1rem; color: #3b4a66; }
.notice li + li { margin-top: 0.28rem; }

/* ---------- 쇼핑 목록 ---------- */
.item-form {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) minmax(90px, 0.9fr) minmax(100px, 0.9fr) minmax(110px, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
  margin-bottom: 0.5rem;
}
.item-form .btn { margin-bottom: 0; padding: 0.72rem 1.1rem; white-space: nowrap; }

.item-list-wrap { margin-top: 1.3rem; }

.sub-title {
  font-size: 1rem;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.count {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--brand-dark);
  background: #e8efff;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}

.item-list {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.item-list .empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 1rem;
  text-align: center;
  border: 1.5px dashed #d6ddeb;
  border-radius: 12px;
  background: #fbfcfe;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 0.9rem;
}
.item-row .item-main { flex: 1; min-width: 0; }
.item-row .item-name {
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-row .item-meta { font-size: 0.78rem; color: var(--muted); }
.item-row .item-usd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #33415c;
}
.item-row .item-del {
  border: none;
  background: #fdeeee;
  color: var(--red);
  width: 30px;
  height: 30px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex: none;
}
.item-row .item-del:hover { background: #fad9d9; }

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.badge.ok { background: #dff5f0; color: #0b7a6b; }
.badge.over { background: #ffe9e6; color: #b03222; }

.separate-limits {
  margin-top: 1.6rem;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}
.limit-list {
  margin: 0 0 0.3rem;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: #3b4a66;
}
.limit-list li + li { margin-top: 0.25rem; }
.limit-list .muted { color: var(--muted); font-size: 0.84rem; }

/* ---------- 본문 콘텐츠 ---------- */
.article h2 { margin-top: 0; }
.article h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.article p { margin: 0 0 0.9rem; color: #33415c; font-size: 0.95rem; }
.article p:last-child { margin-bottom: 0; }

.faq { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.steps { margin: 0 0 1rem; padding-left: 1.2rem; color: #33415c; font-size: 0.95rem; }
.steps li + li { margin-top: 0.4rem; }
.steps strong { color: #23324f; }
.faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  background: #fbfcfe;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: #2b3a57;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0.6rem 0 0; font-size: 0.89rem; color: #46536f; }

.updated { margin-top: 1.5rem !important; font-size: 0.8rem !important; color: var(--muted) !important; }

/* ---------- 푸터 ---------- */
.site-footer {
  background: var(--navy);
  color: #b8c6dd;
  padding: 2rem 0 2.4rem;
  font-size: 0.86rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.9rem; }
.footer-links a { color: #dbe5f5; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.disclaimer { margin: 0 0 0.8rem; max-width: 52rem; line-height: 1.6; }
.copyright { margin: 0; color: #8fa2c0; font-size: 0.8rem; }

/* ---------- 개인정보처리방침 페이지 ---------- */
.legal { max-width: 780px; }
.legal h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 0.3rem; letter-spacing: -0.02em; }
.legal .lead-date { color: var(--muted); font-size: 0.86rem; margin: 0 0 1.6rem; }
.legal h2 { font-size: 1.08rem; margin: 1.8rem 0 0.5rem; }
.legal p, .legal li { color: #33415c; font-size: 0.94rem; }
.legal ul { padding-left: 1.15rem; }
.legal li + li { margin-top: 0.3rem; }
.legal a { color: var(--brand-dark); }
.legal .back { display: inline-block; margin-bottom: 1.4rem; font-size: 0.9rem; color: var(--brand-dark); text-decoration: none; }

/* ---------- 반응형 ---------- */
@media (max-width: 820px) {
  .item-form {
    grid-template-columns: 1fr 1fr;
  }
  .item-form .field:first-child { grid-column: 1 / -1; }
  .item-form .btn { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { width: min(1080px, 100% - 1.5rem); }
  .hero { padding: 2.3rem 0 2.6rem; }
  .hero-badges li { font-size: 0.78rem; }
  .content { padding: 1.3rem 0 2.5rem; gap: 1.1rem; }
  .card { border-radius: 16px; padding: 1.15rem; }
  .site-nav { width: 100%; justify-content: flex-start; gap: 0.2rem; }
  .site-nav a { padding: 0.35rem 0.55rem; font-size: 0.84rem; }
  .rate-row .field { max-width: none; }
  .rate-input .btn { width: auto; }
  .btn { width: 100%; padding: 0.85rem 1rem; }
  .btn-small { width: auto; }
  .pay-amount { font-size: 1.2rem; }
  .result-summary strong { font-size: 1.55rem; }
  .item-form { grid-template-columns: 1fr; }
  .item-row { gap: 0.6rem; }
  .result-list li { padding: 0.58rem 0.8rem; font-size: 0.86rem; }
  .result-list li > span:last-child { max-width: 55%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
