/* Страница входа в панель управления.
   Вынесена в отдельный файл: со встроенными стилями страница переросла
   буфер ответа сервера, ответ уходил клиенту раньше, чем шаблон доходил
   до скрытого поля защиты формы — и страница обрывалась на середине. */

/* ── Токены страницы входа (сняты пипеткой с макета) ─────────────── */
:root {
  --bg-deep:      #9dbfed;   /* дальний край фона, слева-снизу */
  --bg-light:     #e3eefe;   /* светлая часть фона, справа      */
  --ink:          #1a2337;   /* заголовки                       */
  --ink-soft:     #5b6a85;   /* пояснения                       */
  --ink-label:    #2f3b52;   /* подписи полей                   */
  --field-bg:     #f1f6fe;
  --field-border: #dbe6f7;
  --accent:       #277ffd;   /* кнопка «Войти»                  */
  --accent-dark:  #1667e0;
  --danger:       #e04b3c;
  --radius-field: 14px;
  --radius-card:  26px;
  --shadow-card:  0 30px 70px -30px rgba(31, 62, 120, .38);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Public Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 120% at 18% 12%, #ffffff 0%, rgba(255,255,255,0) 45%),
    linear-gradient(125deg, var(--bg-deep) 0%, #c4d8f8 38%, var(--bg-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  -webkit-font-smoothing: antialiased;
}

/* ── Две половины: иллюстрация и форма ───────────────────────────── */
.auth {
  width: min(1280px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 24px;
}

.auth__art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
}

/* тёплое свечение за иллюстрацией — как на макете */
.auth__art::before {
  content: '';
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,251,235,.95) 0%, rgba(214,232,255,.55) 45%, rgba(214,232,255,0) 70%);
  filter: blur(8px);
}

.auth__art img {
  position: relative;
  width: 100%;
  max-width: 620px;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Карточка формы ──────────────────────────────────────────────── */
.auth__form {
  width: 100%;
  max-width: 470px;
  justify-self: center;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

.brand__mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #dceeff 0%, #bcdcff 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}

.brand__mark img { width: 34px; height: 34px; display: block; }

.brand__name {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.brand__sub {
  margin: 0 0 34px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.55;
}

.field { margin-bottom: 18px; }

.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-label);
}

.field__box {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 18px;
  border-radius: var(--radius-field);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  box-shadow: 0 1px 2px rgba(31, 62, 120, .04);
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.field__box:focus-within {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(39, 127, 253, .14);
}

.field__box svg { flex: 0 0 auto; color: #8fa3c4; }

.field__box input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin-left: 12px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}

.field__box input::placeholder { color: #9aabc6; }

.field__eye {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8fa3c4;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.field__eye:hover { background: rgba(39,127,253,.1); color: var(--accent); }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 24px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink-label);
  cursor: pointer;
  user-select: none;
}

.remember input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.hint-note { font-size: 13.5px; color: var(--ink-soft); }

.btn-login {
  width: 100%;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-field);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 26px -12px rgba(39, 127, 253, .75);
  transition: transform .12s, box-shadow .18s, filter .18s;
}

.btn-login:hover { filter: brightness(1.05); box-shadow: 0 18px 30px -12px rgba(39,127,253,.85); }
.btn-login:active { transform: translateY(1px); }

/* ── Сообщения ───────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.45;
}

.alert--error {
  background: #fdecea;
  color: #a5271a;
  border: 1px solid #f6c9c3;
}

.alert--info {
  background: #eaf3ff;
  color: #1d5aad;
  border: 1px solid #cfe1fb;
}

.alert svg { flex: 0 0 auto; margin-top: 1px; }

.foot {
  margin: 28px 0 0;
  text-align: center;
  font-size: 13px;
  color: rgba(91, 106, 133, .78);
}

/* ── Адаптив ─────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .auth { grid-template-columns: 1fr; gap: 4px; }
  .auth__art { min-height: 0; order: -1; }
  .auth__art img { max-width: 300px; }
  .auth__form { max-width: 470px; }
}

/* Узкий И невысокий экран (планшет в альбоме, старый ноутбук):
   иллюстрация не влезает вместе с формой — убираем её, форма важнее. */
@media (max-width: 1080px) and (max-height: 820px) {
  .auth__art { display: none; }
}

@media (max-width: 560px) {
  body { padding: 16px; }
  .auth__art { display: none; }
  .auth__form { max-width: 100%; }
  .brand__name { font-size: 25px; }
  .brand__mark { width: 46px; height: 46px; border-radius: 14px; }
  .brand__mark img { width: 30px; height: 30px; }
}

/* Низкий экран (ноутбук) — не даём форме упереться в края */
@media (max-height: 720px) and (min-width: 1081px) {
  .auth__art { min-height: 0; }
  .brand__sub { margin-bottom: 24px; }
  .field { margin-bottom: 14px; }
}
