/* BEM: auth-page — экран логина/регистрации */

:root {
  --fon: #f9cdd5;
  --button: #7a8450;
  --field: #fadde2;
  --micro: #ff9d9d;
  /* тень полей: y 4px, blur 4px, #000 25% */
  --field-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  /* inner shadow при фокусе поля */
  --field-inner-shadow-focus: inset 0 3px 10px rgba(0, 0, 0, 0.32), inset 0 1px 2px rgba(0, 0, 0, 0.2);
  --auth-radius-pill: 20px;
  --auth-card-max: 720px;
  /* единый шаг между блоками (поля / кнопка / футер) */
  --auth-stack-gap: 45px;
  /* внутри группы «лейбл + поле» */
  --auth-field-inner-gap: 8px;
  /* текст на кнопке (контраст к --button) */
  --auth-submit-text: #ffffff;
  /* объём кнопки: «ход» нажатия и inner shadow при :active */
  --auth-submit-depth: 5px;
  --auth-submit-inner-active: inset 0 5px 14px rgba(0, 0, 0, 0.32),
    inset 0 -2px 8px rgba(0, 0, 0, 0.12);
  --auth-submit-lip: #5f683f;
  --form-ui-label-size: 20px;
  --form-ui-input-size: 20px;
  --form-ui-input-padding-y: 0.85rem;
  --form-ui-input-padding-x: 1.25rem;
  --form-ui-input-radius: 20px;
  --form-ui-submit-size: 20px;
  --form-ui-submit-padding-y: 0.9rem;
  --form-ui-submit-padding-x: 1.5rem;
  --form-ui-submit-radius: 20px;
  --form-ui-field-bg: var(--field);
  --form-ui-text: var(--button);
  --form-ui-shadow: var(--field-shadow);
  --form-ui-focus-shadow: var(--field-inner-shadow-focus);
  --form-ui-submit-text: var(--auth-submit-text);
  --form-ui-submit-bg: linear-gradient(180deg, #9aa664 0%, var(--button) 45%, #687244 100%);
  --form-ui-submit-lip: var(--auth-submit-lip);
  --form-ui-submit-depth: var(--auth-submit-depth);
  --form-ui-submit-inner-active: var(--auth-submit-inner-active);
}

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

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Inder", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.35;
  background: var(--fon);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 1rem 1rem !important;
}

.auth-page__card {
  width: 100%;
  max-width: var(--auth-card-max);
  background: var(--fon);
  padding: 0 2rem 2rem;
  margin-top: 0 !important;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--auth-stack-gap);
}

.auth-page__title {
  margin: 0;
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--button);
  text-decoration: none;
}

.auth-page__form {
  display: flex;
  flex-direction: column;
  gap: var(--auth-stack-gap);
}

.auth-page__field {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--auth-field-inner-gap);
}

.auth-page__label {
  display: block;
  margin: 0;
  padding-left: 20px;
  font-size: 20px;
  font-weight: 400;
  color: var(--button);
  text-decoration: none;
}

/* Контейнер поля: внешняя тень; при фокусе — только inner, без drop */
.auth-page__input-shell {
  border-radius: var(--auth-radius-pill);
  background: var(--field);
  box-shadow: var(--field-shadow);
  overflow: hidden;
}

.auth-page__input-shell:focus-within {
  box-shadow: var(--field-inner-shadow-focus), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.auth-page__input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 20px;
  font-weight: 400;
  font-family: inherit;
  border: none;
  border-radius: var(--auth-radius-pill);
  background: transparent;
  box-shadow: none;
  outline: none;
}

.auth-page__submit {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0.9rem 1.5rem;
  font-size: 20px;
  font-weight: 400;
  font-family: inherit;
  color: var(--auth-submit-text);
  background: var(--form-ui-submit-bg);
  border: none;
  border-radius: var(--auth-radius-pill);
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 var(--auth-submit-depth) 0 var(--auth-submit-lip),
    0 8px 18px rgba(0, 0, 0, 0.22);
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Убираем системный голубой фон автозаполнения в Chrome/Edge. */
.auth-page__input:-webkit-autofill,
.auth-page__input:-webkit-autofill:hover,
.auth-page__input:-webkit-autofill:focus {
  -webkit-text-fill-color: #000;
  transition: background-color 9999s ease-out 0s;
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset;
  box-shadow: 0 0 0 1000px var(--field) inset;
}

.auth-page__input-shell:focus-within .auth-page__input:-webkit-autofill,
.auth-page__input-shell:focus-within .auth-page__input:-webkit-autofill:hover,
.auth-page__input-shell:focus-within .auth-page__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset, var(--field-inner-shadow-focus);
  box-shadow: 0 0 0 1000px var(--field) inset, var(--field-inner-shadow-focus);
}

/* блик слева направо под углом (поверх грани, под текстом в порядке наслоения — см. ::after) */
.auth-page__submit::after {
  content: "";
  position: absolute;
  top: -30%;
  left: 0;
  width: 38%;
  height: 160%;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 48%,
    rgba(255, 255, 255, 0) 96%
  );
  transform: translateX(-140%) skewX(-18deg);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

.auth-page__submit:hover {
  /* наполовину «вжата» относительно полного хода */
  transform: translateY(calc(var(--auth-submit-depth) * 0.5));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1),
    0 calc(var(--auth-submit-depth) * 0.5) 0 var(--auth-submit-lip),
    0 5px 12px rgba(0, 0, 0, 0.18);
}

.auth-page__submit:hover::after {
  opacity: 1;
  animation: auth-page-submit-shine 0.75s ease-out both;
}

.auth-page__submit:active {
  transform: translateY(var(--auth-submit-depth));
  box-shadow: var(--auth-submit-inner-active);
}

.auth-page__submit:active::after {
  animation: none;
  opacity: 0;
}

@keyframes auth-page-submit-shine {
  to {
    transform: translateX(320%) skewX(-18deg);
  }
}

.auth-page__submit:focus-visible {
  outline: 2px solid var(--button);
  outline-offset: 3px;
  z-index: 1;
}

.auth-page__footer {
  margin: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 400;
}

/* «Вход» / «Регистрация» в футере — ссылки с подчёркиванием */
a.auth-page__link {
  text-decoration: underline;
  text-underline-offset: 4px;
}

span.auth-page__link {
  text-decoration: none;
}

.auth-page__link {
  color: var(--button);
  font-weight: 400;
  cursor: pointer;
}

.auth-page__link:hover,
.auth-page__link:focus-visible {
  color: var(--button);
  filter: brightness(0.92);
}

.auth-page__link:focus-visible {
  outline: 2px solid var(--button);
  outline-offset: 2px;
  border-radius: 2px;
}

.auth-page__sep {
  margin: 0 0.35rem;
  color: var(--button);
}

.auth-page__error {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  display: none;
}

.auth-page__error--visible {
  display: block;
}

/* Согласия: две отдельные строки; внутри строки — grid «чекбокс | текст» (без слипания в один ряд). */
.auth-page__form > .auth-page__agreements,
.auth-page__agreements {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.auth-page__agreement-row {
  display: block;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.auth-page__agreement {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.65rem;
  row-gap: 0.25rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--button);
  font-size: 18px;
  line-height: 1.35;
}

.auth-page__agreement-text {
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.auth-page__checkbox {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  accent-color: var(--button);
  align-self: start;
}

.auth-page__doc-subtitle {
  margin: 1.25rem 0 0.75rem;
  text-align: left;
  font-size: 28px;
  font-weight: 700;
  color: var(--button);
}

