/* Вход арендатора /my/login/ (Слава #10415, #10449; accounts/audience.py) — окончательный вариант А макетов
   tenant-login-mockups-20261113.
   Та же карточка входа, что у общего /login/; отличаются подпись области «Кабинет арендатора», терракотовый акцент
   кабинета (Слава #10409 — «весь стиль кабинета, включая логотип наверху»), логотип в шапке и правая панель
   со сценой Альмы (showcase-tenant.svg, облегчённая по #10410).

   Акцент — переменными --tn-* на :root (файл подключают только страницы арендатора): так их видят и форма, и шапка;
   общие --accent… переопределены только на body страницы арендатора (body:has(.auth-tenant)).
   --tn-ink      текст и ссылки (AA ≥ 4.5 на белом и на заливке кнопки)
   --tn-strong   насыщенная заливка (знак логотипа, полоска договора)
   --tn-fill     рамка кнопки, линии сцены
   --tn-line     рамка поля в фокусе и отмеченного флажка, контур дома
   --tn-soft/-2  светлая заливка: подпись области, кнопка (градиент), стены и плашки сцены
   --tn-ring     кольцо фокуса
   --tn-panel-*  фон карточки: от белого слева к оттенку справа; --tn-glow — пятно света справа вверху */

/* Токены кабинета: акцент (--tn-*) в обеих темах и постоянные цвета сцены Альмы (--tn-<палитра>). Заданы на :root —
   этот файл подключают только страницы арендатора; общие токены (--accent…) переопределяет только body ниже. */
:root {
  --tn-ink: #b3401a; --tn-ink-hover: #8c3113; --tn-strong: #c2410c; --tn-fill: #ea6a3c; --tn-line: #f2926c;
  --tn-soft: #fff4ee; --tn-soft-2: #ffe2d4; --tn-ring: rgba(234, 106, 60, 0.24);
  --tn-panel-a: #fff6f1; --tn-panel-b: #fde1d3; --tn-glow: rgba(254, 215, 196, 0.6);
  --tn-amber-100: #fef3c7; --tn-amber-200: #fde68a; --tn-amber-300: #fcd34d; --tn-amber-400: #fbbf24;
  --tn-amber-500: #f59e0b; --tn-amber-600: #d97706; --tn-amber-700: #b45309; --tn-amber-800: #92400e;
  --tn-amber-900: #78350f; --tn-orange-200: #fed7aa; --tn-orange-600: #ea580c; --tn-orange-700: #c2410c;
  --tn-slate-50: #f8fafc; --tn-slate-100: #f1f5f9; --tn-slate-200: #e2e8f0; --tn-slate-300: #cbd5e1;
  --tn-slate-400: #94a3b8; --tn-slate-500: #64748b; --tn-slate-600: #475569; --tn-slate-700: #334155;
  --tn-slate-800: #1e293b; --tn-slate-900: #0f172a; --tn-night-panel: #0f1a2c; --tn-night-wall-left: #182232;
  --tn-night-wall-right: #1f2b3d; --tn-night-doc-back: #151e29; --tn-night-box: #151c26; --tn-night-line: #2d3848;
  --tn-night-paper: #1e2632; --tn-night-paper-line: #384454;
}
:root[data-theme="dark"] {
  --tn-ink: #fdae8a; --tn-ink-hover: #fecdb5; --tn-strong: #c2410c; --tn-fill: #f07a4f; --tn-line: #f07a4f;
  --tn-soft: #33201b; --tn-soft-2: #3a2219; --tn-ring: rgba(240, 122, 79, 0.26);
  --tn-panel-a: #2a1d1c; --tn-panel-b: #3a221b; --tn-glow: rgba(240, 122, 79, 0.09);
}
body:has(.auth-split-layout.auth-tenant) {
  /* Общие токены страницы (строка шагов, плашки форм, кнопки шапки) берут оттенок кабинета */
  --accent: var(--tn-ink);
  --accent-fill: var(--tn-strong);
  --accent-hover: var(--tn-ink-hover);
  --accent-soft: var(--tn-soft);
  --accent-dashed: var(--tn-line);
}

