:root {
  --bg-main: #050816;
  --bg-main-soft: #070b17;
  --bg-card: #0b1020;
  --bg-card-soft: #11172b;
  --accent: #3b82f6;
  --accent2: #22c55e;
  --accent-soft: #6366f1;
  --border-soft: #1f2937;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --success: #22c55e;
  --info: #0ea5e9;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-soft: 0 22px 60px rgba(0, 0, 0, 0.75);
}

/* ====== RESET ====== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, #111827 0, #050816 45%),
    radial-gradient(circle at bottom right, #020617 0, #020617 55%);
  color: var(--text-main);
  min-height: 100vh;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ====== GLOBAL LAYOUT ====== */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
}

.section {
  max-width: 1120px;
  margin: 40px auto 48px;
  padding: 0 20px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 18px;
}

/* ====== HEADER / NAV (SITE-HEADER ВНУТРІШНІ СТОРІНКИ) ====== */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(5, 8, 22, 0.98),
    rgba(5, 8, 22, 0.9),
    transparent
  );
  border-bottom: 1px solid rgba(55, 65, 81, 0.6);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.12em;
}

.logo span {
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 15px;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
}

.nav a:hover {
  color: var(--text-main);
}

.nav a.active,
.nav a.nav-link--active {
  color: var(--accent);
}

.nav a.active::after,
.nav a.nav-link--active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.auth-controls {
  display: flex;
  gap: 8px;
}

/* мобільна шапка */
@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .nav {
    flex-wrap: wrap;
    row-gap: 6px;
  }
}

/* ====== ГОЛОВНА: NAVBAR + HERO + FEATURES ====== */

/* navbar на головній (index) */
.navbar {
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 12px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* hero */
.hero {
  max-width: 1120px;
  margin: 40px auto 32px;
  padding: 0 20px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 14px;
}

.hero .subtitle {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 520px;
}

.hero-buttons {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* блок "переваги" */
.features {
  max-width: 1120px;
  margin: 0 auto 48px;
  padding: 0 20px;
}

.features h2 {
  font-size: 22px;
  margin: 0 0 16px;
}

.features-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-item {
  background: radial-gradient(circle at top left, #111827 0, #050816 70%);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  border: 1px solid rgba(249, 250, 251, 0.05);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
  font-size: 13px;
}

.feature-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

/* ====== CARDS / HERO GRID ====== */

.card {
  background: radial-gradient(circle at top left, #111827 0, #050816 70%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(249, 250, 251, 0.04);
  padding: 26px 26px 24px;
}

.card + .card {
  margin-top: 22px;
}

.card-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 10px;
}

.card-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.hero-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.9fr;
    align-items: stretch;
  }
}

/* більш світла друга карточка */
.hero-grid .card:nth-child(2) {
  background: var(--bg-card);
}

/* ====== BUTTONS ====== */

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out,
    filter 0.12s ease-out, background 0.12s ease-out;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  color: #020617;
  box-shadow: 0 14px 40px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 16px 42px rgba(37, 99, 235, 0.55);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.btn-ghost:hover {
  border-color: rgba(248, 250, 252, 0.8);
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.7);
}

.btn-secondary {
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-main);
}

.btn-secondary:hover {
  border-color: rgba(248, 250, 252, 0.9);
  background: rgba(15, 23, 42, 0.9);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-green {
  background: linear-gradient(135deg, #22c55e, #86efac);
  color: #022c22;
}

.btn-blue {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #020617;
}

.btn-red {
  background: linear-gradient(135deg, #ef4444, #fb7185);
  color: #fef2f2;
}

.btn:disabled {
  opacity: 0.65;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* ====== FORMS ====== */

.field-label {
  margin-top: 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.input,
.select,
textarea.input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid #1f2937;
  outline: none;
  background: #020617;
  color: var(--text-main);
  font-size: 14px;
  resize: vertical;
}

.input:focus,
.select:focus,
textarea.input:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
}

.input::placeholder,
textarea.input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

/* ====== STATUS / CODE ====== */

.status-box {
  margin-top: 18px;
  background: var(--bg-card-soft);
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid #1f2933;
  font-size: 14px;
}

.status-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.status-text.ok {
  color: var(--success);
}

.status-text.error {
  color: var(--danger);
}

.status-box.status-info {
  border-color: var(--info);
}

.status-box.status-success {
  border-color: var(--success);
}

.status-box.status-error {
  border-color: var(--danger);
}

.status-box.status-wait {
  border-color: var(--info);
}

/* код */

.code-box {
  margin-top: 10px;
  background: #020617;
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  font-size: 12px;
  white-space: pre-wrap;
}

/* ====== TEXT UTILS ====== */

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-32 {
  margin-top: 32px;
}

.space-y-12 > * + * {
  margin-top: 12px;
}

/* ====== TABLES / LISTS ====== */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
  text-align: left;
}

.table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}

.scroll-box {
  border-radius: 16px;
  background: #020617;
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(31, 41, 55, 0.95);
}

.list-item {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(55, 65, 81, 0.8);
  font-size: 13px;
}

.list-item:last-child {
  border-bottom: none;
}

.plain-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.plain-list li {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(55, 65, 81, 0.7);
  font-size: 13px;
}

.plain-list li:last-child {
  border-bottom: none;
}

/* ====== GRID HELPERS ====== */

.grid-2 {
  display: grid;
  gap: 18px;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-3 {
  display: grid;
  gap: 18px;
}

@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ====== AUTH / CABINET GRIDS ====== */

.auth-grid {
  display: grid;
  gap: 22px;
}

@media (min-width: 880px) {
  .auth-grid {
    grid-template-columns: 1.1fr 1fr;
  }
}

.cab-grid {
  display: grid;
  gap: 22px;
}

@media (min-width: 960px) {
  .cab-grid {
    grid-template-columns: 1.1fr 1.05fr;
  }
}

/* ====== BADGE ====== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.badge-primary {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #020617;
}

.badge-success {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.badge-secondary {
  background: rgba(148, 163, 184, 0.24);
  color: var(--text-main);
}

/* ====== ADMIN LAYOUT / TABS ====== */

.admin-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
  flex-wrap: wrap;
}

.tab-button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: var(--text-muted);
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.12s;
}

.tab-button.active {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent2));
  border-color: transparent;
  color: #020617;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 960px) {
  .admin-grid {
    grid-template-columns: 1.1fr 1fr;
  }
}

.admin-block {
  background: var(--bg-card-soft);
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 41, 55, 0.95);
}

/* статистичні цифри */
.stat-number {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
}

/* ====== FOOTER ====== */

.site-footer {
  border-top: 1px solid rgba(55, 65, 81, 0.7);
  padding: 16px 20px 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  background: #020617;
}

/* ====== CODE ELEMENT ====== */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}
