/* web_auth: the sign-in page (bare) and «Ты» → «Вход в браузере». Solid content only (no glass), the shell's tokens,
 * scoped under .wa / .wa-*, logical properties only (RTL-ready). The screen gives the 16 px gutter at compact and the
 * bare frame on the big screen (shell.css: a centred card); the sign-in card is ≤ 440 there (contract §8.4).
 * Red is never used here except by the hold-to-confirm «Выйти везде» (a destructive action). Targets ≥ 44 pt. */

/* ---------- the sign-in page ---------- */
.wa-signin { display: flex; flex-direction: column; min-height: calc(100vh - var(--sat) - var(--sab) - 64px); }
.wa-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-block: auto 0; padding-block: 24px 4px; width: 100%;
}
.wa-icon {
  display: block; width: 72px; height: 72px; border-radius: 18px;
  box-shadow: 0 6px 20px rgb(var(--accent-rgb) / 0.22);
}
.wa-title {
  margin: 18px 0 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.wa-lead { margin: 8px 0 0; max-width: 34ch; font-size: 16px; line-height: 1.4; color: var(--subtitle); }

.wa-line {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; margin-top: 20px; padding: 12px 14px;
  border-radius: 14px; background: var(--bg2); text-align: start;
}
.wa-line-ico { flex: none; display: grid; place-items: center; width: 24px; height: 24px; color: var(--hint); }
.wa-line-ico .ico { width: 20px; height: 20px; }
.wa-line.wa-warn { box-shadow: inset 0 0 0 1.5px rgb(var(--accent-rgb) / 0.45); }
.wa-line.wa-warn .wa-line-ico { color: var(--accent); }
.wa-line-text { margin: 0; min-width: 0; font-size: 15px; line-height: 1.4; color: var(--text); overflow-wrap: anywhere; }

/* «Это мой компьютер»: the whole row is the target (≥ 44 pt), the native checkbox stays for keyboards and readers */
.wa-check {
  position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 44px;
  margin-top: 20px; padding: 12px 14px; border-radius: 14px; background: var(--bg2); text-align: start; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wa-check-input {
  position: absolute; inset-block-start: 12px; inset-inline-start: 14px; width: 24px; height: 24px; margin: 0;
  opacity: 0; cursor: pointer;
}
.wa-check-box {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  box-shadow: inset 0 0 0 1.75px rgb(var(--text-rgb) / 0.28); color: transparent;
  transition: background-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}
.wa-check-box .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.wa-check-input:checked + .wa-check-box { background: var(--accent); box-shadow: none; color: var(--accent-text); }
.wa-check-input:focus-visible + .wa-check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.wa-check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-check-title { font-size: 16px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.wa-check-sub { font-size: 13px; line-height: 1.35; color: var(--hint); overflow-wrap: anywhere; }

/* Telegram's button: its iframe is ≤ 40 px tall; the place is kept so nothing jumps while it loads */
.wa-widget { display: grid; place-items: center; width: 100%; min-height: 52px; margin-top: 16px; }
.wa-widget iframe { display: block; max-width: 100%; border: 0; color-scheme: light dark; }
.wa-widget .btn { width: 100%; }

.wa-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; }
.wa-actions .btn-large { width: 100%; }
.wa-actions .btn { min-height: 44px; }
.wa-quiet { margin: 16px 0 0; max-width: 38ch; font-size: 13px; line-height: 1.4; color: var(--hint); }
/* under «Выход выполнен»: Telegram's own sign-in in this browser — read with the line above it, aligned with its text */
.wa-hint { margin-top: 10px; max-width: none; padding-inline: 14px; text-align: start; overflow-wrap: anywhere; }
.wa-foot { display: flex; justify-content: center; margin-top: auto; padding-block: 24px 0; }
.wa-foot .btn { min-height: 44px; }

/* ---------- «Ты» → «Вход в браузере» ---------- */
.wa-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 8px 4px; }
.wa-hero-ico {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
  background: rgb(var(--accent-rgb) / 0.14); color: var(--accent);
}
.wa-hero-ico .ico { width: 30px; height: 30px; stroke-width: 1.7; }
.wa-hero-title { margin: 12px 0 0; font-size: 22px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.wa-hero-body { margin: 6px 0 0; max-width: 38ch; font-size: 15px; line-height: 1.4; color: var(--subtitle); }
.wa-page .group { margin-top: 18px; }
.wa-note { margin: 0; padding: 14px 16px; font-size: 15px; line-height: 1.4; color: var(--text); }
.wa-out, .wa-copy-btn { flex: none; min-height: 44px; min-width: 44px; }
.wa-page .row-title.wa-host { overflow-wrap: normal; word-break: keep-all; }
.wa-hold { padding: 12px 16px 16px; }
.wa-hold .hold { width: 100%; }
.wa-footer { margin: 18px 4px 0; font-size: 13px; line-height: 1.4; color: var(--hint); text-align: center; }
.wa-copy { display: flex; flex-direction: column; gap: 10px; }
.wa-copy-hint { margin: 0 4px; font-size: 15px; line-height: 1.4; color: var(--subtitle); }
.wa-copy-field {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--bg2);
  color: var(--text); font: inherit; font-size: 16px; -webkit-user-select: text; user-select: text;
}

/* ---------- the big screen (medium / wide): the bare frame is a centred card; the sign-in one is ≤ 440 ---------- */
:root:not([data-layout="compact"])[data-bare] .screen[data-screen="web_auth.signin"] { max-inline-size: 440px; }
/* Its top padding is the bare card's own (shell.css keeps the back button's room off every bare card). */
:root:not([data-layout="compact"]) .wa-signin { min-height: 0; }
:root:not([data-layout="compact"]) .wa-card { padding-block: 8px 0; }
:root:not([data-layout="compact"]) .wa-foot { padding-block: 20px 0; }
:root:not([data-layout="compact"]) .wa-actions .btn-large,
:root:not([data-layout="compact"]) .wa-widget .btn { width: 100%; }

/* ---------- release 12 «Вход до звонка»: the corner chip and the warning banner (a browser's temporary sign-in) ----------
 * Fixed, solid (no glass), above the content and the sidebar, below sheets (20) and toasts (30). The chip sits at the
 * inline START of the content's bottom — the sticky action bar's buttons are at its end — and keeps the toasts' height
 * rules (shell.css): above the floating tab bar at compact, above the «Next class» capsule when it shows, low when the
 * chrome has stepped down. Never on a bare page (the sign-in, the policy). */
.wa-bell-chip {
  position: fixed; z-index: 12; display: inline-flex; align-items: center; gap: 6px;
  max-inline-size: min(420px, calc(100vw - 32px - var(--sal) - var(--sar)));
  inset-block-end: calc(var(--sab) + 12px + var(--tabbar-h) + var(--float-gap)); inset-inline-start: calc(var(--sal) + 16px);
  padding: 6px 12px 6px 9px; border-radius: 999px; background: var(--bg2); color: var(--text);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.12), inset 0 0 0 0.5px var(--sep);
  font-size: 13px; line-height: 1.3; font-weight: 500; pointer-events: none;
}
.wa-bell-chip .wa-bell-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-bell-ico { flex: none; display: grid; place-items: center; width: 18px; height: 18px; color: var(--accent); }
.wa-bell-ico .ico { width: 16px; height: 16px; }
:root[data-accessory] .wa-bell-chip {
  inset-block-end: calc(var(--sab) + 12px + var(--tabbar-h) + 2 * var(--float-gap) + var(--cap-h));
}
:root[data-chrome-down] .wa-bell-chip, :root:not([data-layout="compact"]) .wa-bell-chip {
  inset-block-end: calc(var(--sab) + 16px);
}
:root:not([data-layout="compact"]):not([data-sidebar])[data-accessory]:not([data-chrome-down]) .wa-bell-chip {
  inset-block-end: calc(var(--sab) + 12px + var(--cap-h) + var(--float-gap));
}
:root[data-sidebar] .wa-bell-chip {
  inset-inline-start: calc(var(--sal) + var(--sidebar-w) + 2 * var(--sidebar-inset) + 16px);
}
:root[data-bare] .wa-bell-chip, :root[data-bare] .wa-bell-banner { display: none; }

