/* Современный тёмный дизайн с адаптивностью, плавными анимациями и скроллингом */

/* Базовые переменные темы */
:root {
  --bg0: #0b1020;              /* очень тёмный синий */
  --bg1: #0e1630;
  --text: #e6ebff;
  --muted: #aab3d1;
  --accent1: #4b6bff;
  --accent2: #9b4bff;
  --accent3: #ff4b8a;
  --card: rgba(255, 255, 255, 0.06);
  --card-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
  --radius: 18px;
}

/* Фон — тёмный градиент + движущиеся размытые круги */
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(155, 75, 255, 0.18), transparent 60%),
    radial-gradient(1000px 800px at 90% 20%, rgba(75, 107, 255, 0.18), transparent 60%),
    radial-gradient(1200px 1000px at 60% 90%, rgba(255, 75, 138, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-blobs {
  position: fixed;
  inset: -10% -10% -10% -10%;
  z-index: -1;
  filter: blur(60px);
  pointer-events: none;
}
.bg-blob {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: move 28s ease-in-out infinite;
}
.bg-blob.red { background: radial-gradient(circle at 30% 30%, rgba(255,75,138,.5), rgba(255,75,138,.15)); left: -10%; top: 10%; animation-delay: -8s; }
.bg-blob.violet { background: radial-gradient(circle at 70% 30%, rgba(155,75,255,.55), rgba(155,75,255,.15)); right: -8%; top: -6%; animation-delay: -3s; }
.bg-blob.blue { background: radial-gradient(circle at 50% 70%, rgba(75,107,255,.55), rgba(75,107,255,.15)); left: 20%; bottom: -12%; animation-delay: -15s; }

@keyframes move {
  0%, 100% { transform: translate(0,0) scale(1); }
  25% { transform: translate(40px,-30px) scale(1.08); }
  50% { transform: translate(-20px,30px) scale(0.96); }
  75% { transform: translate(-50px,-20px) scale(1.04); }
}

/* Контейнеры и карточки */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
}

/* Шапка с логотипом */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0 36px;
}
.header img.logo {
  width: 200px;
  height: 40px;
  object-fit: contain;
}

/* Заголовки */
h1, h2, h3 {
  margin: 8px 0 14px;
  line-height: 1.2;
}
h1 { font-size: clamp(22px, 4vw, 36px); }
h2 { font-size: clamp(18px, 3.2vw, 28px); }
h3 { font-size: clamp(16px, 2.8vw, 22px); }
p { color: var(--muted); }

/* Кнопки — одинакового размера, столбиком по центру */
.btn {
  display: inline-flex; /* делает элемент flex-контейнером, при этом он ведёт себя как inline-элемент (в строке) */
  align-items: center; /* выравнивает дочерние элементы по поперечной оси (обычно вертикально) по центру */
  justify-content: center; /* выравнивает дочерние элементы по основной оси (обычно горизонтально) по центру */
  width: 260px; /* ширина элемента */
  height: 52px; /* фиксированная высота элемента */
  margin: 10px auto; /* отступ сверху/снизу 10px, слева/справа auto — обычно центрирует блок по горизонтали, если поведение контейнера это позволяет */
  padding: 0 0px; /* внутренние отступы: 0 сверху/снизу, 18px слева/справа */
  font-weight: 600; /* толщина шрифта (semi-bold) */
  font-size: 16px;       /* ← размер шрифта внутри кнопки */
  letter-spacing: .3px; /* межбуквенный интервал */
  color: white; /* цвет текста */
  background: linear-gradient(135deg, var(--accent1), var(--accent2)); /* градиентный фон, использует CSS-переменные */
  border: 0; /* убирает рамку */
  border-radius: 14px; /* скруглённые углы радиусом 14px */
  box-shadow: 0 8px 28px rgba(75,107,255,.35); /* тень: смещение по X=0, Y=8px, размытие 28px и полупрозрачный цвет */
  cursor: pointer; /* показывает указатель (руку) при наведении — обычно для интерактивных элементов */
  text-decoration: none; /* убирает подчеркивание у ссылок */
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease; /* плавные анимации для transform, box-shadow и filter */
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); filter: brightness(0.98); }

