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

html { background: var(--bg); }

body.lu-auth {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 22px;
}

button,
input { font: inherit; color: inherit; }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.lu-auth__frame {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.lu-auth__header {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  height: 380px;
  padding: 0 20px 24px;
  background-image: var(--header-rays), var(--header-grad);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lu-auth__logo {
  position: relative;
  width: 232px;
  height: auto;
  display: block;
}

.lu-auth__logo svg {
  width: 232px;
  height: auto;
  display: block;
}

.lu-auth__caption {
  position: relative;
  margin: 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  color: var(--header-fg-2);
}

.lu-auth__sheet {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  margin-top: -24px;
  background: var(--bg);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lu-card {
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 20px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lu-card h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  line-height: 28px;
  color: var(--fg-strong);
}

.lu-lead {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 21px;
  color: var(--fg-muted);
}

.lu-card p { margin: 0; }

.lu-card .lu-lead { margin: 4px 0 0; }

.lu-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.lu-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-label);
}

.lu-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 52px;
  padding: 0 14px;
  border-radius: var(--r-input);
  border: 2px solid var(--line-input);
  background: var(--surface);
  color: var(--fg);
  font-size: 17px;
  font-weight: 400;
}

.lu-field input:focus {
  outline: none;
  border-color: var(--ok);
  box-shadow: var(--focus-ring);
}

.lu-btn {
  font-family: var(--font-head);
  cursor: pointer;
  text-decoration: none;
}

.lu-btn--accent {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 56px;
  border-radius: var(--r-btn);
  border: 0;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 800;
  font-size: 17px;
  line-height: 22px;
  white-space: normal;
  text-align: center;
  box-shadow: var(--shadow-accent);
}

.lu-btn--accent:hover { background: var(--accent-hover); }

.lu-btn--accent:active {
  background: var(--accent-pressed);
  box-shadow: none;
}

a.lu-btn--accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lu-btn--text {
  align-self: center;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
  white-space: normal;
  text-align: center;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.lu-banner {
  border-radius: var(--r-btn);
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
}

.lu-banner--alert {
  background: var(--alert-bg);
  color: var(--alert-fg);
}

.lu-note {
  margin: 0;
  text-align: center;
  font-size: 15px;
  line-height: 21px;
  color: var(--fg-muted);
}

.lu-note a {
  color: var(--fg-2);
  font-weight: 700;
}

.lu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.lu-links form {
  display: flex;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.lu-auth__column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

/* Только на ПК: бренд-панель, вкладки «Почта и пароль / Код в Пачке», подсказка про доступ. */
.lu-only-wide { display: none; }

.lu-auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* ПК: две колонки — слева бренд, справа форма. Телефон остаётся как был. */
@media (min-width: 1025px) {
  .lu-only-wide { display: revert; }
  .lu-only-phone { display: none; }

  .lu-auth__frame {
    max-width: none;
    min-height: 100vh;
    flex-direction: row;
  }

  .lu-auth__header {
    flex: 1 1 56%;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: auto;
    min-height: 100vh;
    padding: 56px 64px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
  }

  .lu-auth__chip {
    position: relative;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--header-fg-2);
  }

  .lu-auth__chip b {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--header-chip);
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--header-fg);
  }

  .lu-auth__brand {
    position: relative;
    align-items: flex-start;
    gap: 28px;
    max-width: 560px;
  }

  .lu-auth__logo,
  .lu-auth__logo svg { width: 300px; }

  .lu-auth__caption { display: none; }

  .lu-auth__pitch {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .lu-auth__pitch h2 {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 40px;
    line-height: 1.15;
    color: var(--header-fg);
  }

  .lu-auth__pitch p {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--header-fg-2);
  }

  .lu-auth__points {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .lu-auth__points li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--header-fg);
  }

  .lu-auth__points span {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 14px;
    background: var(--header-chip);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .lu-auth__points svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--fg-2);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .lu-auth__legal {
    position: relative;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--header-fg-2);
  }

  .lu-auth__sheet {
    flex: 1 1 44%;
    margin-top: 0;
    border-radius: 0;
    padding: 48px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lu-auth__column {
    width: 100%;
    max-width: 440px;
    gap: 20px;
  }

  .lu-auth__column:has(.lu-pep-doc) { max-width: 680px; }

  .lu-card {
    padding: 32px 36px;
    border-radius: var(--r-sheet);
    gap: 20px;
  }

  .lu-card h1 {
    font-size: 28px;
    line-height: 34px;
  }

  .lu-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
  }

  .lu-auth__help {
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: var(--fg-muted);
  }
}

