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

:root {
  --indigo-50: #eef2ff; --indigo-100: #e0e7ff; --indigo-200: #c7d2fe;
  --indigo-400: #818cf8; --indigo-600: #4f46e5; --indigo-700: #4338ca;
  --purple-50: #faf5ff; --purple-100: #f3e8ff; --purple-600: #9333ea;
  --pink-50: #fdf2f8; --pink-100: #fce7f3; --pink-600: #db2777;
  --green-50: #f0fdf4; --green-100: #dcfce7; --green-600: #16a34a; --green-700: #15803d;
  --amber-100: #fef3c7; --amber-600: #d97706;
  --red-50: #fef2f2; --red-100: #fee2e2; --red-200: #fecaca; --red-600: #dc2626; --red-700: #b91c1c;
  --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb;
  --gray-400: #9ca3af; --gray-500: #6b7280; --gray-600: #4b5563;
  --gray-700: #374151; --gray-900: #111827;
  --white: #ffffff;
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  --radius: 0.75rem;
  --radius-full: 9999px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page-bg {
  background: linear-gradient(135deg, var(--indigo-50) 0%, var(--purple-50) 50%, var(--pink-50) 100%);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Typography ───────────────────────────────── */
h1 { font-family: 'Fraunces', serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-family: 'Fraunces', serif; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.3; }

/* ── Layout ───────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 1.5rem; }
.container-md { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.text-center { text-align: center; }

.grid { display: grid; gap: 2rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ── Card ─────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: none;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.card-body { padding: 1.5rem; }
.card-body-lg { padding: 2rem; }

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.5rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.95rem;
  border: 2px solid transparent; cursor: pointer; transition: all 0.2s;
  font-family: inherit; text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--indigo-600); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--indigo-700); }
.btn-outline { background: transparent; border-color: var(--gray-200); color: var(--gray-700); }
.btn-outline:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-400); }
.btn-ghost { background: transparent; color: var(--gray-600); padding: 0.5rem 1rem; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--red-600); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: var(--red-700); }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ── Form Elements ────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-label { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); }
.form-hint { font-size: 0.75rem; color: var(--gray-500); }
.form-input {
  padding: 0.65rem 0.85rem; border: 1px solid var(--gray-200); border-radius: 0.5rem;
  font-size: 0.95rem; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
}
.form-input:focus { outline: none; border-color: var(--indigo-400); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.form-input-lg { padding: 0.85rem 1rem; font-size: 1rem; }

textarea.form-input { resize: vertical; min-height: 80px; }

.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--indigo-600); }
.checkbox-row label { font-size: 0.875rem; }

/* ── Badges ───────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 0.15rem 0.6rem; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
}
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-amber { background: var(--amber-100); color: var(--amber-600); border: 1px solid var(--amber-600); }
.badge-pink { background: var(--pink-100); color: var(--pink-600); border: 1px solid var(--pink-600); }
.badge-indigo { background: var(--indigo-100); color: var(--indigo-600); }

/* ── Alert ────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.85rem 1rem;
  border-radius: 0.5rem; font-size: 0.875rem; margin-bottom: 1rem;
}
.alert-error { background: var(--red-50); color: var(--red-700); border: 1px solid var(--red-200); }
.alert-success { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }
.alert svg { flex-shrink: 0; margin-top: 2px; }

/* ── Icon Circle ──────────────────────────────── */
.icon-circle {
  width: 3rem; height: 3rem; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-circle-lg { width: 4rem; height: 4rem; }
.icon-circle-xl { width: 5rem; height: 5rem; }
.bg-indigo { background: var(--indigo-100); color: var(--indigo-600); }
.bg-purple { background: var(--purple-100); color: var(--purple-600); }
.bg-pink { background: var(--pink-100); color: var(--pink-600); }
.bg-green { background: var(--green-100); color: var(--green-600); }

/* ── Step Circle ──────────────────────────────── */
.step-circle {
  width: 3rem; height: 3rem; border-radius: var(--radius-full);
  background: var(--indigo-600); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; margin: 0 auto 1rem;
}

/* ── Table ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; padding: 0.75rem 1rem; font-weight: 600; color: var(--gray-500); border-bottom: 2px solid var(--gray-200); }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-100); }
tr:hover td { background: var(--gray-50); }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.85em; }

/* ── Tabs ─────────────────────────────────────── */
.tabs { display: flex; gap: 0.25rem; background: rgba(255,255,255,0.7); border-radius: 0.5rem; padding: 0.25rem; flex-wrap: wrap; }
.tab-btn {
  padding: 0.5rem 1rem; border-radius: 0.375rem; border: none; background: transparent;
  font-weight: 500; cursor: pointer; font-size: 0.875rem; font-family: inherit;
  color: var(--gray-600); transition: all 0.2s;
}
.tab-btn.active { background: var(--white); color: var(--gray-900); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* ── Section Spacing ──────────────────────────── */
.section { padding: 4rem 1.5rem; }
.section-white { background: rgba(255,255,255,0.5); }

/* ── Footer ───────────────────────────────────── */
.footer {
  padding: 2rem 1.5rem; border-top: 1px solid var(--gray-200);
}
.footer p, .footer button { font-size: 0.875rem; color: var(--gray-500); }
.footer button { background: none; border: none; cursor: pointer; font-family: inherit; }
.footer button:hover { color: var(--indigo-600); }

/* ── CTA Gradient Card ────────────────────────── */
.cta-gradient {
  background: linear-gradient(135deg, var(--indigo-600), var(--purple-600));
  color: var(--white); border-radius: var(--radius); padding: 2.5rem; text-align: center;
}
.cta-gradient h2 { color: var(--white); }
.cta-gradient p { color: rgba(255,255,255,0.8); }

/* ── Pseudonym Display ────────────────────────── */
.pseudonym-display {
  background: var(--indigo-50); border-radius: var(--radius); padding: 1.5rem; text-align: center;
}
.pseudonym-display .pseudo-value {
  font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; font-weight: 700;
  color: var(--indigo-700); margin-top: 0.5rem;
}

/* ── Stat Card ────────────────────────────────── */
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--gray-500); }

/* ── Danger Zone ──────────────────────────────── */
.danger-zone {
  background: var(--red-50); border: 1px solid var(--red-200); border-radius: var(--radius);
  padding: 1.25rem;
}
.danger-zone p { color: var(--red-700); font-weight: 500; margin-bottom: 1rem; }

/* ── Admin Editor ─────────────────────────────── */
.editor-grid { display: grid; gap: 1rem; }
.editor-grid .form-group label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); }

/* ── Image Gallery ────────────────────────────── */
.img-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.img-card { position: relative; border-radius: 0.5rem; overflow: hidden; aspect-ratio: 1; background: var(--gray-100); }
.img-card img { width: 100%; height: 100%; object-fit: cover; }
.img-card .img-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 0.75rem;
  opacity: 0; transition: opacity 0.2s;
}
.img-card:hover .img-overlay { opacity: 1; }
.img-card .img-overlay span { color: var(--white); font-size: 0.8rem; font-weight: 500; }

/* ── Hidden ───────────────────────────────────── */
.hidden { display: none !important; }

/* ── Animations ───────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.slide-up { animation: slideUp 0.5s ease-out; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 2.5rem 1rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
}

/* ── Loading spinner ──────────────────────────── */
.spinner {
  width: 1.2rem; height: 1.2rem; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white); border-radius: 50%;
  animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
