/* myprila.ru. Prila's palette (web/src/styles/app.css): petrol ink with an amber
   signal in dark, pale celadon with deep petrol in light; the system scheme picks. */
@font-face {
  font-family: 'Onest Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/onest-cyrillic-wght-normal.68e5e01d.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/onest-latin-wght-normal.052df745.woff2) format('woff2-variations');
  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: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/static/fonts/jetbrains-mono-cyrillic-wght-normal.d274604c.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/static/fonts/jetbrains-mono-latin-wght-normal.18be4527.woff2) format('woff2-variations');
  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 {
  color-scheme: dark;
  --bg: #0f2124;
  --surface: #162c30;
  --surface-2: #1f393e;
  --surface-3: #2a4950;
  --line: rgba(214, 238, 232, 0.12);
  --text: #e7efea;
  --muted: #94aba8;
  --accent: #f2c14e;
  --on-accent: #231a02;
  --danger: #f0806a;
  --ok: #7fd3a4;
  --warn: #f2c14e;
  --shadow: 0 18px 48px rgba(2, 10, 12, 0.42);
  --font-ui: 'Onest Variable', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono Variable', ui-monospace, Menlo, monospace;
  --radius: 20px;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #eef2ec;
    --surface: #fbfcf8;
    --surface-2: #e4ebe4;
    --surface-3: #d3ded6;
    --line: rgba(18, 48, 46, 0.14);
    --text: #12302e;
    --muted: #566f6c;
    --accent: #0f6e66;
    --on-accent: #f4fbf7;
    --danger: #b5371f;
    --ok: #1b7a50;
    --warn: #8a5a00;
    --shadow: 0 18px 48px rgba(22, 50, 47, 0.14);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* Header */
.top {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.mark {
  color: var(--accent);
  flex: none;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.top-nav a,
.top-nav .link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-nav a:hover,
.top-nav .link:hover {
  color: var(--text);
}

.top-nav form {
  margin: 0;
}

/* Main column */
.main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card.wide {
  max-width: 620px;
}

.card + .card {
  margin-top: 16px;
}

.card h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card h2 {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
}

/* A section heading inside a card stands apart from what came before. */
.card > h2:not(:first-child) {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.lead {
  color: var(--muted);
  font-size: 15.5px;
}

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

.small {
  font-size: 14px;
}

.steps {
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

/* Forms */
form {
  margin: 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  outline: 0;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
}

.field input[aria-invalid='true'] {
  border-color: var(--danger);
}

.field input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.hint {
  font-size: 13.5px;
  color: var(--muted);
}

.field-error,
.form-error {
  color: var(--danger);
  font-size: 14px;
}

.check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 14.5px;
  line-height: 1.45;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.check .field-error {
  grid-column: 2;
}

.otp {
  font-family: var(--font-mono);
  font-size: 20px !important;
  letter-spacing: 0.28em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--surface-3);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--text));
}

.btn-danger {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface-2));
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: default;
}

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alt {
  font-size: 14.5px;
  color: var(--muted);
  text-align: center;
}

.alt a {
  color: var(--text);
}

/* Notices: one fixed place in the card, under the title. */
.notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14.5px;
}

.notice.is-error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: var(--text);
}

.notice.is-ok {
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
}

/* A status line that changes text in place keeps its height. */
.status-line {
  min-height: 3em;
  font-size: 14.5px;
  color: var(--muted);
}

/* A choice inside a card (setup: passkey or app). */
.option {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.option .status-line {
  min-height: 1.5em;
}

.passkey {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.passkey .status-line {
  min-height: 1.4em;
  margin: 0;
  font-size: 13.5px;
  text-align: center;
}

/* «Нет доступа к ключу?» and similar: folded, opens in place. */
.more {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14.5px;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.more summary:hover {
  color: var(--text);
}

.more[open] summary {
  margin-bottom: 12px;
}

/* Lists of rows (account, devices, factors) */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.rows > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.rows > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.rows .row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rows .row-main b {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.rows .row-main span {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.rows form {
  flex: none;
}

.nav-rows > li {
  padding: 0;
}

.row-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 10px 0;
  text-decoration: none;
}

.row-link:hover b {
  text-decoration: underline;
}

.row-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.btn-compact {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 14.5px;
  white-space: nowrap;
}

.chev {
  color: var(--muted);
  flex: none;
}

.kv {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 10px 16px;
  margin: 0;
  font-size: 15px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.address {
  font-variant-numeric: tabular-nums;
}

/* On a phone the label sits over its value, so long values keep the full width. */
@media (max-width: 480px) {
  .kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .kv dt {
    font-size: 13.5px;
  }

  .kv dd + dt {
    margin-top: 10px;
  }
}

/* Recovery codes, invite codes */
.codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  margin: 0;
  padding: 16px;
  list-style: none;
  border-radius: 14px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.04em;
}

.code-once {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.08em;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
  user-select: all;
}

.qr {
  align-self: center;
  width: 216px;
  height: 216px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.secret {
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Landing: portal/static/landing.css, loaded by that page alone. */

/* Documents */
.doc {
  max-width: 720px;
}

.doc-body {
  font-size: 15.5px;
  line-height: 1.6;
}

.doc-body h2 {
  margin: 1.4em 0 0.5em;
  font-size: 18px;
}

.doc-body p,
.doc-body ul,
.doc-body ol {
  margin: 0 0 0.8em;
}

/* Admin */
.admin {
  width: 100%;
  max-width: 1080px;
}

.admin .card {
  max-width: none;
}

.stat b.word {
  font-size: 17px;
  line-height: 1.6;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.admin-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 14.5px;
}

.admin-nav a[aria-current='page'] {
  background: var(--surface-2);
  border-color: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.stat {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
}

.stat b {
  display: block;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--muted);
  font-size: 13.5px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

td.num {
  font-variant-numeric: tabular-nums;
}

/* Releases: one card per version; its state lines keep their place as a rollout runs. */
.release {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.release-head b {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.release-notes {
  margin: 0;
  white-space: pre-line;
  font-size: 14.5px;
}

.release-state {
  margin: 0;
  font-size: 14.5px;
}

.release-state.is-ok {
  color: var(--ok);
}

.release-state.is-error {
  color: var(--danger);
}

.release-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.release-actions form {
  margin: 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.inline-form .field {
  flex: 1 1 140px;
}

/* Footer */
.foot {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px var(--gutter) max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.foot-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.foot a {
  color: var(--muted);
}

.foot a:hover {
  color: var(--text);
}

/* The captcha widget sits in the form's flow with a fixed height, in our colours. */
.captcha {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

altcha-widget {
  display: block;
  min-height: 58px;
  --altcha-max-width: 100%;
  --altcha-border-radius: 12px;
  --altcha-border-width: 1px;
  --altcha-border-color: var(--line);
  --altcha-color-base: var(--surface-2);
  --altcha-color-base-content: var(--text);
  --altcha-color-primary: var(--accent);
  --altcha-color-success: var(--ok);
  --altcha-color-error: var(--danger);
  --altcha-color-neutral: var(--muted);
  --altcha-checkbox-border-radius: 6px;
  --altcha-shadow: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .card h1 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