.auth-split-layout.auth-tenant {
  background: radial-gradient(circle at 86% 20%, var(--tn-glow) 0%, transparent 45%),
              linear-gradient(108deg, #fff 0%, #fff 42%, var(--tn-panel-a) 68%, var(--tn-panel-b) 100%);
}
:root[data-theme="dark"] .auth-split-layout.auth-tenant {
  background: radial-gradient(circle at 86% 20%, var(--tn-glow) 0%, transparent 50%),
              linear-gradient(108deg, var(--tn-slate-900) 0%, var(--tn-night-panel) 44%, var(--tn-panel-a) 72%, var(--tn-panel-b) 100%);
}

/* Логотип в шапке: знак — тот же PNG, синий квадрат повёрнут по оттенку в терракоту (≈ #c23500, белая «Р» остаётся
   белой), первая строка названия — цветом кабинета. На общей /login/ правило не действует — там прежний синий. */
body:has(.auth-split-layout.auth-tenant) .brand-mark { background: var(--tn-strong); }
body:has(.auth-split-layout.auth-tenant) .brand-mark img { filter: hue-rotate(155deg); }
body:has(.auth-split-layout.auth-tenant) .brand-name > span:first-child { color: var(--tn-ink) !important; }
/* Кружок учётной записи (шаг пароля после входа по коду) — тоже цветом кабинета, не общим синим */
body:has(.auth-split-layout.auth-tenant) .avatar { background: var(--tn-soft-2) !important; border-color: var(--tn-line) !important; color: var(--tn-ink) !important; }
:root[data-theme="dark"] body:has(.auth-split-layout.auth-tenant) .avatar { background: var(--tn-soft) !important; border-color: var(--tn-line) !important; color: var(--tn-ink) !important; }

/* Подпись области над заголовком */
.auth-area {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tn-ink);
  background: var(--tn-soft-2);
}
.auth-area svg { flex: none; }

/* Переключатель способа входа. Общие правила тёмной темы (app.css) сильнее светлых — поэтому у каждого правила
   здесь своя пара для тёмной темы (Альма, группа #1564: в тёмной теме всё акцентное на форме — терракота). */
.auth-split-layout.auth-tenant .auth-switch a[aria-current="page"],
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-switch a[aria-current="page"] {
  color: var(--tn-ink) !important;
  border-color: var(--tn-line) !important;
}
/* Неактивная вкладка: общий серый на мягком фоне карточки арендатора давал 4,34 — темнее до AA. */
:root:not([data-theme="dark"]) .auth-split-layout.auth-tenant .auth-switch a:not([aria-current="page"]):not(:hover) { color: var(--tn-slate-600) !important; }
.auth-split-layout.auth-tenant .auth-switch a:focus-visible,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-switch a:focus-visible { box-shadow: 0 0 0 2.5px var(--tn-ring) !important; }

/* Поля и флажок */
.auth-split-layout.auth-tenant .auth-card .field input:focus,
.auth-split-layout.auth-tenant .auth-card .field input:focus-visible,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-card .field input:focus,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-card .field input:focus-visible {
  border-color: var(--tn-line) !important;
  box-shadow: 0 0 0 3px var(--tn-ring) !important;
}
.auth-split-layout.auth-tenant .auth-check input[type="checkbox"]:hover,
.auth-split-layout.auth-tenant .auth-check input[type="checkbox"]:focus-visible,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-check input[type="checkbox"]:hover,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-check input[type="checkbox"]:focus-visible {
  border-color: var(--tn-line) !important;
  box-shadow: 0 0 0 3px var(--tn-ring) !important;
}
/* «Запомнить меня» — терракота в обеих темах (#1564): мягкая заливка, рамка и галочка цветом кабинета */
.auth-split-layout.auth-tenant .auth-check input[type="checkbox"]:checked,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-check input[type="checkbox"]:checked {
  background: linear-gradient(180deg, var(--tn-soft) 0%, var(--tn-soft-2) 100%) !important;
  border-color: var(--tn-line) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 3px var(--tn-ring) !important;
}
/* Галочка — маской, цветом оттенка (без отдельной картинки) */
.auth-split-layout.auth-tenant .auth-check input[type="checkbox"]:checked::after {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--tn-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 7.5L5.5 10.5L11.5 3.5'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 7.5L5.5 10.5L11.5 3.5'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}

