:root {
  --accent: #12b0e8;
  --accent-hover: #0d9fd4;
  --card-bg: #ffffff;
  --ink: #2f2f2f;
  --field-bg: #ececec;
  --field-bg-focus: #e2e2e2;
  --muted: #9b9b9b;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Тёмный фон с «плетёным» узором, как на макете. */
.auth-page {
  background-color: #0e0e0e;
  background-image: url("pattern.svg");
  background-size: 64px 64px;
  background-repeat: repeat;
}

.welcome-page {
  background: #ffffff;
}

/* ---------- Карточка формы ---------- */

.card {
  width: min(520px, 100%);
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.card__title {
  margin: 0;
  padding: 26px 32px 22px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: center;
  color: #333;
  border-bottom: 1px solid #ececec;
}

.card__body {
  padding: 26px 30px 34px;
}

/* ---------- Сообщения об ошибках ---------- */

.messages {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.messages__item {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.messages__item--error {
  background: #fdecec;
  color: #b3261e;
  border: 1px solid #f6d3d1;
}

/* ---------- Поля ---------- */

.form { display: block; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.field__icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: #b4b4b4;
  pointer-events: none;
}

.field__input {
  width: 100%;
  height: 44px;
  padding: 0 46px 0 46px;
  border: 0;
  border-radius: 22px;
  background: var(--field-bg);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: background 0.15s ease;
}

.field__input::placeholder { color: var(--muted); }

.field__input:focus { background: var(--field-bg-focus); box-shadow: 0 0 0 2px rgba(18, 176, 232, 0.35); }

.field__input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 44px var(--field-bg) inset;
  caret-color: var(--ink);
}

.field__hint {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #c9c9c9;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  cursor: pointer;
  padding: 0;
}

.field__hint:hover { background: #b6b6b6; }

/* ---------- Строка «Запомнить» + кнопка ---------- */

.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox__box {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #d2d2d2;
  background: #ffffff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.checkbox__box svg { width: 14px; height: 14px; }

.checkbox input:checked + .checkbox__box {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.checkbox input:focus-visible + .checkbox__box {
  box-shadow: 0 0 0 3px rgba(18, 176, 232, 0.4);
}

.checkbox__label { font-size: 14px; color: #444; }

.submit {
  border: 0;
  border-radius: 22px;
  padding: 12px 26px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

/* ---------- Страница после входа ---------- */

.welcome { text-align: center; }

.welcome__text {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  color: #2f2f2f;
}

.field__visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .card__title { font-size: 22px; padding: 20px 20px 16px; }
  .card__body { padding: 20px 18px 26px; }
  .form__row { flex-direction: column; align-items: stretch; }
  .submit { align-self: flex-end; }
}
