:root {
  --color-background: #f5f5f7;
  --color-surface: #ffffff;
  --color-text: #1d1d1f;
  --color-accent: #8b5e34; /* тёплая "пергаментная" бронза вместо стандартного Apple-синего */
  --radius-large: 20px;
  --font-family: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 16px 32px;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.app-header__title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
}

.app-header__nav a {
  color: var(--color-text);
  text-decoration: none;
}

.app-header__nav a:hover {
  color: var(--color-accent);
}

.app-content {
  flex: 1;
  padding: 40px 32px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* Тёплая "пергаментная" подсветка поверхности карточек — едва заметный акцент, не текстура
   поверх контента, чтобы не спорить с чистотой apple-минимализма. */
.placeholder-card,
.auth-card,
.catalog-card {
  background-color: var(--color-surface);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(139, 94, 52, 0.05), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(139, 94, 52, 0.04), transparent 50%);
}

.placeholder-card {
  border-radius: var(--radius-large);
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Навигация в шапке — полноценный визуальный стиль см. Фазу 4, сейчас только функциональность. */

.app-header__nav {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.95rem;
}

.app-header__user {
  color: rgba(29, 29, 31, 0.6);
}

.app-header__logout {
  border: none;
  background: none;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* Формы входа/смены пароля */

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-large);
  padding: 32px;
  max-width: 420px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.auth-card__hint {
  color: rgba(29, 29, 31, 0.6);
  margin-top: -8px;
}

.form-field {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field--checkbox {
  flex-direction: row;
  align-items: center;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font: inherit;
}

.validation-summary,
.validation-message {
  color: #b3261e;
  font-size: 0.9rem;
}

.status-message {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.status-message--success {
  background: rgba(52, 199, 89, 0.12);
  color: #1e7c34;
}

.status-message--error {
  background: rgba(255, 59, 48, 0.1);
  color: #b3261e;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

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

/* Подменю админ-раздела — общее для всех страниц /admin/* (см. AdminNav.razor) */

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-nav__link {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.04);
}

.admin-nav__link:hover {
  background: rgba(139, 94, 52, 0.12);
}

.admin-nav__link--active {
  background: var(--color-accent);
  color: #fff;
}

/* Всплывающие уведомления об успешных действиях — справа внизу (см. ToastContainer.razor) */

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  animation: toast-in 0.2s ease-out;
  max-width: 320px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Каталог */

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.catalog-toolbar input[type="search"],
.catalog-toolbar select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font: inherit;
}

.catalog-meta {
  color: rgba(29, 29, 31, 0.6);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.catalog-card {
  background: var(--color-surface);
  border-radius: var(--radius-large);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-card__name {
  font-weight: 600;
}

.catalog-card__meta {
  color: rgba(29, 29, 31, 0.6);
  font-size: 0.85rem;
}

.catalog-card__prices {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  align-self: flex-start;
}

.badge--unavailable {
  background: rgba(255, 59, 48, 0.1);
  color: #b3261e;
}

.badge--player-suggested {
  background: rgba(139, 94, 52, 0.12);
  color: var(--color-accent);
}

.catalog-pagination {
  margin-top: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.catalog-pagination button {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--color-surface);
  cursor: pointer;
  font: inherit;
}

.catalog-pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Восковая печать — фэнтезийная замена обычной иконки "избранное" (см. CLAUDE.md, визуальный
   стиль). Пока не запечатана — пунктирный контур бронзового акцента; клик "запечатывает"
   предмет каплей воска с бликом и тиснением. */

.favorite-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--color-text);
}

.wax-seal {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50% 50% 48% 52% / 52% 48% 52% 48%;
  border: 2px dashed rgba(139, 94, 52, 0.45);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--color-accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.favorite-toggle:hover .wax-seal {
  transform: scale(1.05);
}

.favorite-toggle:active .wax-seal {
  transform: scale(0.94);
}

.wax-seal--sealed {
  border-style: solid;
  border-color: transparent;
  background: radial-gradient(circle at 32% 28%, #b8493f 0%, #7a1f1f 60%, #591313 100%);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 2px rgba(255, 255, 255, 0.3),
    inset 0 -3px 5px rgba(0, 0, 0, 0.35);
  color: rgba(255, 235, 220, 0.92);
}

.favorite-toggle__label {
  font-size: 0.95rem;
}

/* Профиль — избранное слева (поиск + скроллируемый список), заявки справа (см. ProfileIndex.razor) */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.profile-grid .auth-card,
.admin-two-col .auth-card {
  max-width: none;
}

@media (max-width: 720px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.profile-favorites__search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font: inherit;
  margin-bottom: 12px;
}

.profile-favorites-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-favorite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 14px;
  padding: 12px 14px;
}

.profile-favorite-item__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--color-text);
  min-width: 0;
}

.profile-favorite-item__remove {
  flex: none;
  background: rgba(255, 59, 48, 0.1);
  color: #b3261e;
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* Уведомления — скроллируемый список, чтобы длинная история не растягивала страницу
   (см. NotificationsIndex.razor). */

.notifications-list {
  max-height: 640px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

/* Подсказка валюты у полей ввода стоимости — все расчёты идут в золотых монетах (см. CLAUDE.md) */

.input-hint {
  color: rgba(29, 29, 31, 0.5);
  font-weight: 400;
  font-size: 0.85rem;
}

/* Вкладки внутри /admin/economy/* — города и сессии разведены на отдельные страницы,
   т.к. вместе список городов + список сессий + обе формы создания были слишком тесными. */

.admin-subnav {
  display: flex;
  gap: 8px;
  margin: -12px 0 24px;
}

.admin-subnav__link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.admin-subnav__link--active {
  background: rgba(139, 94, 52, 0.12);
  color: var(--color-accent);
  border-color: transparent;
}

/* Список слева + форма создания справа — общий паттерн для страниц админки
   (пользователи, города, сессии), чтобы форма не отталкивала список вниз. */

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .admin-two-col {
    grid-template-columns: 1fr;
  }
}

.admin-two-col__wide {
  max-width: none;
}

/* overflow-x: auto вместо переноса колонок — на узкой карточке таблица сессий (7 колонок)
   иначе вылезала за пределы .auth-card и наезжала на соседнюю карточку формы. */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.admin-table__row--current {
  background: rgba(139, 94, 52, 0.06);
}

/* Строка пользователя в /admin/users — текст слева, кнопка удаления справа (см. AdminUsers.razor) */

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-row__delete {
  flex: none;
  background: rgba(255, 59, 48, 0.1);
  color: #b3261e;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.admin-table--clickable tbody tr {
  cursor: pointer;
}

.admin-table--clickable tbody tr:hover {
  background: rgba(139, 94, 52, 0.08);
}

/* Модальное окно редактирования (см. AdminSessions.razor) */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 29, 31, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}

.modal-card {
  background: var(--color-surface);
  border-radius: var(--radius-large);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
}

.modal-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.modal-card__delete {
  background: rgba(255, 59, 48, 0.1);
  color: #b3261e;
  margin-left: auto;
}