.btn-secondary {
  background: linear-gradient(135deg, #2a335c, #3b2a5c);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}

.btn-range {
    width: 40%;
    font-size: 12px;
    margin: auto auto; /* отступ сверху/снизу 10px, слева/справа auto — обычно центрирует блок по горизонтали, если поведение контейнера это позволяет */
}
.btn-range:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-range:active { transform: translateY(0); filter: brightness(0.98);}

.btn-deleterange {
    width: 40%;
    font-size: 12px;
    margin: auto auto; /* отступ сверху/снизу 10px, слева/справа auto — обычно центрирует блок по горизонтали, если поведение контейнера это позволяет */
    background: linear-gradient(135deg, var(--accent1), var(--accent3)); /* градиентный фон, использует CSS-переменные */

}  
.btn-deleterange:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-deleterange:active { transform: translateY(0); filter: brightness(0.98);}



/* Формы */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row { display: flex; flex-direction: column; gap: 8px; }
label { color: var(--text); font-size: 14px; }
input[type="text"], input[type="number"], select, textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border .2s ease, background .2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(155,75,255,.7);
  background: rgba(255,255,255,0.08);
}

.checkbox-group, .chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}
.chip input { accent-color: #9b4bff; }

/* Селекторы месяцов/годов */
.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.range-controls {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
}
.range-preview {
  font-size: 13px;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
}

/* Результаты — карточки вместо таблицы */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  font-size: 14px;
}

/* Скрываем шапку таблицы */
.table thead { display: none; }

/* Размещение карточек в сетке (несколько в ряд на широких экранах) */
.table tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Каждая строка — карточка с двумя строками:
   верхняя строка — имя + фамилия (две колонки),
   нижняя строка — ссылка (разворачивается на всю ширину) */
.table tr {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "name surname"
    "link link";
  gap: 6px 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  transition: transform .14s ease, box-shadow .18s ease, background .18s ease;
  align-items: center;
}

/* Убираем границы ячеек и отступы — контент карточки управляется CSS сеткой */
.table th, .table td {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

/* Верхняя строка: имя (первая колонка) */
.table tr td:nth-child(1) {
  grid-area: name;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Верхняя строка: фамилия (вторая колонка) */
.table tr td:nth-child(2) {
  grid-area: surname;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  justify-self: end;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Нижняя строка: ссылка (третья колонка) */
.table tr td:nth-child(3) {
  grid-area: link;
  color: var(--accent1);
  font-size: 13px;
  word-break: break-all;
  text-decoration: underline;
  opacity: 0.95;
}

/* Если у строки нет третьей колонки (возможно ссылка во 2-й колонке),
   попробуем применить стиль ссылки и к 2-й ячейке как запасной вариант */
.table tr td:nth-child(2).maybe-link,
.table tr td[data-role="link"] {
  grid-area: link;
  color: var(--accent1);
  font-size: 13px;
  text-decoration: underline;
  justify-self: start;
}

/* Взаимодействие */
.table tr:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.36);
  background: rgba(255,255,255,0.03);
}

/* Компактный вид на узких экранах — одна колонка карточек */
@media (max-width: 640px) {
  .table tbody {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .table tr {
    padding: 10px;
    border-radius: 10px;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
  }
  .table tr td:nth-child(1) { font-size: 15px; }
  .table tr td:nth-child(2) { font-size: 14px; justify-self: start; text-align: left; }
  .table tr td:nth-child(3) { font-size: 13px; }
}

/* Адаптивность */
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .range-row { grid-template-columns: 1fr; }
  .btn { max-width: 100%; }
}

/* Вспомогательные отступы */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mt-6 { margin-top: 32px; }
.center { text-align: center; }
.small { font-size: 13px; color: var(--muted); }
