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

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

:root {
  --bg: #05060f;
  --surface: rgba(255,255,255,0.025);
  --surface-hover: rgba(255,255,255,0.05);
  --glass: rgba(15,16,28,0.7);
  --border: rgba(255,255,255,0.06);
  --border-glow: rgba(255,255,255,0.12);
  --text: #e4e6f0;
  --text-dim: #7a7d8f;
  --text-muted: #4a4d5f;
  --cyan: #06b6d4;
  --purple: #a855f7;
  --pink: #ec4899;
  --emerald: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Animated background blobs ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.4;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(6,182,212,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 75% 30%, rgba(168,85,247,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 80%, rgba(236,72,153,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 90% 50% at 85% 85%, rgba(6,182,212,0.06) 0%, transparent 50%);
  animation: blobFloat 20s ease-in-out infinite alternate;
}

@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-15px, 10px) scale(1.05); }
  66% { transform: translate(10px, -8px) scale(0.98); }
  100% { transform: translate(-5px, -12px) scale(1.03); }
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5,6,15,0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding: 0 24px;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo:hover { filter: brightness(1.2); }

nav { display: flex; gap: 6px; }

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

nav a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* ── Flash ── */
.flash {
  background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(168,85,247,0.15));
  border-bottom: 1px solid rgba(6,182,212,0.2);
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.3s ease, fadeOut 0.5s ease 3.5s forwards;
}

@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ── Main ── */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  width: 100%;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero h1 {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 50%, var(--pink) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.hero p {
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Features grid ── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* ── Glass card ── */
.feature-card, .form-container, .section, .text-page .section {
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 8px 32px rgba(6,182,212,0.08);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.feature-card p { color: var(--text-dim); font-size: 14px; line-height: 1.65; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  font-family: inherit;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #fff;
  box-shadow: 0 2px 12px rgba(16,185,129,0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(16,185,129,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-glow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  box-shadow: 0 2px 12px rgba(6,182,212,0.3);
}

.btn-accent:hover {
  box-shadow: 0 4px 24px rgba(168,85,247,0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.25);
  border-color: rgba(239,68,68,0.5);
  box-shadow: 0 0 16px rgba(239,68,68,0.15);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.btn-outline:hover {
  border-color: var(--border-glow);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 15px 32px; font-size: 16px; border-radius: 12px; }

/* ── Forms ── */
.form-container { max-width: 460px; margin: 40px auto; }

.form-container h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 26px;
  font-weight: 700;
}

.main-form { display: flex; flex-direction: column; gap: 16px; }

.main-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: -12px;
}

.main-form input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.main-form input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.12);
  background: rgba(255,255,255,0.05);
}

.main-form input::placeholder { color: var(--text-muted); }

.main-form button { margin-top: 8px; }

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -10px;
  line-height: 1.5;
}

.form-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-dim);
}

.form-footer a { color: var(--cyan); font-weight: 600; }

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.inline-form input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(6,182,212,0.1);
}

.inline-form label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Dashboard ── */
.dashboard h2 { font-size: 28px; font-weight: 800; margin-bottom: 24px; }

.info-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.info-label { color: var(--text-dim); font-size: 13px; min-width: 150px; font-weight: 500; }
.info-value { font-size: 14px; font-weight: 500; }

code {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  word-break: break-all;
  color: var(--text-dim);
}

/* ── Key section ── */
.key-section {
  border: 1px solid rgba(6,182,212,0.2);
  background: linear-gradient(135deg, rgba(6,182,212,0.04), rgba(168,85,247,0.04));
  animation: keyPulse 3s ease-in-out infinite;
}

@keyframes keyPulse {
  0%, 100% { border-color: rgba(6,182,212,0.2); }
  50% { border-color: rgba(168,85,247,0.35); }
}

.key-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 6px;
}

.key-section .hint { color: var(--text-dim); margin: 0 0 12px; font-size: 13px; }

.key-copy {
  display: flex;
  gap: 10px;
}

.key-copy input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--cyan);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  word-break: break-all;
  cursor: text;
  transition: all 0.2s ease;
}

.key-copy input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}

/* ── Sections ── */
.section { margin-top: 20px; }

.section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.stat-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--border-glow);
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.admin-stats { margin-bottom: 8px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: 12px; }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr { transition: background 0.15s ease; }

.table tbody tr:hover { background: rgba(255,255,255,0.02); }

.table .actions { white-space: nowrap; display: flex; gap: 6px; }

.edit-row td {
  padding: 14px;
  background: rgba(255,255,255,0.01);
}

.empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 14px;
}

.table code {
  background: rgba(6,182,212,0.08);
  border-color: rgba(6,182,212,0.15);
  color: var(--cyan);
  font-size: 11px;
}

/* ── Text pages ── */
.text-page h2 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }

.text-page p { color: var(--text-dim); line-height: 1.75; margin-bottom: 12px; font-size: 14px; }

.text-page ul { padding-left: 22px; margin-bottom: 12px; }
.text-page li { color: var(--text-dim); line-height: 1.75; font-size: 14px; }
.text-page strong { color: var(--text); font-weight: 600; }

.download-options { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Settings info ── */
.settings-info { display: flex; flex-direction: column; gap: 6px; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: rgba(5,6,15,0.5);
  backdrop-filter: blur(8px);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .hero h1 { font-size: 36px; letter-spacing: -1px; }
  .hero { padding: 50px 0 30px; }
  .hero p { font-size: 15px; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn { width: 100%; }
  .features { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input { min-width: auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .info-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  nav { gap: 2px; }
  nav a { font-size: 12px; padding: 5px 8px; }
  .header-inner { padding: 0 12px; }
  main { padding: 24px 12px 40px; }
  .key-copy { flex-direction: column; }
  .key-section .btn { width: 100%; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 28px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Home layout ── */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
  margin-top: 20px;
}

.home-register .section {
  padding: 32px;
}

.home-register .section h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

.home-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-side .section {
  padding: 24px;
}

.home-side .section h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

@media (max-width: 800px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
}