/* Способ входа на ПК: «Почта и пароль» · «Код в Пачке». */
.lu-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-btn);
  background: var(--surface-2);
}

@media (min-width: 1025px) {
  .lu-tabs { display: grid; }
}

.lu-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  color: var(--fg-label);
  text-decoration: none;
}

a.lu-tab:hover { background: var(--accent-soft); color: var(--fg-strong); }

.lu-tab[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 2px 8px rgba(139, 168, 2, 0.3);
}

/* Ноутбук с низким экраном: бренд-панель плотнее, чтобы влезала без прокрутки. */
@media (min-width: 1025px) and (max-height: 820px) {
  .lu-auth__header { padding: 32px 56px; gap: 24px; }
  .lu-auth__brand { gap: 18px; }
  .lu-auth__logo,
  .lu-auth__logo svg { width: 220px; }
  .lu-auth__pitch { gap: 14px; }
  .lu-auth__pitch h2 { font-size: 32px; }
  .lu-auth__pitch p { font-size: 16px; }
  .lu-auth__points { gap: 10px; margin-top: 4px; }
  .lu-auth__points span { width: 38px; height: 38px; border-radius: 12px; }
}

.lu-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--fg);
}

.lu-remember input {
  width: 22px;
  height: 22px;
  flex: none;
  accent-color: var(--ok);
}

.lu-pep {
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.35;
  padding: 12px 14px;
  border-radius: var(--r-input);
  background: var(--surface-2);
  cursor: pointer;
}

/* Пока соглашение не отмечено, «Войти» выглядит неактивной (браузер всё равно не отправит форму). */
.lu-card form:has(.lu-pep input:not(:checked)) .lu-btn--accent {
  background: var(--line-soft);
  color: var(--fg-muted);
  box-shadow: none;
}

.lu-pep input {
  margin-top: 1px;
}

.lu-pep a {
  color: var(--fg-2);
  font-weight: 700;
}

.lu-pep-doc h1 {
  font-size: 20px;
  line-height: 1.25;
}

.lu-pep-doc ol {
  margin: 0;
  padding-left: 22px;
}

.lu-pep-doc li {
  margin: 0 0 10px;
  line-height: 1.5;
}

.lu-pep-kicker {
  margin: 0 0 6px;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Планшет (общие брейкпоинты lunchup-ui: телефон < 600 · планшет 600–1024 · ПК >= 1025) ----------
   Шапка во всю ширину окна, полосы — repeating-linear-gradient (не картинка), нижнее скругление листа сохранено.
   Карточка min(480px, 100% - 32px) по центру, ссылки внутри карточки, 24px от шапки, касания >= 48px, база 17px. */
@media (min-width: 600px) and (max-width: 1024px) {
  body.lu-auth { font-size: 17px; line-height: 24px; }

  .lu-auth__frame { max-width: none; }

  .lu-auth__header {
    height: 300px;
    padding-right: max(24px, env(safe-area-inset-right));
    padding-left: max(24px, env(safe-area-inset-left));
  }

  .lu-auth__sheet {
    margin-top: -24px;
    padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
    align-items: center;
  }

  .lu-auth__column { width: 100%; align-items: center; }

  .lu-auth__column > * {
    width: min(480px, calc(100% - 32px));
    max-width: 480px;
    margin-inline: auto;
  }

  .lu-card { padding: 24px; }

  .lu-field input { height: 52px; }
  .lu-btn--accent { height: 56px; }
  .lu-btn--text,
  .lu-tab { min-height: 48px; }
  .lu-remember input { width: 24px; height: 24px; }
  .lu-remember,
  .lu-pep { min-height: 48px; }
}

/* Планшет в альбоме (1024×768): шапка ниже, чтобы форма не уезжала за экран. */
@media (min-width: 900px) and (max-width: 1024px) and (orientation: landscape) {
  .lu-auth__header { height: 220px; gap: 8px; }
  .lu-auth__logo,
  .lu-auth__logo svg { width: 180px; }
  .lu-auth__caption { font-size: 14px; }
}

/* Планшет в альбоме 1025–1280 попадает в раскладку ПК, но управляется пальцем: касания не ниже 48px. */
@media (min-width: 1025px) and (pointer: coarse) {
  .lu-tab,
  .lu-btn--text { min-height: 48px; }
}