/* Главная кнопка */
.auth-split-layout.auth-tenant .auth-card button[type="submit"]:not(.link-button):not(.secondary),
.auth-split-layout.auth-tenant .auth-card .button.primary {
  background: linear-gradient(180deg, var(--tn-soft) 0%, var(--tn-soft-2) 100%) !important;
  border-color: var(--tn-fill) !important;
  color: var(--tn-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 6px var(--tn-ring) !important;
}
.auth-split-layout.auth-tenant .auth-card button[type="submit"]:not(.link-button):not(.secondary):hover,
.auth-split-layout.auth-tenant .auth-card .button.primary:hover {
  background: var(--tn-soft-2) !important;
  border-color: var(--tn-strong) !important;
  color: var(--tn-ink-hover) !important;
}
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-card button[type="submit"]:not(.link-button):not(.secondary),
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-card .button.primary {
  background: linear-gradient(180deg, var(--tn-slate-900) 0%, var(--tn-soft-2) 100%) !important;
  border-color: var(--tn-line) !important;
  color: var(--tn-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-card button[type="submit"]:not(.link-button):not(.secondary):hover,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-card .button.primary:hover {
  border-color: var(--tn-ink-hover) !important;
  color: var(--tn-ink-hover) !important;
}

/* Ссылки («Забыли пароль?», «Помощь по входу», нижние строки) */
.auth-split-layout.auth-tenant .auth-card a:not(.button):not([data-login-switch]),
.auth-split-layout.auth-tenant .auth-links .link-button,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-card a:not(.button):not([data-login-switch]),
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-links .link-button {
  color: var(--tn-ink) !important;
}
.auth-split-layout.auth-tenant .auth-card a:not(.button):not([data-login-switch]):hover,
.auth-split-layout.auth-tenant .auth-links .link-button:hover,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-card a:not(.button):not([data-login-switch]):hover,
:root[data-theme="dark"] .auth-split-layout.auth-tenant .auth-links .link-button:hover {
  color: var(--tn-ink-hover) !important;
}

.auth-split-layout .auth-links-center { justify-content: center; text-align: center; }

/* Шаг пароля арендатора — без полосы поиска (её содержимое снято в password_offer.html) */
body:has(.auth-bare) .search-row { display: none; }


/* Правая панель кабинета (/my/login/, Слава #2695, #2696, #2700):
   По размеру иллюстрации (320×200, max-width 360px десктоп / 280px телефон), отступам и мобильному порядку
   (форма входа сверху, витрина снизу) — 1:1 с общим входом /login/ (public/app.css), в терракотовой палитре --tn-*. */
.auth-tenant-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tn-ink);
  background: var(--tn-soft-2);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* Тёплая терракотовая палитра иллюстрации .auth-building-svg (геометрия 1:1 с _auth_showcase.html) */
.auth-tenant .auth-building-svg .auth-house-wall-left { fill: var(--tn-soft); stroke: var(--tn-line); }
.auth-tenant .auth-building-svg .auth-house-wall-right { fill: #fff; stroke: var(--tn-line); }
.auth-tenant .auth-building-svg .auth-house-roof { fill: var(--tn-soft-2); stroke: var(--tn-fill); }
.auth-tenant .auth-building-svg .auth-win.win-amber { fill: var(--tn-amber-100); stroke: var(--tn-amber-500); }
.auth-tenant .auth-building-svg .auth-win.win-cyan { fill: var(--tn-soft-2); stroke: var(--tn-line); }
.auth-tenant .auth-building-svg .auth-doc-paper { fill: #fff; stroke: var(--tn-slate-300); }
.auth-tenant .auth-building-svg .auth-doc-bar { fill: var(--tn-fill); }
.auth-tenant .auth-building-svg .auth-doc-line { stroke: var(--tn-slate-200); }
.auth-tenant .auth-building-svg .auth-pill-box.pill-blue { stroke: var(--tn-line); }
.auth-tenant .auth-building-svg .auth-pill-icon-circle.icon-circle-blue { fill: var(--tn-soft-2); }
.auth-tenant .auth-building-svg .auth-pill-icon-path.icon-path-blue { stroke: var(--tn-ink); }
.auth-tenant .auth-building-svg .auth-pill-text.text-blue { fill: var(--tn-ink); }

.auth-tenant .auth-bullet-icon.icon-pin {
  background: var(--tn-soft-2);
  color: var(--tn-ink);
}

/* Тёмная тема: геометрия 1:1, загораются тёплые окна (#882) */
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-house-wall-left { fill: var(--tn-night-wall-left); stroke: var(--tn-line); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-house-wall-right { fill: var(--tn-night-wall-right); stroke: var(--tn-line); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-house-roof { fill: var(--tn-soft-2); stroke: var(--tn-line); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-win.win-amber { fill: var(--tn-amber-400); stroke: none; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.85)); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-win.win-cyan { fill: var(--tn-fill); stroke: none; filter: drop-shadow(0 0 4px rgba(240, 122, 79, 0.75)); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-doc-paper { fill: var(--tn-night-paper); stroke: var(--tn-night-paper-line); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-doc-bar { fill: var(--tn-fill); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-doc-line { stroke: var(--tn-night-paper-line); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-pill-box.pill-blue { stroke: var(--tn-line); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-pill-icon-circle.icon-circle-blue { fill: var(--tn-soft-2); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-pill-icon-path.icon-path-blue { stroke: var(--tn-ink); }
:root[data-theme="dark"] .auth-tenant .auth-building-svg .auth-pill-text.text-blue { fill: var(--tn-ink); }
:root[data-theme="dark"] .auth-tenant .auth-bullet-icon.icon-pin {
  background: var(--tn-soft-2);
  color: var(--tn-ink);
}

/* Шаг пароля арендатора: в шапке только кружок учётной записи (имя и «Выйти») — без «Сообщений» и «Вида»
   (FABLE-LOGIN.md п. 3.4); основная кнопка сверху, «Задать позже» — тихо под ней на любой ширине. */
body:has(.auth-bare) .topbar-end .messages-entry,
body:has(.auth-bare) .topbar-end .view-controls { display: none !important; }
.auth-split-layout.auth-tenant .auth-actions { flex-direction: column-reverse; }
.auth-split-layout.auth-tenant .auth-actions .button { flex: none; width: 100%; }
.auth-split-layout.auth-tenant .auth-actions + * , .auth-split-layout.auth-tenant form + .muted.small { margin-top: 14px; }
.auth-split-layout.auth-tenant .auth-area + .auth-steps { margin-top: 2px; }
.auth-split-layout.auth-tenant .auth-link-form { margin-top: 18px; }
