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

:root {
  --bg: #0D1117;
  --surface: #141B24;
  --surface-2: #1B2431;
  --border: #2A3441;
  --border-strong: #3A4759;
  --text: #E3E8EF;
  --muted: #8A94A6;
  --accent: #4C8BF5;
  --accent-text: #0B1220;
  --accent-2: #E8A33D;
  --ok: #3FBF7F;
  --gold: #D4AF37;
  --danger: #E5584D;
  --radius: 3px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans KR', -apple-system, sans-serif;
  --display: 'Sora', 'IBM Plex Sans KR', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Header / Nav ---------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo:hover { text-decoration: none; }
.dot { width: 8px; height: 8px; background: var(--ok); border-radius: 50%; display: inline-block; }

.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.main-nav a.active { color: var(--text); border-bottom: 2px solid var(--accent); }

.nav-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nav-user span { color: var(--muted); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { filter: brightness(0.88); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero .container { padding-top: 88px; padding-bottom: 88px; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-2);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 5.2vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 760px;
  margin: 0 0 20px;
}

.hero h1 .line, .hero p.lead .line { display: block; white-space: nowrap; }

.hero p.lead {
  color: var(--muted);
  font-size: clamp(0.8rem, 2.3vw, 17px);
  max-width: 720px;
  margin: 0 0 32px;
}

.hero-actions { display: flex; gap: 12px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 64px;
}
.hero-stats div {
  background: var(--bg);
  padding: 20px 22px;
}
.hero-stats .num {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
}
.hero-stats .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------------- Sections ---------------- */
.section { padding: 72px 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }

.section-head { margin-bottom: 40px; max-width: 640px; }
.section-head h2 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.section-head p { color: var(--muted); margin: 0; }

/* ---------------- Product (rack-unit) panels ---------------- */
.rack {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}
.rack-unit {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.rack-unit:last-child { border-bottom: none; }

.rack-unit .u-name { font-weight: 700; font-size: 16.5px; }
.rack-unit .u-cat { font-family: var(--mono); font-size: 12px; color: var(--accent-2); margin-top: 4px; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.spec-grid .val { color: var(--text); display: block; font-size: 14px; margin-top: 2px; }

.u-price { text-align: right; white-space: nowrap; }
.u-price .krw { font-family: var(--mono); font-size: 19px; font-weight: 500; color: var(--text); }
.u-price .per { color: var(--muted); font-size: 12px; }

@media (max-width: 860px) {
  .rack-unit { grid-template-columns: 1fr; }
  .u-price { text-align: left; }
}

/* ---------------- Product price tables (상품소개) ---------------- */
.cat-block { margin-bottom: 44px; }
.cat-title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.cat-note {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-2);
  margin: 0 0 14px;
  padding-left: 15px;
}

table.price-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
}
table.price-table thead th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
table.price-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  vertical-align: top;
}
table.price-table tbody tr:last-child td { border-bottom: none; }
table.price-table tbody tr:hover td { background: var(--surface); }
table.price-table td.p-name { font-weight: 600; white-space: nowrap; }
table.price-table td.p-detail { color: var(--muted); }
table.price-table th:last-child, table.price-table td.price {
  text-align: right;
  white-space: nowrap;
}
table.price-table td.price {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
}

@media (max-width: 680px) {
  table.price-table, table.price-table thead, table.price-table tbody, table.price-table th, table.price-table td, table.price-table tr {
    display: block;
  }
  table.price-table thead { display: none; }
  table.price-table tr { border-bottom: 1px solid var(--border); padding: 14px 18px; }
  table.price-table td { border-bottom: none; padding: 3px 0; }
  table.price-table td.price { text-align: left; margin-top: 6px; }
}

/* ---------------- Notices (공지사항) ---------------- */
.notice-row {
  display: block;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.notice-row:last-child { border-bottom: none; }
.notice-row:hover { background: var(--surface-2); text-decoration: none; }
.notice-row-title { color: var(--text); font-size: 15px; }
.notice-row-date { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.notice-pinned-title { color: var(--gold); font-weight: 700; }

.notice-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.notice-detail-body { white-space: pre-wrap; line-height: 1.8; font-size: 15.5px; }

/* ---------------- Web hosting plan accordion ---------------- */
.plan-accordion {
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 12px;
}
.plan-accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}
.plan-accordion summary::-webkit-details-marker { display: none; }
.plan-accordion summary::after {
  content: '+';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  color: var(--muted);
  font-size: 20px;
}
.plan-accordion[open] summary::after { content: '\2212'; }
.plan-accordion summary:hover { background: var(--surface-2); }
.plan-accordion-name { font-family: var(--display); font-weight: 700; font-size: 17px; }
.plan-accordion-sub { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.plan-accordion-body { padding: 0 24px 24px; border-top: 1px solid var(--border); }
.plan-accordion-body table.data { margin-top: 18px; }

/* ---------------- Steps (이용절차 - 실제 순서가 있으므로 번호 사용) ---------------- */
.steps { display: flex; flex-direction: column; }
.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step .idx {
  font-family: var(--mono);
  font-size: 22px;
  color: var(--accent);
  border-right: 1px solid var(--border);
  padding-right: 20px;
}
.step h3 { margin: 0 0 8px; font-size: 18px; font-family: var(--display); font-weight: 700; }
.step p { margin: 0; color: var(--muted); }

/* ---------------- Cards (FAQ / info) ---------------- */
.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 28px;
}

.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item .q { font-weight: 600; margin-bottom: 8px; display: flex; gap: 10px; }
.faq-item .q .tag { font-family: var(--mono); color: var(--accent); }
.faq-item .a { color: var(--muted); margin: 0; padding-left: 30px; }

/* ---------------- Forms ---------------- */
.form-wrap { max-width: 480px; margin: 0 auto; }
.form-wrap.wide { max-width: 640px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field .hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

input[type=text], input[type=password], input[type=email], input[type=tel], textarea, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 140px; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row-2 { grid-template-columns: 1fr; } }

/* ---------------- Alerts ---------------- */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 14.5px;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); color: var(--danger); }
.alert-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: var(--ok); color: var(--ok); }

/* ---------------- Tables (admin) ---------------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table.data th {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: none;
  font-weight: 500;
}
table.data tr:hover td { background: var(--surface); }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
}
.badge-active { color: var(--ok); border-color: var(--ok); }
.badge-inactive { color: var(--muted); }
.badge-pending { color: var(--accent-2); border-color: var(--accent-2); }
.badge-answered { color: var(--ok); border-color: var(--ok); }

/* ---------------- Admin layout ---------------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 69px); }
.admin-side {
  border-right: 1px solid var(--border);
  padding: 28px 0;
}
.admin-side a {
  display: block;
  padding: 11px 24px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
}
.admin-side a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.admin-side a.active { color: var(--text); background: var(--surface-2); border-right: 2px solid var(--accent); }
.admin-main { padding: 40px; }
.admin-main h1 { font-family: var(--display); font-size: 24px; margin: 0 0 28px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-bottom: 36px; }
.stat-row .stat { background: var(--bg); padding: 22px; }
.stat-row .stat .n { font-family: var(--mono); font-size: 28px; }
.stat-row .stat .l { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--muted);
  font-size: 13.5px;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (max-width: 720px) {
  .main-nav { display: none; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { border-right: none; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; padding: 0; }
  .admin-side a { white-space: nowrap; }
}
