/* ───────── The Crosss · 라이트 테마 ───────── */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&display=swap');

:root {
  /* 페이퍼 화이트 — 차가운 #FFF 가 아닌 따뜻한 종이 톤 */
  --paper:        #FBFAF7;
  --paper-deep:   #F4F1EA;
  --surface:      #FFFFFF;
  --line:         #E5E0D6;
  --line-soft:    #ECE7DC;

  --ink:          #0A0A0A;
  --ink-dim:      #5B5651;
  --ink-mute:     #989288;

  /* 단청 골드 — 한국 전통 문서 미감의 액센트 */
  --gold:         #B58A3C;
  --gold-soft:    #F1E6CC;

  /* 진중한 잉크 블루 — 헤더/링크 */
  --indigo:       #1B2845;

  /* 통신사 브랜드 컬러 */
  --sk:           #EE3324;
  --kt:           #1A1A1A;
  --lg:           #A50034;

  --positive:     #0F5C3D;
  --warn:         #B36D00;
  --danger:       #B91C1C;

  --radius:       10px;
  --radius-sm:    6px;

  --font-serif:   "Noto Serif KR", "Nanum Myeongjo", serif;
  --font-sans:    "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-mono:    "Space Grotesk", "JetBrains Mono", ui-monospace, monospace;

  --shadow-sm:    0 1px 0 rgba(20, 16, 8, 0.04), 0 1px 3px rgba(20, 16, 8, 0.04);
  --shadow-md:    0 2px 4px rgba(20, 16, 8, 0.06), 0 8px 24px rgba(20, 16, 8, 0.06);
  --shadow-lg:    0 4px 8px rgba(20, 16, 8, 0.08), 0 16px 48px rgba(20, 16, 8, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss03", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(20,16,8,0.025) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.7;
}
main, header, footer { position: relative; z-index: 1; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
a { color: var(--indigo); text-decoration: none; transition: color .15s; }
a:hover { color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* ── 헤더 ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255,255,255,0.92);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.brand::after {
  content: '·';
  color: var(--gold);
  font-size: 28px;
  line-height: 0;
}
.brand:hover { color: var(--indigo); }
nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
nav a { color: var(--ink-dim); font-weight: 500; }
nav a:hover { color: var(--ink); }
.user-chip {
  font-size: 12px;
  color: var(--ink-mute);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--indigo); border-color: var(--indigo); color: var(--paper); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--paper); }
