@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;500;700&display=swap');

/* ═══════════════════════════════════════
   TOKENS — Jung QR (Minimal / Modern)
   거의 모노톤 + 단일 포인트 컬러
═══════════════════════════════════════ */
:root {
  /* surfaces */
  --bg:        #F7F7F8;
  --paper:     #FFFFFF;

  /* ink scale */
  --ink:       #18181B;   /* primary text / button */
  --ink-2:     #52525B;   /* secondary text */
  --ink-3:     #A1A1AA;   /* muted / placeholder */

  /* lines & accent */
  --line:      #E7E7EA;
  --line-2:    #DEDEE2;
  --accent:    #4F46E5;   /* 단일 포인트 컬러 (focus / 강조) */
  --accent-soft: #EEF0FF;

  /* radius */
  --r-1: 8px;
  --r-2: 12px;
  --r-3: 16px;
  --r-4: 20px;

  /* shadow (아주 옅게) */
  --sh-sm: 0 1px 2px rgba(24,24,27,.05);
  --sh:    0 2px 8px rgba(24,24,27,.06);
  --sh-lg: 0 8px 28px rgba(24,24,27,.08);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --t1: 140ms;
  --t2: 240ms;

  /* ─── legacy compat (client_info.html / user_agent.html) ─── */
  --surface:        var(--paper);
  --surface-2:      var(--bg);
  --border:         var(--line);
  --border-2:       var(--line-2);
  --text:           var(--ink);
  --text-2:         var(--ink-2);
  --text-3:         var(--ink-3);
  --bg-card:        var(--paper);
  --glass-border:   var(--line);
  --glass-shadow:   var(--sh);
  --accent-primary: var(--accent);
  --accent-gradient: var(--accent);
  --text-muted:     var(--ink-3);
  --text-secondary: var(--ink-2);
  --text-primary:   var(--ink);
  --radius-lg:      var(--r-3);
  --radius-md:      var(--r-2);
}

/* ─── BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 72px;
  line-height: 1.5;
}

.stars, .star { display: none !important; }

/* ═══════════════════════════════════════
   SITE HEADER
═══════════════════════════════════════ */
.site-head {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
  margin-bottom: 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand svg { width: 22px; height: 22px; display: block; }
.head-nav { display: flex; align-items: center; gap: 6px; }
.head-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 7px 10px;
  border-radius: 8px;
  transition: background var(--t1) var(--ease), color var(--t1) var(--ease);
}
.head-nav a:hover { color: var(--ink); background: var(--bg); }

/* language switcher */
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 28px 7px 11px;
  cursor: pointer;
  transition: border-color var(--t1) var(--ease);
}
.lang-select:hover { border-color: var(--ink-3); }
.lang-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.hero {
  width: 100%;
  max-width: 720px;
  margin: 14px 0 26px;
  text-align: center;
}
.hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink);
}
.hero h1 br { display: none; }
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  margin-top: 12px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-2);
}

/* feature badges */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}
.hero-badges span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ═══════════════════════════════════════
   PAGE CONTAINER
═══════════════════════════════════════ */
.page-container {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ═══════════════════════════════════════
   CARD (form / result 공용)
═══════════════════════════════════════ */
.calc-form,
.calc-result {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 24px;
  box-shadow: var(--sh-sm);
}

.calc-field { margin-bottom: 20px; }
.calc-field:last-child { margin-bottom: 0; }
.calc-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}
.calc-label .hint {
  color: var(--ink-3);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 4px;
}

/* input / textarea */
.calc-input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  outline: none;
  resize: vertical;
  transition: border-color var(--t1) var(--ease), box-shadow var(--t1) var(--ease);
}
.calc-input::placeholder { color: var(--ink-3); font-weight: 400; }
.calc-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* segmented radio (크기) */
.calc-seg {
  display: flex;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 4px;
}
.calc-seg input[type="radio"] { display: none; }
.calc-seg label {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--t1) var(--ease), color var(--t1) var(--ease), box-shadow var(--t1) var(--ease);
}
.calc-seg label:hover { color: var(--ink); }
.calc-seg input[type="radio"]:checked + label {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--sh-sm);
}

/* checkbox (숨겨진 네트워크 등) */
.calc-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  user-select: none;
}
.calc-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  position: relative;
  transition: background var(--t1) var(--ease), border-color var(--t1) var(--ease);
}
.calc-check input[type="checkbox"]:checked {
  background: var(--ink);
  border-color: var(--ink);
}
.calc-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* color pickers */
.qr-colors { display: flex; gap: 12px; flex-wrap: wrap; }
.qr-color-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 7px 14px 7px 7px;
}
.qr-color-item input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--paper);
  cursor: pointer;
}
.qr-color-item input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.qr-color-item input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }
.qr-color-item span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* ═══════════════════════════════════════
   RESULT / QR PREVIEW
