@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/playfair-display-700-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/playfair-display-700-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --radius-card: 8px;
  --radius-field: 6px;
  --radius-button: 6px;
  --control: 48px;
  --danger: #b42318;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-ui);
  color-scheme: light;
}
html[data-shape="pill"] {
  --radius-card: 24px;
  --radius-field: 16px;
  --radius-button: 99px;
  --control: 54px;
}
html[data-display="Playfair Display"] {
  --font-display: "Playfair Display", Georgia, serif;
}

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

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.login {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 0;
}
.mark {
  flex: none;
  width: 36px;
  height: 42px;
}
.mark-default {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-field);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
html[data-display] .brand-name {
  font-weight: 700;
  font-size: 28px;
}
.brand-caption {
  margin-top: 2px;
  color: var(--ink2);
  font-size: 14px;
}

.card {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
html[data-shape="pill"] .card {
  border-color: transparent;
  box-shadow:
    0 1px 2px rgba(31, 26, 30, 0.04),
    0 8px 24px rgba(31, 26, 30, 0.06);
}

.step {
  display: none;
}
.login[data-state="phone"] [data-step="phone"],
.login[data-state="code"] [data-step="code"],
.login[data-state="consent"] [data-step="consent"],
.login[data-state="done"] [data-step="done"],
.login[data-state="delete"] [data-step="delete"] {
  display: grid;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}
.hint {
  margin: -6px 0 0;
  color: var(--ink2);
}
.hint b {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 6px;
}
.field span {
  color: var(--ink2);
  font-size: 14px;
  font-weight: 600;
}
.field input {
  width: 100%;
  height: var(--control);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--ink);
  font: 600 18px / 1 var(--font-ui);
}
.field input[name="code"] {
  font-size: 24px;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.field input:focus-visible,
button:focus-visible,
a:focus-visible,
.check input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

button {
  font: inherit;
  cursor: pointer;
}
.primary,
.secondary {
  width: 100%;
  min-height: var(--control);
  padding: 0 20px;
  border-radius: var(--radius-button);
  font-weight: 700;
  font-size: 17px;
}
.primary {
  border: 0;
  background: var(--accent);
  color: #fff;
}
.primary:active {
  background: var(--accent-ink);
}
.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent-ink);
}
a.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.primary.danger {
  background: #b3261e;
}
.link.danger {
  justify-self: center;
  min-height: 44px;
  color: #b3261e;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: var(--radius-field);
  background: var(--accent-soft);
  font-size: 15px;
}
.check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}
.check a {
  color: var(--accent-ink);
  font-weight: 600;
}

.error {
  min-height: 1.45em;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 15px;
  font-weight: 600;
}
.error:empty {
  margin: 0;
  min-height: 0;
}

.foot {
  margin-top: auto;
  color: var(--ink2);
  font-size: 13px;
  text-align: center;
}

.busy .primary {
  opacity: 0.7;
  pointer-events: none;
}