.btn-gold:hover { background: #9F7732; border-color: #9F7732; color: var(--paper); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--paper); }
.link-btn { background: none; border: 0; color: var(--ink-dim); cursor: pointer; padding: 0; font: inherit; font-weight: 500; }
.link-btn:hover { color: var(--ink); }
form.inline { display: inline; }

/* ── 폼 ── */
.form-card {
  max-width: 440px;
  margin: 80px auto;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.form-card h1 {
  margin: 0 0 28px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.field { margin-bottom: 18px; }
.field label {
  display: block; margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ink); background: var(--surface);
}
.field input[type=file] { padding: 9px; background: var(--surface); }
.form-foot { margin-top: 24px; text-align: center; color: var(--ink-dim); font-size: 13px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  border-left: 3px solid;
  background: var(--surface);
}
.alert-error { border-left-color: var(--danger); color: #7B1818; background: #FBF1F1; }
.alert-success { border-left-color: var(--positive); color: #0A3F2A; background: #F0F7F3; }
.alert-info { border-left-color: var(--indigo); color: #142035; background: #F2F4F9; }
.alert-warn { border-left-color: var(--warn); color: #7A4A00; background: #FBF5EA; }

/* ── 랜딩 ── */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
}
.hero::before {
  content: 'THE CROSSS';
  position: absolute;
  top: 30px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 180px;
  color: var(--paper-deep);
  letter-spacing: 0.02em;
  z-index: -1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.5;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 56px;
  line-height: 1.15;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { color: var(--ink-dim); font-size: 18px; margin: 0 auto 36px; max-width: 640px; line-height: 1.6; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section-rule {
  display: flex; align-items: center; gap: 16px;
  margin: 64px 0 32px;
}
.section-rule::before, .section-rule::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-rule h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.02em;
}

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 40px 0; }
.feature {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.feature .num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.feature h3 { margin: 8px 0 10px; font-family: var(--font-serif); font-weight: 700; font-size: 19px; }
.feature p { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.65; }

.pricing { padding: 64px 0 80px; text-align: center; }
.pricing h2 { font-family: var(--font-serif); font-weight: 900; font-size: 36px; margin: 0 0 12px; }
.pricing > p { color: var(--ink-dim); margin: 0 0 32px; }
.price-card {
  display: inline-block;
  padding: 40px 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  min-width: 320px;
}
.price-card .price {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 48px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.price-card .price .small { font-size: 18px; color: var(--ink-dim); font-weight: 500; }
.price-card .desc { margin-top: 4px; color: var(--ink-dim); font-size: 14px; }
.price-list { list-style: none; padding: 0; margin: 20px 0; font-size: 14px; }
.price-list li { padding: 6px 0; border-bottom: 1px dashed var(--line-soft); display: flex; justify-content: space-between; }
.price-list li:last-child { border-bottom: 0; }

/* ── 대시보드/공통 ── */
.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin: 40px 0 24px;
}
.page-head h1 {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 32px;
  margin: 0;
  letter-spacing: -0.02em;
}
.page-head .meta { color: var(--ink-mute); font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 32px; }
.stat-card {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.stat-card .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-card .value {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 900;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-card .value .unit { font-size: 16px; color: var(--ink-dim); font-weight: 500; }
.stat-card .sub { font-size: 13px; color: var(--ink-dim); margin-top: 6px; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
th {
  background: var(--paper-deep);
  font-weight: 600;
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--paper); }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-wrap .scroll { overflow-x: auto; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-pending { background: #FBF5EA; color: var(--warn); }
.badge-processing { background: #F2F4F9; color: var(--indigo); }
.badge-done { background: #F0F7F3; color: var(--positive); }
.badge-failed { background: #FBF1F1; color: var(--danger); }
.badge-carrier { font-family: var(--font-mono); padding: 4px 10px; font-size: 12px; }
.badge-sk { background: var(--sk); color: white; }
.badge-kt { background: var(--kt); color: white; }
.badge-lg { background: var(--lg); color: white; }

.upload-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.upload-card h3 { font-family: var(--font-serif); font-weight: 700; margin: 0 0 18px; font-size: 18px; }
.upload-row { display: grid; grid-template-columns: 1fr 180px; gap: 14px; align-items: end; }

.muted { color: var(--ink-dim); font-size: 13px; }
.tiny { font-size: 11px; color: var(--ink-mute); }

.empty {
  text-align: center;
  padding: 56px 32px;
  color: var(--ink-mute);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}

.site-footer {
  padding: 40px 0;
  margin-top: 80px;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: 13px;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ── 검색 (lookup) — 핵심 화면 ── */
.lookup-hero {
  background: var(--ink);
  color: var(--paper);
  padding: 48px 0 56px;
  margin: -1px 0 32px;  /* 헤더 경계 흡수 */
  border-bottom: 1px solid var(--ink);
}
.lookup-hero .container { position: relative; }
.lookup-hero h1 {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 30px;
  margin: 0 0 24px;
  color: var(--paper);
  letter-spacing: -0.01em;
}
.lookup-hero h1 .accent { color: var(--gold); }
.lookup-form { display: flex; gap: 10px; max-width: 680px; }
.lookup-form input {
  flex: 1;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 18px;
  font-family: var(--font-sans);
  font-weight: 500;
}
.lookup-form input:focus { outline: 3px solid var(--gold); outline-offset: -1px; }
.lookup-form button {
  padding: 18px 32px;
  background: var(--gold);
  border: 0;
  border-radius: var(--radius);
  color: var(--paper);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
}
.lookup-form button:hover { background: #9F7732; }

.lookup-quick {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  color: rgba(251, 250, 247, 0.5);
  font-size: 13px;
}
.lookup-quick a {
  color: rgba(251, 250, 247, 0.85);
  font-size: 12px;
  padding: 5px 11px;
  border: 1px solid rgba(251, 250, 247, 0.18);
  border-radius: 999px;
}
.lookup-quick a:hover { color: var(--paper); border-color: rgba(251, 250, 247, 0.4); }

.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.result-head {
  padding: 22px 26px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.result-head .name {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}
.result-head .code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.result-best {
  text-align: right;
}
.result-best .label {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.result-best .price {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 44px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-top: 4px;
}
.result-best .price .unit { font-size: 18px; color: var(--ink-dim); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.result-best .src { font-size: 12px; color: var(--ink-dim); margin-top: 6px; }
.result-best .src .badge-carrier { vertical-align: middle; margin-right: 4px; }

.carrier-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-soft);
}
.carrier-cell {
  padding: 16px 22px;
  border-right: 1px solid var(--line-soft);
}
.carrier-cell:last-child { border-right: 0; }
.carrier-cell.empty-cell { background: var(--paper); }
.carrier-cell .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.carrier-cell .head .date { font-size: 11px; color: var(--ink-mute); }
.carrier-cell .price {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.carrier-cell .price .unit { font-size: 12px; color: var(--ink-dim); font-weight: 500; margin-left: 2px; }
.carrier-cell .kind {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--paper-deep);
  color: var(--ink-dim);
  margin-right: 6px;
}
.carrier-cell .plan { font-size: 12px; color: var(--ink-dim); margin-top: 4px; line-height: 1.4; }
.carrier-cell .none { color: var(--ink-mute); font-size: 13px; }

.result-plans {
  border-top: 1px solid var(--line-soft);
}
.result-plans summary {
  padding: 14px 26px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dim);
  background: var(--paper);
  list-style: none;
  user-select: none;
}
.result-plans summary::-webkit-details-marker { display: none; }
.result-plans summary::after { content: '▼'; font-size: 10px; margin-left: 6px; color: var(--ink-mute); }
.result-plans[open] summary::after { content: '▲'; }
.result-plans table { font-size: 13px; }
.result-plans th { background: var(--paper); }

/* ── 결과 페이지 ── */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.detail-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.detail-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; height: fit-content; }

/* ── 반응형 ── */
@media (max-width: 880px) {
  .feature-grid, .stat-grid { grid-template-columns: 1fr; }
  .upload-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .hero::before { font-size: 100px; }
  .lookup-form { flex-direction: column; }
  .lookup-form input, .lookup-form button { width: 100%; }
  .carrier-strip { grid-template-columns: 1fr; }
  .carrier-cell { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .carrier-cell:last-child { border-bottom: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .result-head { flex-direction: column; }
  .result-best { text-align: left; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 60px 0 50px; }
  .hero h1 { font-size: 28px; }
  .page-head h1 { font-size: 24px; }
  .stat-card .value { font-size: 26px; }
  .result-head { padding: 18px 18px 14px; }
  .result-head .name { font-size: 20px; }
  .result-best .price { font-size: 34px; }
  .carrier-cell { padding: 14px 18px; }
}

/* ── 페이지 로드 미세 모션 ── */
@media (prefers-reduced-motion: no-preference) {
  .result-card { animation: fade-in .35s ease both; }
  .result-card:nth-child(2) { animation-delay: 0.05s; }
  .result-card:nth-child(3) { animation-delay: 0.1s; }
  .result-card:nth-child(4) { animation-delay: 0.15s; }
  .stat-card { animation: fade-in .35s ease both; }
  .stat-card:nth-child(2) { animation-delay: 0.07s; }
  .stat-card:nth-child(3) { animation-delay: 0.14s; }
  @keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
