/* Базовые стили для адаптивного и современного интерфейса */

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background-color: #141433; /* тёмный фиолетовый фон */
  color: #e0e0e0; /* светлый текст */
  overflow-x: hidden; /* запрет горизонтальной прокрутки */
  /* Оставляем настройку скроллбара для body, глобальные стили для скроллбаров добавлены ниже */
}

/* Стилизация полосы прокрутки для Chrome/Edge */
body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
body::-webkit-scrollbar-track {
  background: #141433;
}
body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  border-radius: 4px;
}

/* Глобальная стилизация тонких неоновых полос прокрутки для всех элементов */
* {
  scrollbar-width: thin;
  scrollbar-color: #6a00f4 #141433;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: #141433;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  border-radius: 4px;
}

/* Навигационная панель */
.navbar {
  /* Красивый тёмный градиент фона для шапки */
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
  color: #ffffff;
}
@keyframes navLogoLightAnim {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Анимация переливающегося фона для навигационной панели */
@keyframes navBarGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  /* Расширяем блок навигации, чтобы элементы оказались по центру между логотипом и пользователем */
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

/* Подсветка активного пункта верхней навигации */
.nav-links a.active {
  color: #00ff9c;
  border-bottom: 2px solid #00bf72;
}

.nav-links a:hover {
  color: #00ff9c; /* неоновый зелёный при наведении */
}

/* Подсветка активного пункта верхнего меню */
.nav-links a.active {
  color: #00ff9c;
  border-bottom: 2px solid #00ff9c;
  font-weight: 600;
}

/* Подсветка активного пункта нижней (мобильной) навигации */
.mobile-nav a.active {
  color: #00ff9c;
  background: linear-gradient(135deg, #6a00f4aa, #00bf72aa);
  border-radius: 8px;
  padding: 0.4rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-user span {
  font-size: 0.9rem;
  color: #fff;
}

.nav-user a {
  color: #fff;
  text-decoration: underline;
  font-size: 0.9rem;
}

/* Плавающая кнопка контактов */
/* Плавающая кнопка "Контакты" с лёгкой пульсацией */
.contact-button {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: contactPulse 2.5s infinite;
}

@keyframes contactPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(106, 0, 244, 0.6), 0 0 0 0 rgba(0, 191, 114, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 20px 0 rgba(106, 0, 244, 0.6), 0 0 10px 0 rgba(0, 191, 114, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(106, 0, 244, 0.6), 0 0 0 0 rgba(0, 191, 114, 0.6);
  }
}

/* Кнопка прокрутки вверх */
.scroll-top-button {
  position: fixed;
  bottom: 9rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  color: #fff;
  font-size: 1.4rem;
  display: none; /* показывается при прокрутке */
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 500;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Всплывающее окно контактов */
.contact-popup {
  position: fixed;
  bottom: 9rem;
  right: 1rem;
  background: #1e1e3f;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  padding: 1rem;
  min-width: 260px;
  z-index: 500;
}
.contact-popup h4 {
  margin: 0 0 0.5rem 0;
  color: #9d4edd;
  font-size: 1rem;
}
.contact-row {
  margin-bottom: 0.5rem;
}
.contact-row span {
  display: block;
  color: #cfcfe7;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}
.contact-row a {
  color: #00ff9c;
  text-decoration: none;
  font-size: 0.85rem;
}
.contact-row a:hover {
  text-decoration: underline;
}

/* Нижняя навигация для мобильных устройств */
.mobile-nav {
  display: none;
}
.mobile-nav a {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0;
  color: #e0e0e0;
  text-decoration: none;
  font-size: 1.4rem;
}
.mobile-nav a:hover {
  color: #00ff9c;
}

/* Подсветка активной иконки в мобильном меню */
.mobile-nav a.active {
  color: #00ff9c;
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  border-radius: 8px;
}

/* Контейнер содержимого */
.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Выравнивание заголовков первой строки в центре */
.container > h1 {
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Центрирование заголовков внутри информационных и персональных карт */
.org-info h2,
.personal-card h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Блок информации об организации */
.org-info {
  background: #1e1e3f;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .org-info {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}
.org-info h2 {
  margin-top: 0;
  color: #9d4edd;
  text-align: center;
}
.org-info p {
  margin: 0.4rem 0;
  color: #cfcfe7;
  text-align: center;
}

/* Описание организации с поддержкой переносов строк */
.org-description {
  white-space: pre-line;
}

/* Выделяем описание организации (последний абзац) */
.org-info p:last-child {
  color: #00ff9c;
  font-weight: 500;
  margin-top: 0.8rem;
}

/* Карусель фотографий мероприятия */
.event-carousel {
  overflow-x: auto;
  display: flex;
  gap: 0.5rem;
  scroll-snap-type: x mandatory;
}
.event-carousel img {
  flex: 0 0 100%;
  scroll-snap-align: center;
  border-radius: 4px;
  width: 100%;
  object-fit: cover;
  border: 1px solid #333;
}

/* Страница входа */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #6a00f4, #00bf72); /* фиолетово‑зелёный фон */
  color: #fff;
}

.login-container {
  background: #1e1e3f;
  padding: 2rem;
  border-radius: 12px;
  color: #e0e0e0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  min-width: 320px;
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, #6a00f4, #00bf72) 1;
  position: relative;
  box-sizing: border-box;
}

/* Общие box-sizing для формы и полей входа */
.login-container input,
.login-container button,
.login-form input,
.login-form button {
  box-sizing: border-box;
}

.login-container h1 {
  margin-top: 0;
  text-align: center;
  margin-bottom: 1.2rem;
}

.login-form input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid #444;
  background: #141433;
  color: #e0e0e0;
  border-radius: 4px;
  font-size: 1rem;
}

.login-form button {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 4px;
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-form button:hover {
  opacity: 0.9;
}

.forgot-link {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: #9d4edd;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Модальное окно для забытого пароля */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
}
.modal-content {
  background: #1e1e3f;
  padding: 1.5rem;
  border-radius: 8px;
  color: #e0e0e0;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, #6a00f4, #00bf72) 1;
}
.modal-close {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}
.modal-close:hover {
  opacity: 0.9;
}

.login-container h1 {
  margin-top: 0;
  text-align: center;
  margin-bottom: 1rem;
}

.login-container input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid #444;
  background: #141433;
  color: #e0e0e0;
  border-radius: 4px;
  font-size: 1rem;
}

.login-container button {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 4px;
  background-color: #6a00f4;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-container button:hover {
  background-color: #5500c7;
}

.error {
  color: #ff5370;
  margin-bottom: 1rem;
  text-align: center;
}

/* Сообщения об успехе */
.message {
  color: #8ef49b;
  margin-bottom: 1rem;
  text-align: center;
}

/* Список мероприятий */
.events {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.event-card {
  background: #1e1e3f;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  /* Увеличиваем размер карточек мероприятий на десктопе */
  width: calc(45% - 1rem);
  min-width: 250px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 2rem; /* место для даты */
}

.event-card h3 {
  margin: 0.5rem 0;
  color: #9d4edd;
}

.event-card p {
  flex-grow: 1;
  margin: 0;
  color: #cfcfe7;
}

.event-photos img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  object-fit: cover;
  border: 1px solid #333;
}

/* Слайдер мероприятий с стрелками */
.event-slider {
  position: relative;
  /* Фиксируем соотношение сторон, чтобы карточки не прыгали по высоте */
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.event-slider img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #333;
}
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #6a00f4aa, #00bf72aa);
  border: none;
  color: #ffffff;
  font-size: 1.6rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* Повышаем z-index, чтобы стрелки были поверх видео и оставались кликабельными */
  z-index: 10;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
/* Дата мероприятия */
.event-date {
  font-size: 0.8rem;
  color: #cfcfe7;
  opacity: 0.7;
  position: absolute;
  bottom: 0.4rem;
  right: 0.6rem;
}

/* Полупрозрачный идентификатор публикации в карточке мероприятия */
.event-id {
  opacity: 0.5;
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

/* Заголовок раздела мероприятий */
.events-title {
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: #e0e0e0;
}
.slider-arrow.prev {
  left: 0.5rem;
}
.slider-arrow.next {
  right: 0.5rem;
}

/* Стрелки для просмотра изображений в полноэкранном режиме */
.overlay-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #6a00f4aa, #00bf72aa);
  color: #fff;
  border: none;
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.overlay-arrow.prev { left: 1rem; }
.overlay-arrow.next { right: 1rem; }

/* Карточки личного кабинета */
/* Контейнер карточек в ЛК */
.personal-section {
  /* твои свойства */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 420px));
  gap: 1.2rem;
  margin-bottom: 1.5rem;
  justify-content: center;

  /* ключ: НЕ растягивать элементы по высоте строки */
  align-items: start;
}

/* Сами карточки */
.personal-card {
  background: #1e1e3f;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  box-sizing: border-box;

  /* ключ: не тянуться до высоты соседей */
  align-self: start;
  height: auto;
  min-height: unset; /* на случай, если где-то задан min-height */
}

/* (Опционально) у карточек в гриде gap уже есть,
   margin-bottom можно убрать, чтобы не было лишнего отступа */
.personal-card { margin-bottom: 0; }
/* Компактная раскладка карточек в личном кабинете */
/* Настройки размеров для карточек личного кабинета */
.personal-info-card,
.personal-arrears-card {
  width: 100%;
  max-width: 420px;
}
.personal-settings-card {
  width: 100%;
  max-width: 860px;
  grid-column: span 2;
}
@media (max-width: 900px) {
  .personal-settings-card {
    grid-column: span 1;
  }
}
.personal-card h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: #9d4edd;
  /* Центрируем заголовок внутри карточки */
  text-align: center;
}
.personal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.personal-item span {
  color: #cfcfe7;
  font-weight: 500;
}
.personal-item strong {
  color: #e0e0e0;
}

/* Стили для формы смены пароля */
.personal-card input[type="password"] {
  width: 100%;
  padding: 0.7rem;
  margin-bottom: 0.8rem;
  border: 1px solid #444;
  background: #141433;
  color: #e0e0e0;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}
.personal-card button[type="submit"] {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 4px;
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.personal-card button[type="submit"]:hover {
  opacity: 0.9;
}

/* Сетка для личной информации */
.info-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 0.6rem;
  column-gap: 1rem;
}
.info-grid .label {
  color: #cfcfe7;
  opacity: 0.85;
}
.info-grid .value {
  color: #e0e0e0;
  font-weight: 600;
}

/* Строка задолженности */
.debt-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
}
.debt-line .name {
  color: #cfcfe7;
}

/* Значение задолженности с выделением */
.debt-line .amount {
  color: #e0e0e0;
  font-weight: 600;
}
.debt-line .amount {
  font-weight: 600;
  color: #e0e0ff;
  background: linear-gradient(135deg, rgba(106,0,244,0.25), rgba(0,191,114,0.25));
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* Кнопка оплаты */
.btn-pay {
  margin-top: 0.8rem;
  /* Отцентрируем кнопку оплаты по горизонтали */
  margin-left: auto;
  margin-right: auto;
  display: block;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #6a00f4, #00bf72);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.8;
}
.btn-pay:disabled {
  opacity: 0.5;
}

/* Сотрудники */
.employees {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.employee-card {
  background: #1e1e3f;
  border-left: 4px solid #9d4edd;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 720px;
}

.employee-card img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
}

.employee-info h3 {
  margin: 0;
  margin-bottom: 0.2rem;
  font-size: 1.2rem;
  color: #9d4edd;
}

.employee-info p {
  margin: 0;
  color: #cfcfe7;
  font-size: 0.95rem;
}

/* Личный кабинет */
.personal-info p {
  margin: 0.3rem 0;
  font-size: 1rem;
  color: #cfcfe7;
}

.arrears-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.arrears-table th,
.arrears-table td {
  border: 1px solid #ddd;
  padding: 0.6rem;
  text-align: left;
}

.arrears-table th {
  background-color: #2e2e58;
  color: #e0e0e0;
}

.btn-pay {
  margin-top: 1rem;
  padding: 0.7rem 1.2rem;
  background-color: #6a00f4;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 1rem;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Контакты */
.contact-card {
  background: #1e1e3f;
  padding: 1rem;
  margin-bottom: 0.6rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.contact-card a {
  color: #00ff9c;
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 900px) {
  .event-card {
    width: calc(50% - 1rem);
  }
  .employee-card {
    width: calc(100% - 1rem);
  }
}

@media (max-width: 600px) {
  .event-card {
    width: 100%;
  }
}

/* Мобильная навигация: скрываем верхние пункты, отображаем нижнее меню */
@media (max-width: 800px) {
  .nav-links {
    display: none;
  }
  .nav-user {
    display: none;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #6a00f4, #00bf72);
    border-top: 1px solid #333;
    justify-content: space-around;
    z-index: 200;
  }

  /* Добавляем отступ снизу для контента, чтобы не перекрывалось меню */
  body {
    padding-bottom: 60px;
  }
}

/* ===== Водяной фон из логотипа ===== */
:root{
  /* легко крутить размер/прозрачность без поиска по CSS */
  --wm-size: 220px;   /* размер плитки */
  --wm-opacity: .05;  /* ~6% видимости */
}

body{
  position: relative; /* чтобы псевдоэлемент уверенно был позади контента */
}

/* повторяющийся фон-логотип очень бледный */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  background-image: url("/images/watermark.png");
  background-repeat: repeat;
  background-size: var(--wm-size) var(--wm-size); /* размер иконки НЕ меняем */
  background-position: 0 0;
  opacity: var(--wm-opacity);

  /* скрываем каждый второй квадратик сетки */
  mask: repeating-conic-gradient(#000 0 25%, transparent 0 50%)
        0 0 / calc(var(--wm-size) * 2) calc(var(--wm-size) * 2) repeat;
  -webkit-mask: repeating-conic-gradient(#000 0 25%, transparent 0 50%)
        0 0 / calc(var(--wm-size) * 2) calc(var(--wm-size) * 2) repeat;
}

/* лёгкая виньетка, чтобы контент читался */
body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(80% 60% at 50% 40%,
              rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 100%);
}

/* гарантируем, что весь основной контент над фоном */
body > *{
  position: relative;
  z-index: 1;
}

/* на телефоне плитку делаем помельче/ещё бледнее */
@media (max-width: 600px){
  :root{
    --wm-size: 140px;
    --wm-opacity: .045;
  }
}