/* ==========================================================================
   NORA-PSY — оформление главной страницы и внутренних страниц.
   Токены взяты из css/main4.css и DESIGN-SPEC.md, чтобы приложение
   совпадало по стилю с игрой.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Forum&family=Inter&display=swap');

:root {
  --bg-page:       #c8d9b0;
  --panel-bg:      #b6c99b;
  --panel-border:  #98a77f;
  --panel-radius:  15px;
  --board-fill:    #718255;
  --board-stroke:  #EDD28C;
  --text:          #000;
  --text-soft:     #333;
  --accent-dark:   #4a300d;

  --grad-title:  linear-gradient(90deg, #000 0%, #4a300d 39.035%, #945d10 100%);
  --grad-name:   linear-gradient(90deg, #000 0%, #b66a00 100%);
  --grad-btn:    linear-gradient(90deg, #cfe1b9 0%, #8ea46b 100%);
  --grad-card:   linear-gradient(180deg, #fff3b0 0%, #e4c179 52.88%, #c99143 100%);

  --shadow-panel: 2px 6px 20.5px 4px rgba(65, 65, 65, 0.16);
  --shadow-card:  3px 7px 20.8px 1px rgba(0, 0, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background-color: var(--bg-page);
  font-family: 'Forum', serif;
  color: var(--text);
  overflow-x: hidden;
}

button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
a { color: var(--accent-dark); }

/* ===== Градиентный текст ===== */
/* Сокращённое background сбрасывает background-clip, поэтому задаём
   background-image, а обрезку по тексту объявляем после фона. */
.grad-title { background-image: var(--grad-title); }
.grad-name  { background-image: var(--grad-name); }

.grad-title,
.grad-name {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Если браузер не умеет обрезку по тексту — показываем обычный тёмный текст,
   а не прозрачный на градиентной плашке. */
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .grad-title,
  .grad-name {
    background-image: none;
    -webkit-text-fill-color: currentColor;
    color: var(--accent-dark);
  }
}

/* ===== Верхнее меню (раздел 7.1 ТЗ) ===== */
.site-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
}

.site-header__logo {
  font-size: 26px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.site-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.site-nav a:hover     { background: rgba(0, 0, 0, 0.1); }
.site-nav a.is-active { background: rgba(0, 0, 0, 0.14); }

/* «Выйти» визуально отделена от основных пунктов */
.site-nav__logout {
  margin-left: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--panel-border);
}
.site-nav__logout a { color: #7a2f12; }

.site-burger {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
  font-size: 22px;
  line-height: 44px;
  text-align: center;
}

/* ===== Главная страница: два блока (раздел 3 ТЗ) ===== */
.home {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 48px;
  align-items: center;
  max-width: 1360px;
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 48px 32px;
}

/* Левая часть — приветственный блок */
.home__welcome-title {
  margin-bottom: 20px;
  font-size: 52px;
  line-height: 1.12;
}

.home__welcome-text {
  max-width: 620px;
  font-size: 22px;
  line-height: 1.6;
  color: var(--text-soft);
}
.home__welcome-text p + p { margin-top: 16px; }

/* Правая часть — название и кнопки переходов */
.home__panel {
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-panel);
}

.home__brand {
  margin-bottom: 6px;
  font-size: 46px;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.02em;
}

.home__brand-sub {
  margin-bottom: 28px;
  font-size: 18px;
  color: var(--text-soft);
  text-align: center;
}

.home__actions { display: flex; flex-direction: column; gap: 14px; }

/* Нижняя часть правого блока — вход */
.home__footer {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--panel-border);
}

.home__hint {
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-soft);
  text-align: center;
}

/* ===== Кнопки ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 24px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s, background 0.2s;
}

.btn--primary { background: var(--grad-btn); }
.btn--primary:hover { opacity: 0.85; }

.btn--ghost { background: rgba(0, 0, 0, 0.1); font-size: 20px; }
.btn--ghost:hover { background: rgba(0, 0, 0, 0.18); }

.btn--gold { background: var(--grad-card); }
.btn--gold:hover { opacity: 0.88; }

.btn--inline { display: inline-flex; width: auto; min-height: 44px; }

/* ===== Внутренние страницы ===== */
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}

.page__title { margin-bottom: 10px; font-size: 42px; line-height: 1.15; }

.page__lead {
  margin-bottom: 28px;
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-soft);
}

.panel {
  padding: 24px 26px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-panel);
}
.panel + .panel { margin-top: 20px; }

.panel__title { margin-bottom: 14px; font-size: 24px; }

.prose { font-size: 18px; line-height: 1.65; }
.prose h2 { margin: 24px 0 10px; font-size: 26px; }
.prose h2:first-child { margin-top: 0; }
.prose p  { margin-bottom: 12px; }
.prose ul { margin: 0 0 14px 22px; }
.prose li { margin-bottom: 6px; }