═══════════════════════════════════════ */
.calc-result { text-align: center; }
.result-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 16px;
}

#qrcode {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
#qrcode .qr-empty {
  color: var(--ink-3);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  padding: 0 20px;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.start-button,
.retry-button {
  width: 100%;
  padding: 13px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: var(--r-1);
  cursor: pointer;
  transition: background var(--t1) var(--ease), transform var(--t1) var(--ease);
}
.start-button:hover,
.retry-button:hover { background: #000; }
.start-button:active,
.retry-button:active { transform: scale(.985); }

/* link-style button */
.btn-link {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--r-1);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line-2);
  color: var(--ink);
  transition: background var(--t1) var(--ease), border-color var(--t1) var(--ease);
}
.btn-link:hover { background: var(--bg); border-color: var(--ink-3); }
.btn-link.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-link.primary:hover { background: #000; }

/* ═══════════════════════════════════════
   NOTE
═══════════════════════════════════════ */
.calc-note {
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.7;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 16px 18px;
}
.calc-note b { color: var(--ink); font-weight: 600; }

/* ═══════════════════════════════════════
   AD GRID  (NO border-radius / overflow — AdFit rule)
═══════════════════════════════════════ */
.ad-grid { display: grid; grid-template-columns: repeat(2, 320px); gap: 12px; justify-content: center; margin-top: 12px; }
.ad-cell { width: 320px; min-height: 50px; }
.ad-mobile-container-320-50-center  { display: block; width: 320px; min-height: 50px; }
.ad-mobile-container-320-100-center { display: block; width: 320px; min-height: 100px; }
.ag-ad-area { width: 320px; }
@media (max-width: 720px) { .ad-grid { grid-template-columns: 320px; } }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
.site-footer {
  width: 100%;
  max-width: 720px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.site-footer a {
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t1) var(--ease);
}
.site-footer a:hover { color: var(--ink); }
.footer-divider { color: var(--line-2); margin: 0 12px; }

/* ═══════════════════════════════════════
   CROSS-PAGE: client_info.html / user_agent.html
═══════════════════════════════════════ */
.info-wrap { box-shadow: var(--sh) !important; border: 1px solid var(--line) !important; }
.info-title { color: var(--ink) !important; font-weight: 700 !important; letter-spacing: -0.01em; }
.info-sub { color: var(--ink-2) !important; }
.info-table th {
  background: var(--bg) !important;
  color: var(--ink-2) !important;
  border-bottom: 1px solid var(--line) !important;
}
.info-table td { color: var(--ink) !important; border-bottom: 1px solid var(--line) !important; }
.copy-btn {
  color: var(--ink-2) !important;
  background: var(--paper) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 7px !important;
  font-weight: 500;
}
.copy-btn:hover { background: var(--ink) !important; color: #fff !important; border-color: var(--ink) !important; }
.copy-all-btn,
.copy-ua-btn {
  color: #fff !important;
  background: var(--ink) !important;
  border: none !important;
  border-radius: var(--r-1) !important;
  font-weight: 600;
  box-shadow: none !important;
  transition: background var(--t1) var(--ease) !important;
}
.copy-all-btn:hover,
.copy-ua-btn:hover { opacity: 1 !important; background: #000 !important; }
.ua-box {
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-2) !important;
  color: var(--ink) !important;
}
.toast {
  background: var(--ink) !important;
  border: none !important;
  border-radius: var(--r-1) !important;
  font-weight: 500;
}

/* ═══════════════════════════════════════
   ABOUT / CONTACT PAGES
═══════════════════════════════════════ */
.content-page {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.page-lead {
  text-align: center;
  margin-bottom: 4px;
}
.page-lead h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}
.page-lead p {
  margin-top: 12px;
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--ink-2);
}

/* feature blocks (about) */
.feature {
  display: flex;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 18px 20px;
  box-shadow: var(--sh-sm);
}
.feature .fnum {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
}
.feature h3 { font-size: 0.98rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.feature p { font-size: 0.88rem; line-height: 1.65; color: var(--ink-2); }

/* contact card */
.contact-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 28px 24px;
  box-shadow: var(--sh-sm);
  text-align: center;
}
.contact-card .ct-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.contact-card .ct-email {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  word-break: break-all;
}
.contact-card .ct-note {
  margin-top: 18px;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--ink-3);
}
.page-back { text-align: center; margin-top: 8px; }

/* RTL (Arabic) */
[dir="rtl"] .feature { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .lang-select {
  background-position: left 9px center;
  padding: 7px 11px 7px 28px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 480px) {
  body { padding: 0 14px 64px; }
  .hero { margin: 36px 0 24px; }
  .hero h1 { font-size: 1.4rem; }
  .calc-form, .calc-result { padding: 20px; }
}
