:root {
  --bg: #f7f7f7;
  --bg-spot: #ffffff;
  --bg-deep: #ededed;
  --ink: #0c0c0c;
  --muted: #5c5c5c;
  --accent: #d8172a;
  --accent-strong: #a10e1f;
  --accent-warm: #ff9aa4;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --border: #e0e0e0;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  --overlay: rgba(0, 0, 0, 0.7);
  --overlay-spot: rgba(216, 23, 42, 0.35);
  --radius: 18px;
}

[data-theme="dark"] {
  --bg: #0b0b0b;
  --bg-spot: #1a1a1a;
  --bg-deep: #040404;
  --ink: #f5f5f5;
  --muted: #b5b5b5;
  --accent: #ff3348;
  --accent-strong: #ff0f2e;
  --accent-warm: #ff7a85;
  --surface: #151515;
  --surface-2: #1f1f1f;
  --border: #2b2b2b;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  --overlay: rgba(0, 0, 0, 0.85);
  --overlay-spot: rgba(255, 51, 72, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(
    circle at top,
    var(--bg-spot) 0%,
    var(--bg) 45%,
    var(--bg-deep) 100%
  );
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

body.page-loaded {
  animation: pageIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.page-exit {
  animation: pageOut 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(
      circle at 20% 10%,
      var(--overlay-spot) 0%,
      transparent 55%
    ),
    var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  z-index: 50;
}

body.page-exit .page-overlay {
  opacity: 1;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.mono {
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.55;
  z-index: 0;
  animation: float 10s ease-in-out infinite;
}

.orb-1 {
  width: 240px;
  height: 240px;
  background: rgba(216, 23, 42, 0.18);
  top: -60px;
  left: -40px;
}

.orb-2 {
  width: 220px;
  height: 220px;
  background: rgba(255, 154, 164, 0.25);
  top: 120px;
  right: -60px;
  animation-delay: -3s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: rgba(216, 23, 42, 0.12);
  bottom: 40px;
  left: 40%;
  animation-delay: -6s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(14px);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 7vw;
  background: rgba(247, 247, 247, 0.85);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .site-header {
  background: rgba(11, 11, 11, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
}

.brand-dot {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(216, 23, 42, 0.18);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(216, 23, 42, 0.12);
}

.nav-cta {
  color: #fff;
  background: var(--accent);
}

.nav-cta:hover {
  background: var(--accent-strong);
  color: #fff;
}

.nav-ghost {
  border: 1px dashed var(--border);
  background: transparent;
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  padding: 40px 7vw 10px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s ease both;
}

.hero-copy h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 12px 0 16px;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.hero-lead {
  font-size: 1.05rem;
  max-width: 520px;
}

.hero-actions {
  margin: 20px 0 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.user-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 360px;
}

.user-pill-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.hero-panel {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: fadeUp 0.9s ease both;
  animation-delay: 0.2s;
}

.panel-title {
  font-weight: 600;
  margin-bottom: 16px;
}

.panel-grid {
  display: grid;
  gap: 12px;
}

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

.info-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.info-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(216, 23, 42, 0.15);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.8rem;
}

[data-theme="dark"] .badge {
  background: rgba(255, 51, 72, 0.2);
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.section {
  padding: 40px 7vw;
  position: relative;
  z-index: 1;
  animation: fadeUp 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.section-focus::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: sectionGlow 0.8s ease;
  pointer-events: none;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.7rem;
  margin-bottom: 6px;
}

.tag {
  font-size: 0.8rem;
  background: rgba(216, 23, 42, 0.12);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
}

.mods-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mod-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mod-name {
  font-weight: 600;
}

.mod-actions {
  margin-top: auto;
}

.community-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.community-card {
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.community-title {
  font-size: 0.85rem;
  color: var(--muted);
}

.community-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.community-link {
  color: var(--accent);
  font-weight: 600;
}

.site-footer {
  padding: 24px 7vw 40px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.mod-card,
.panel-block,
.auth-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mod-card:hover,
.panel-block:hover,
.auth-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.18);
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button.full {
  width: 100%;
}

.button:disabled,
.button.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-body,
.admin-body {
  background: radial-gradient(
    circle at top right,
    var(--bg-spot) 0%,
    var(--bg) 55%,
    var(--bg-deep) 100%
  );
}

.auth-wrap,
.admin-wrap {
  padding: 80px 7vw;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 32px;
  max-width: 560px;
}

.auth-header h1 {
  margin-bottom: 8px;
}

.auth-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3));
}

.admin-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.back-link {
  display: inline-block;
  margin-bottom: 0;
  color: var(--muted);
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 23, 42, 0.2);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.required {
  color: var(--accent);
}

.form-note {
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--surface-2);
  padding: 12px;
  border-radius: 12px;
}

.form-footer {
  font-size: 0.9rem;
  color: var(--muted);
}

.form-footer.split {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-message {
  margin-top: 18px;
  font-weight: 600;
  color: var(--accent-strong);
}

.admin-panel {
  display: grid;
  gap: 24px;
}

.admin-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel-block {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-block h3 {
  margin-bottom: 12px;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-2);
  display: grid;
  gap: 10px;
}

.list-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

.data-table th {
  background: var(--surface-2);
}

.hidden {
  display: none;
}

.admin-gate {
  max-width: 520px;
}

.section-action {
  display: flex;
  align-items: center;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes pageOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
    filter: blur(6px);
  }
}

@keyframes sectionGlow {
  0% {
    opacity: 0;
    transform: scale(0.97);
  }
  45% {
    opacity: 0.7;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body.page-loaded,
  body.page-exit {
    animation: none;
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .site-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 20px;
  }
  .auth-card {
    padding: 24px;
  }
  .site-footer {
    flex-direction: column;
  }
}