.wa-bell-banner {
  position: fixed; z-index: 25; display: flex; align-items: center; gap: 10px;
  inset-block-start: calc(var(--sat) + 12px); inset-inline: 16px; margin-inline: auto; max-inline-size: 520px;
  padding: 10px 8px 10px 14px; border-radius: 16px; background: var(--bg2); color: var(--text);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.18), inset 0 0 0 1.5px rgb(var(--accent-rgb) / 0.45);
  animation: wa-bell-in 150ms ease both;
}
.wa-bell-warn { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.wa-bell-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.wa-bell-actions .btn { min-height: 44px; }
.wa-bell-actions .btn-plain { min-width: 44px; padding-inline: 10px; }
@media (max-width: 420px) {
  .wa-bell-banner { flex-wrap: wrap; }
  .wa-bell-warn { flex-basis: calc(100% - 40px); }
  .wa-bell-actions { margin-inline-start: auto; }
}
@keyframes wa-bell-in { from { opacity: 0; } to { opacity: 1; } }

@media (hover: hover) and (pointer: fine) {
  .wa-check:hover { background: rgb(var(--text-rgb) / 0.06); }
  .wa-check:hover .wa-check-box { box-shadow: inset 0 0 0 1.75px rgb(var(--accent-rgb) / 0.6); }
  .wa-check-input:checked + .wa-check-box { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-check-box { transition: none; }
}
@media (prefers-contrast: more) {
  .wa-bell-chip, .wa-bell-banner { box-shadow: inset 0 0 0 1.5px var(--text); }
  .wa-line, .wa-check { box-shadow: inset 0 0 0 1px var(--text); }
  .wa-check-box { box-shadow: inset 0 0 0 2px var(--text); }
}
