/* Slevin Mail: sign-up / sign-in / recovery page on the account origin (/mail-authorize).
   Modelled on how large mail services build sign-in in 2026 (Proton, Fastmail): the brand colour fills the page,
   a logo bar on top, one confident white card in the middle, nothing else around it. Inside the card: a big heading,
   labelled fields, one full-width primary button, a switch line. Postal blue is ours. */

:root {
  --sky-1: #0a2257;
  --sky-2: #0f3a90;
  --sky-3: #2463d6;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #475063;
  --ink-3: #6b7385;
  --line: #e4e8ef;
  --field: #c9d1de;
  --field-bg: #f8fafc;
  --hover: #f1f5fb;
  --brand: #1747b8;
  --brand-2: #0f3a90;
  --focus: rgb(23 71 184 / .2);
  --seal: #f4e736;
  --on-seal: #0d1a32;
  --danger: #b42339;
  --danger-tint: #fdeef0;
  --ok: #1f8a5b;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-block-size: 100vh; display: flex; flex-direction: column; font: 15px/1.5 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 600px at 85% -10%, rgb(73 140 255 / .45), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgb(36 99 214 / .35), transparent 60%),
    linear-gradient(170deg, var(--sky-2) 0%, var(--sky-1) 100%);
  background-attachment: fixed; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
h1, p { margin: 0; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Logo bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; block-size: 72px; padding-inline: 32px; }
.mark { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.mark__logo { inline-size: 32px; block-size: 32px; flex: none; border-radius: 8px; background: #fff; padding: 2px; }
.mark__word { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.mark__product { font-size: 19px; font-weight: 400; color: rgb(255 255 255 / .75); margin-inline-start: -4px; }
.top__link { color: rgb(255 255 255 / .8); font-size: 14px; font-weight: 500; text-decoration: none; }
.top__link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.top :focus-visible { outline-color: #fff; }

/* ---------- Card ---------- */
.auth { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px 96px; }
.auth__card { inline-size: 100%; max-inline-size: 400px; padding: 32px 32px 24px; border-radius: 16px; background: var(--card);
  box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 2px 6px rgb(5 20 60 / .12), 0 30px 80px -20px rgb(3 14 45 / .55); }
.auth h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; margin-block-end: 20px; }
.auth h1:has(+ .auth__lead) { margin-block-end: 6px; }
.auth__lead { color: var(--ink-2); margin-block-end: 20px; }

/* ---------- Buttons and links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 44px; padding: 0 18px;
  border: 0; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--field);
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink); cursor: pointer; transition: background-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgb(15 58 144 / .3), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn--primary:hover { background: var(--brand-2); }
.btn--block { inline-size: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.link { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.switch { margin-block-start: 20px; padding-block-start: 16px; border-block-start: 1px solid var(--line); text-align: center; color: var(--ink-2); }

/* ---------- Fields ---------- */
.field { display: grid; gap: 5px; margin-block-end: 14px; }
.field > label, .field__top label { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.field + .btn, .error + .btn { margin-block-start: 6px; }
.field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__top .link { font-size: 14px; }
.input { inline-size: 100%; min-block-size: 44px; padding: 0 14px; border: 1px solid var(--field); border-radius: var(--r); background: var(--field-bg); transition: border-color .15s, box-shadow .15s, background-color .15s; }
.input:hover { border-color: #a9b4c6; }
.input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--focus); }
/* Address: name, then "@domain" from the list as a suffix inside the same field */
.addr { display: flex; align-items: center; border: 1px solid var(--field); border-radius: var(--r); background: var(--field-bg); overflow: hidden; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.addr:hover { border-color: #a9b4c6; }
.addr:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--focus); }
.addr .input { flex: 1 1 auto; min-inline-size: 5ch; border: 0; background: none; box-shadow: none; }
.addr__at { color: var(--ink-3); }
.addr__domain { flex: none; align-self: stretch; max-inline-size: 70%; margin: 0; padding: 0 34px 0 2px; border: 0; background: transparent; color: var(--ink-2); font-weight: 500;
  cursor: pointer; appearance: none; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 18px top 52%, right 13px top 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.addr__domain:hover, .addr__domain:focus { outline: none; color: var(--ink); }
.addr__domain:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
/* Password with show/hide */
.pw { position: relative; display: block; }
.pw .input { padding-inline-end: 48px; }
.pw__eye { position: absolute; inset-block: 0; inset-inline-end: 4px; inline-size: 40px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 8px; }
.pw__eye:hover { color: var(--ink); }
.pw__eye svg { inline-size: 20px; block-size: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pw__eye[aria-pressed="true"] { color: var(--brand); }
.hint { color: var(--ink-3); font-size: 13px; }

/* Messages */
.error, .notice { padding: 11px 14px; margin-block-end: 16px; border-radius: var(--r); font-size: 14px; }
.error { background: var(--danger-tint); color: var(--danger); }
.notice { background: var(--hover); color: var(--ink); }

/* Loading */
.spin { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; }
.spin::before { content: ""; inline-size: 18px; block-size: 18px; border-radius: 50%; border: 2px solid var(--line); border-inline-end-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
#loading { display: grid; place-items: center; gap: 18px; min-block-size: 180px; text-align: center; color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin::before { animation: none; } }

/* ---------- Working ---------- */
.progress { display: grid; gap: 16px; margin: 24px 0 6px; padding: 0; list-style: none; }
.progress li { display: flex; gap: 12px; align-items: center; color: var(--ink-3); font-size: 15.5px; }
.progress li::before { content: ""; display: grid; place-items: center; inline-size: 24px; block-size: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); flex: none; font-size: 12px; font-weight: 700; }
.progress li[data-state="active"] { color: var(--ink); font-weight: 600; }
.progress li[data-state="active"]::before { box-shadow: none; border: 2px solid var(--line); border-inline-end-color: var(--brand); animation: spin .8s linear infinite; }
.progress li[data-state="done"] { color: var(--ink-2); }
.progress li[data-state="done"]::before { content: "✓"; background: var(--ok); color: #fff; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .progress li[data-state="active"]::before { animation: none; } }

/* ---------- Recovery file ---------- */
.kit { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; margin-block-end: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--field-bg); }
.kit::before { content: ""; grid-row: span 2; inline-size: 32px; block-size: 40px; border-radius: 4px 10px 4px 4px; background: linear-gradient(225deg, var(--field) 9px, #fff 9px); box-shadow: inset 0 0 0 1px var(--field); }
.kit__name { font: 600 13.5px var(--mono); word-break: break-all; }
.kit__note { color: var(--ink-2); font-size: 13.5px; }

.drop { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; min-block-size: 72px; padding: 14px 16px;
  border: 1.5px dashed var(--field); border-radius: 12px; background: var(--field-bg); cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop:hover { border-color: var(--brand); background: #fff; }
.drop:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; inline-size: 100%; }
.drop::before { content: ""; grid-row: span 2; inline-size: 30px; block-size: 36px; border-radius: 4px 10px 4px 4px; background: linear-gradient(225deg, var(--field) 8px, #fff 8px); box-shadow: inset 0 0 0 1px var(--field); }
.drop__title { font-weight: 600; }
.drop__sub { color: var(--ink-3); font-size: 13px; }
.drop:has(input:valid) .drop__sub { display: none; }
.drop:has(input:valid) { border-style: solid; background: #fff; }
.drop:has(input:valid)::before { grid-row: auto; content: "✓"; display: grid; place-items: center; color: #fff; font-weight: 700; background: var(--ok); box-shadow: none; }
#recover-address:not(:empty) { color: var(--ink-2); }
#recover-address:not(:empty)::before { content: "Адрес: "; }

@media (max-width: 520px) {
  .top { padding-inline: 16px; block-size: 60px; }
  .top__link { display: none; }
  .auth { justify-content: flex-start; padding: 4px 12px 24px; }
  .auth__card { padding: 28px 22px 24px; }
  .auth h1 { font-size: 24px; }
}
