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

:root {
  --bg: #1a1a2e;
  --card: #16213e;
  --primary: #e94560;
  --accent: #f5a623;
  --text: #eaeaea;
  --text-muted: #9aa0b4;
  --online: #4caf50;
  --offline: #757575;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── 헤더 ── */
header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── 메인 컨텐츠 ── */
main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

/* ── 카드 그리드 ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255,255,255,0.05);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ── 뱃지 ── */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.badge-online {
  background: rgba(76,175,80,0.15);
  color: var(--online);
}

.badge-offline {
  background: rgba(117,117,117,0.15);
  color: var(--offline);
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.card-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-bottom: 1.25rem;
  font-family: monospace;
}

/* ── 버튼 ── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.12);
}

/* ── 폼 카드 (whitelist.html) ── */
.form-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 2rem;
}

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(255,255,255,0.05);
}

.form-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.form-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus {
  border-color: var(--primary);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
}

.back-link {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.back-link:hover { color: var(--text); }

/* ── 토스트 ── */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
  transition: transform 0.3s ease;
  z-index: 999;
}

#toast.show { transform: translateX(-50%) translateY(0); }
#toast.success { background: #1e3a2f; color: var(--online); border: 1px solid var(--online); }
#toast.error   { background: #3a1e1e; color: var(--primary); border: 1px solid var(--primary); }

/* ── 반응형 ── */
@media (max-width: 480px) {
  header { padding: 1rem 1.25rem; }
  main { padding: 0 1rem; }
  .form-card { padding: 1.75rem; }
}