/* Кнопка «Закрыть» внизу текстовых страниц (раздел 7.2 ТЗ) */
.page__close { margin-top: 28px; text-align: center; }

/* ===== Формы ===== */
.form { max-width: 460px; }
.form__row { margin-bottom: 16px; }

.form__label {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.form__input,
.form__select,
.form__textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  background: #e8f0dc;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  font-size: 18px;
  color: var(--text);
}
.form__textarea { min-height: 130px; resize: vertical; }

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  outline: 2px solid #8ea46b;
  outline-offset: 1px;
}

.form__links {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.7;
}
.form__links a { margin-right: 14px; }

/* ===== Сообщения ===== */
.alert {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 11px;
  border: 1px solid var(--panel-border);
  background: #e8f0dc;
  font-size: 17px;
  line-height: 1.5;
}
.alert--error   { background: #f3d8cf; border-color: #c08a74; }
.alert--success { background: #dcebc6; }

/* Пометка демонстрационных действий (раздел 11.4 ТЗ) */
.demo-note {
  display: inline-block;
  padding: 6px 12px;
  border: 1px dashed #8a6b2f;
  border-radius: 9px;
  background: rgba(255, 243, 176, 0.5);
  font-size: 15px;
  color: #5a4210;
}

/* ===== Карточки выбора и тарифов ===== */
.choice-grid,
.tariff-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.choice-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-panel);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.choice-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.choice-card__title { margin-bottom: 10px; font-size: 26px; }
.choice-card__text  { flex: 1; font-size: 17px; line-height: 1.55; color: var(--text-soft); }
.choice-card__cta   { margin-top: 18px; }

.tariff-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-panel);
}
.tariff-card--featured { border-color: #c99143; box-shadow: var(--shadow-card); }

.tariff-card__title  { font-size: 26px; }
.tariff-card__price  { margin: 10px 0 2px; font-size: 30px; }
.tariff-card__period { margin-bottom: 14px; font-size: 16px; color: var(--text-soft); }
.tariff-card__list   { flex: 1; margin: 0 0 18px 20px; font-size: 17px; line-height: 1.6; }

/* ===== Кабинет ===== */
.cab-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

.stat {
  margin-bottom: 14px;
  font-size: 18px;
  line-height: 1.5;
}
.stat__label { color: var(--text-soft); }
.stat__value { font-size: 22px; }

.stat__big {
  display: block;
  margin-top: 4px;
  font-size: 34px;
}

.status-badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: #e8f0dc;
  font-size: 16px;
}
.status-badge--approved { background: #cfe1b9; border-color: #6f8a4a; }
.status-badge--pending  { background: #fff3b0; border-color: #c99143; }
.status-badge--rejected,
.status-badge--error    { background: #f3d8cf; border-color: #c08a74; }

.data-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--panel-border);
  text-align: left;
  vertical-align: middle;
}
.data-table th { font-size: 18px; }
.data-table tr:last-child td { border-bottom: 0; }

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

.empty-state {
  padding: 26px 20px;
  border: 1px dashed var(--panel-border);
  border-radius: 11px;
  font-size: 18px;
  color: var(--text-soft);
  text-align: center;
}

.actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.site-footer {
  padding: 22px 32px;
  border-top: 1px solid var(--panel-border);
  font-size: 16px;
  color: var(--text-soft);
  text-align: center;
}

/* ===== Телефон (раздел 11.1 ТЗ) ===== */
@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; gap: 12px; padding: 12px 18px; }
  .site-header__logo { font-size: 22px; }

  .site-burger { display: block; }

  /* Раскрывающееся меню на телефоне */
  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--panel-border);
  }
  .site-nav.is-open { display: flex; }

  .site-nav a { padding: 12px 14px; font-size: 19px; }

  /* В раскрытом вертикальном меню «Выйти» располагается внизу */
  .site-nav__logout {
    margin-top: 8px;
    margin-left: 0;
    padding-top: 10px;
    padding-left: 0;
    border-top: 1px solid var(--panel-border);
    border-left: 0;
  }

  .home {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 0;
    padding: 28px 18px 40px;
  }
  .home__welcome-title { font-size: 34px; }
  .home__welcome-text  { font-size: 19px; }
  .home__panel { padding: 24px 18px; }
  .home__brand { font-size: 36px; }

  .btn { min-height: 48px; font-size: 21px; }

  .page { padding: 28px 18px 48px; }
  .page__title { font-size: 31px; }
  .page__lead  { font-size: 18px; }
  .panel { padding: 20px 16px; }
  .prose { font-size: 17px; }
  .form { max-width: none; }
}
