/* Вход, регистрация, восстановление — в стиле сайта assisted.su:
   светлая тема — лист в клетку с красной линией полей,
   тёмная (по системе) — школьная доска. */
@font-face { font-family: "Onest"; font-weight: 400 800; font-display: swap;
  src: url(/static/fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400 800; font-display: swap;
  src: url(/static/fonts/onest-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Caveat"; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/caveat-cyrillic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Caveat"; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/caveat-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --paper: #fbfcfe; --paper-2: #eef2fb; --card: #fff;
  --grid: rgba(47, 79, 216, .075); --margin-line: rgba(216, 67, 59, .38);
  --ink: #18233f; --ink-2: #4a5673; --ink-3: #6b7690; --line: #d5dcea;
  --accent: #2f4fd8; --accent-hover: #2340bd; --accent-ink: #fff; --accent-soft: rgba(47, 79, 216, .14);
  --pen: #d8433b; --good: #1d8b5b; --err: #c0362c; --err-bg: #fdeeec; --ok-bg: #e8f6ef;
  --shadow: 0 1px 2px rgba(24, 35, 63, .06), 0 24px 48px -24px rgba(24, 35, 63, .3);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b2924; --paper-2: #21332c; --card: #243830;
    --grid: rgba(236, 242, 234, .045); --margin-line: rgba(255, 138, 122, .35);
    --ink: #eef3ec; --ink-2: #b1c2b8; --ink-3: #8fa398; --line: #3b5247;
    --accent: #f2c94c; --accent-hover: #f7d977; --accent-ink: #1b2924; --accent-soft: rgba(242, 201, 76, .2);
    --pen: #ff8a7a; --good: #7fd6a6; --err: #ff9b8f; --err-bg: rgba(255, 138, 122, .12); --ok-bg: rgba(127, 214, 166, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 24px 48px -22px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink);
  font: 400 16px/1.55 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100dvh; }

/* Левая половина — форма */
.side-form { position: relative; display: flex; flex-direction: column; padding: 28px 48px 32px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font-weight: 800; font-size: 20px; letter-spacing: -.02em; border-radius: 10px; }
.brand svg { width: 32px; height: 32px; flex: none; }
.to-site { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.to-site:hover { color: var(--ink); background: var(--paper-2); }
.to-site svg { width: 16px; height: 16px; }

.form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 36px 0; }
.card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 36px 36px 30px; box-shadow: var(--shadow); }
h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; text-wrap: balance; }
.sub { margin: 0 0 24px; color: var(--ink-2); }

.field { margin-top: 18px; }
.field:first-of-type { margin-top: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
label.lbl { font-weight: 600; font-size: 15px; }
.label-row a { font-size: 14px; font-weight: 500; }
.input { position: relative; }
.input input {
  width: 100%; height: 52px; padding: 0 16px; font: inherit; font-size: 16.5px; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
.input input::placeholder { color: var(--ink-3); }
.input input:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--card); }
.input.has-toggle input { padding-right: 112px; }
.toggle {
  position: absolute; right: 6px; top: 6px; height: 40px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2); font: 600 14px/1 "Onest", system-ui, sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.toggle:hover { background: var(--paper-2); color: var(--ink); }
.toggle svg { width: 18px; height: 18px; }
.hint { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--ink-3); }
.hint svg { width: 16px; height: 16px; flex: none; opacity: .5; }
.hint.met { color: var(--good); }
.hint.met svg { opacity: 1; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0;
  border: 1.5px solid var(--line); border-radius: 6px; background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.check input:hover { border-color: var(--accent); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 11px; height: 6px; border: solid var(--accent-ink); border-width: 0 0 2.5px 2.5px;
  transform: translateY(-1px) rotate(-45deg); }
.check input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 24px;
  padding: 0 22px; border: 0; border-radius: 12px; font: 700 16.5px/1.2 "Onest", system-ui, sans-serif; cursor: pointer;
  text-decoration: none; transition: background-color .15s, transform .05s, box-shadow .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn[disabled] { opacity: .75; cursor: progress; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; display: none; }
.btn.busy .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 0 0 18px; font-size: 15px; }
.msg svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.err { background: var(--err-bg); color: var(--err); }
.ok { background: var(--ok-bg); color: var(--good); }

.alt { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-2); font-size: 15px; }
.alt a { font-weight: 600; }
.small { margin: 16px 0 0; text-align: center; color: var(--ink-3); font-size: 14px; }

/* Письмо отправлено */
.mail-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.mail-ico svg { width: 32px; height: 32px; }
.addr { font-weight: 700; color: var(--ink); word-break: break-all; }
.steps-mini { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.steps-mini li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); font-size: 15px; }
.steps-mini li::before { counter-increment: s; content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--pen); color: var(--pen); display: grid; place-items: center; font: 700 16px/1 "Caveat", cursive; }

.foot-note { text-align: center; color: var(--ink-3); font-size: 13.5px; }
.foot-note a { color: var(--ink-3); }

/* Правая половина — витрина */
.side-show {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 30px;
  padding: 56px 56px 56px 64px; background: var(--paper-2); border-left: 1px solid var(--line);
}
.side-show h2 { margin: 0; font-size: 34px; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; max-width: 17ch; text-wrap: balance; }
.perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.perks li { display: flex; gap: 12px; align-items: flex-start; font-size: 16.5px; }
.perks svg { width: 22px; height: 22px; flex: none; color: var(--good); margin-top: 1px; }
.shot { position: relative; margin: 26px -120px 0 0; }
.shot img { display: block; width: 100%; max-width: 760px; height: auto; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: var(--shadow); transform: rotate(-1.2deg); }
.pen { position: absolute; font: 700 25px/1 "Caveat", cursive; color: var(--pen); white-space: nowrap; }
.pen-a { top: -34px; left: 26px; transform: rotate(-3deg); }

@media (max-width: 1020px) {
  .auth { grid-template-columns: 1fr; }
  .side-show { display: none; }
}
@media (max-width: 560px) {
  body { background-size: 20px 20px; }
  .side-form { padding: 14px 16px 24px; }
  .to-site { padding: 0 10px; }
  .form-wrap { align-items: flex-start; padding: 18px 0 28px; }
  .card { padding: 26px 20px 22px; border-radius: 18px; }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn .spin { animation-duration: 2s; }
  .shot img { transform: none; }
}
