* { box-sizing: border-box; }

:root {
  --bg: #0f1420;
  --card: #171e2e;
  --card-2: #1d2639;
  --border: #2a3550;
  --text: #e8ecf5;
  --muted: #8b96ad;
  --accent: #4f7cff;
  --accent-hover: #3b66e8;
  --danger: #e5484d;
  --success: #46c07a;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: normal; }
.error { color: var(--danger); }
.success { color: var(--success); }

/* ---------- login ---------- */

#login-view {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px 60px;
}

.landing { width: 100%; max-width: 860px; }

.landing-hero { text-align: center; margin-bottom: 24px; }
.landing-hero h1 { font-size: 34px; margin: 0 0 4px; }
.landing-tagline { color: var(--accent); font-weight: 600; margin: 0 0 14px; }

.landing-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  max-width: 620px;
  margin: 0 auto 18px;
}

.landing-sub b { color: var(--text); }
.landing-hero .hero-badges { justify-content: center; }

.landing-prices { max-width: none; margin-bottom: 24px; }
.landing-prices h2 { font-size: 17px; }

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.showcase-item {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plat-icon { width: 16px; height: 16px; flex-shrink: 0; object-fit: contain; }

.showcase-item .sc-head,
.platform-item .pf-head { display: flex; align-items: center; gap: 8px; }

.showcase-item .sc-label { font-size: 13.5px; font-weight: 600; }
.showcase-item .sc-price { font-size: 17px; font-weight: 700; color: var(--accent); }
.showcase-item .sc-price small { font-size: 12px; color: var(--muted); font-weight: 400; }

.landing-more { font-size: 13px; line-height: 1.7; margin: 0 0 14px; }

.landing-platforms { max-width: none; margin-bottom: 24px; }
.landing-platforms h2 { font-size: 17px; }

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.platform-item {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pf-name { font-size: 13.5px; font-weight: 600; }
.pf-meta { font-size: 12px; color: var(--muted); }

/* 구독형 섹션 */
.landing-sub-card { max-width: none; margin-bottom: 24px; }
.landing-sub-card h2 { font-size: 17px; }

.sub-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.sub-step {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.sub-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f7cff, #8b5cf6);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sub-step strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.sub-step p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.landing-sub-card a { color: var(--accent); font-weight: 600; text-decoration: none; }

.site-footer {
  margin: 34px auto 0;
  padding: 22px 10px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 2;
}

.site-footer a { color: var(--accent); text-decoration: none; }

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-card p.muted { margin-top: 0; }

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

/* ---------- logo ---------- */

.logo { display: inline-flex; align-items: center; gap: 9px; }

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f7cff 0%, #8b5cf6 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 2px 10px rgba(79, 124, 255, .35);
  flex-shrink: 0;
}

.logo-word {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .04em;
  color: var(--text);
}

.logo-word em {
  font-style: normal;
  background: linear-gradient(135deg, #4f7cff, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-md { margin-bottom: 6px; }
.logo-md .logo-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 21px; }
.logo-md .logo-word { font-size: 24px; }

.logo-xl { justify-content: center; margin-bottom: 10px; }
.logo-xl .logo-mark { width: 54px; height: 54px; border-radius: 15px; font-size: 30px; }
.logo-xl .logo-word { font-size: 38px; }

.brand-sub { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 6px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.chip {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  white-space: nowrap;
}

.banner {
  background: #3a2b12;
  border: 1px solid #8a6d1f;
  color: #f0d48a;
  padding: 10px 24px;
  font-size: 14px;
}

.banner code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; }

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 6px;
  padding: 14px 24px 0;
}

.tab {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
}

.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- layout / cards ---------- */

main { padding: 20px 24px 60px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  max-width: 1100px;
}

#tab-order .card { max-width: 620px; }

.card h2 { margin: 0 0 16px; font-size: 18px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-head h2 { margin: 0; }

/* ---------- forms ---------- */

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; font-family: inherit; }

.card-head input { width: 240px; margin: 0; }

.row { display: flex; gap: 12px; }
.row label { flex: 1; }

.service-info {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* ---------- buttons ---------- */

.btn {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); width: 100%; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--danger); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th { color: var(--muted); font-weight: 600; }

.link-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.link-cell a { color: var(--accent); text-decoration: none; }

.actions { display: flex; gap: 6px; }

.status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
}

.status-completed { color: var(--success); border-color: var(--success); }
.status-in-progress, .status-pending, .status-processing { color: #f0d48a; border-color: #8a6d1f; }
.status-partial { color: #f0a35a; border-color: #a06a2a; }
.status-canceled, .status-cancelled, .status-error { color: var(--danger); border-color: var(--danger); }

/* ---------- auth tabs / signup ---------- */

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
  border-radius: 7px;
  cursor: pointer;
}

.auth-tab.active { background: var(--accent); color: #fff; }

.login-contact { font-size: 13px; text-align: center; margin: 18px 0 0; }
.login-contact a { color: var(--accent); text-decoration: none; }

/* ---------- top-up ---------- */

.btn.topup { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn.topup:hover { background: var(--accent); color: #fff; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.modal-box h3 { margin: 0 0 10px; font-size: 19px; }
.modal-box p { font-size: 14px; line-height: 1.7; color: var(--text); }
.modal-box .btn.primary { display: block; text-decoration: none; margin: 16px 0 6px; }
.modal-box .small { font-size: 12.5px; }
.modal-box .btn.ghost { margin-top: 8px; }

/* ---------- admin ---------- */

.credit-cell { display: flex; gap: 6px; align-items: center; }
.credit-cell input { width: 120px; margin: 0; padding: 6px 8px; font-size: 13px; }

/* ---------- services (FiveBBC-style) ---------- */

.hero-card {
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1a2340 0%, var(--card) 60%);
}

.hero-card h2 { font-size: 22px; margin-bottom: 8px; }

.hero-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 18px;
  max-width: 720px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  max-width: 640px;
}

.stat {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat strong { font-size: 18px; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }

.bulk-note {
  margin: 16px 0 0;
  padding: 11px 14px;
  background: rgba(79, 124, 255, .08);
  border: 1px solid rgba(79, 124, 255, .35);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.6;
}

.bulk-note a { color: var(--accent); font-weight: 600; text-decoration: none; }
.field-hint a { color: var(--accent); font-weight: 600; text-decoration: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}

.pill:hover { border-color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); }
.pill-count { color: rgba(255,255,255,.55); font-size: 12px; margin-left: 2px; }
.pill:not(.active) .pill-count { color: var(--muted); }

/* 카테고리 아코디언 */
.svc-cat {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
  overflow: hidden;
}

.svc-cat summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
  user-select: none;
}

.svc-cat summary::-webkit-details-marker { display: none; }

.svc-cat summary::before {
  content: '▸';
  color: var(--muted);
  margin-right: 4px;
  transition: transform .15s;
}

.svc-cat[open] summary::before { transform: rotate(90deg); }
.svc-cat summary:hover { background: rgba(79, 124, 255, .07); }

.svc-cat-name { flex: 1; }

.svc-cat-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
}

.svc-cat .table-wrap {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 0 8px;
}

.svc-table tbody tr { transition: background .1s; }
.svc-table tbody tr:hover { background: rgba(79, 124, 255, .06); }
.svc-table tbody tr:last-child td { border-bottom: none; }

.svc-table td { white-space: normal; }
.svc-id { color: var(--muted); white-space: nowrap; }
.svc-name { min-width: 260px; }
.svc-name > div:first-child { font-weight: 600; margin-bottom: 5px; font-size: 13.5px; }
.svc-rate { white-space: nowrap; font-weight: 700; color: var(--accent); font-size: 14px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }

.chip-tag {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  white-space: nowrap;
}

.chip-tag.ok { color: var(--success); border-color: rgba(70, 192, 122, .5); }
.chip-tag.warn { color: #e8a15a; border-color: rgba(232, 161, 90, .5); }
.chip-tag.time { color: #6ea8ff; border-color: rgba(110, 168, 255, .5); }
.chip-tag.speed { color: #b48cff; border-color: rgba(180, 140, 255, .5); }
.chip-tag.custom { color: #ff9ecd; border-color: rgba(255, 158, 205, .5); }

/* 용어 가이드 */
.guide-card { margin-bottom: 16px; padding: 0; }

.guide-card summary {
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.guide-card summary::-webkit-details-marker { display: none; }
.guide-card summary:hover { color: var(--accent); }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 24px 22px;
}

.guide-item {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.guide-item strong { display: block; margin-bottom: 6px; font-size: 14px; }
.guide-item p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--muted); }
.guide-item em { color: var(--text); font-style: normal; font-weight: 600; }

/* 주문 폼 도움말 */
.field-hint {
  display: block;
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.6;
}

.field-hint b { color: var(--text); }

.svc-note {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255, 158, 205, .08);
  border: 1px solid rgba(255, 158, 205, .3);
  border-radius: 8px;
  color: var(--text);
}

.btn.primary-outline {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
}

.btn.primary-outline:hover { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
  .row { flex-direction: column; gap: 0; }
  main { padding: 16px 12px 40px; }
  .card { padding: 16px; }
  .topbar { flex-wrap: wrap; padding: 12px 14px; gap: 8px; }
  .brand-sub { display: none; }
  .topbar-right { width: 100%; justify-content: flex-end; gap: 8px; }
  .topbar-right .btn { padding: 8px 12px; font-size: 13px; }
  .chip { font-size: 13px; padding: 6px 12px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding: 10px 12px 0; }
  .tab { white-space: nowrap; }
  .login-card { padding: 26px 20px; }
  .landing-hero h1 { font-size: 28px; }
  .card-head input { width: 100%; }
  .svc-name { min-width: 200px; }
}
