/* Login — Telegram for Android sign-in screens (dark) */
.tx-auth {
  position: fixed; left: 0; right: 0; z-index: 90;
  top: var(--tx-auth-top, 0px); height: var(--tx-auth-h, 100dvh);
  background: #1a1a1a; color: #fff; font-family: var(--tx-font);
  display: flex; justify-content: center; overflow: hidden;
}
.tx-auth-screen { position: relative; width: 100%; max-width: 520px; height: 100%; display: flex; flex-direction: column; }
.tx-auth-back {
  position: absolute; left: 12px; top: calc(53px + var(--tx-safe-top)); z-index: 2;
  width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff;
}
.tx-auth-back:active { background: rgba(255, 255, 255, 0.1); }
.tx-auth-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: calc(160px + var(--tx-safe-top)) 36px 96px;
  display: flex; flex-direction: column; align-items: stretch;
}
.tx-auth-title { font-size: 22px; font-weight: 700; text-align: center; letter-spacing: -0.01em; margin: 0 0 8px; }
.tx-auth-sub { font-size: 16px; line-height: 1.45; color: #8d8d92; text-align: center; margin: 0 8px 30px; }
.tx-auth-sub b { color: #c8c8cc; font-weight: 700; }
.tx-auth-art { display: flex; justify-content: center; margin: 0 0 34px; }
.tx-auth-art svg { width: 150px; height: auto; }
.tx-auth-screen[data-step='code'] .tx-auth-body { padding-top: calc(100px + var(--tx-safe-top)); padding-bottom: 28px; }
.tx-auth-screen[data-step='code'] .tx-auth-link { margin-top: auto; }

/* Outlined fields */
.tx-auth-field {
  position: relative; display: flex; align-items: center; width: 100%; min-height: 54px; margin-bottom: 32px;
  border: 1px solid #484848; border-radius: 12px; padding: 0 16px; color: #fff; font-size: 20px; text-align: left;
  transition: border-color 0.15s;
}
.tx-auth-country { justify-content: space-between; color: #78787d; font-size: 20px; }
.tx-auth-country.has-value { color: #fff; }
.tx-auth-country svg { color: #8d8d92; flex: none; }
.tx-auth-field.is-focus { border-color: #7b8be8; border-width: 2px; padding: 0 15px; }
.tx-auth-float {
  position: absolute; left: 14px; top: -11px; padding: 0 6px; background: #1a1a1a; font-size: 16px; color: #7b8be8; pointer-events: none;
}
.tx-auth-field:not(.is-focus) .tx-auth-float { color: #8d8d92; }
.tx-auth-phone { padding-left: 16px; }
.tx-auth-plus { color: #fff; font-size: 20px; margin-right: 2px; }
.tx-auth input {
  background: transparent; border: 0; outline: 0; color: #fff; font: inherit; font-size: 20px; min-width: 0; caret-color: #7b8be8;
}
.tx-auth-code-in { width: 4.2ch; }
.tx-auth-div { width: 1px; height: 30px; background: #484848; margin: 0 14px 0 8px; flex: none; }
.tx-auth-num-in { flex: 1; letter-spacing: 0.01em; }
.tx-auth-pass input { flex: 1; }
.tx-auth-eye { color: #8d8d92; width: 40px; height: 40px; margin-right: -10px; display: flex; align-items: center; justify-content: center; flex: none; }

.tx-auth-error {
  min-height: 0; max-height: 0; overflow: hidden; opacity: 0; color: #ff6b6b; font-size: 15px; margin: -6px 4px 0;
  transition: opacity 0.15s, max-height 0.2s;
}
.tx-auth-error.is-shown { max-height: 60px; opacity: 1; margin-bottom: 14px; }
.tx-auth-error.is-center { text-align: center; }
.tx-auth-link { align-self: center; color: #7b8be8; font-size: 17px; padding: 14px 16px; margin-top: 6px; }
.tx-auth-link:active { opacity: 0.6; }

/* Round action button */
.tx-auth-fab {
  position: absolute; right: 21px; bottom: calc(21px + var(--tx-safe-bottom)); width: 60px; height: 60px; border-radius: 50%;
  background: #5a83f3; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); transition: transform 0.12s;
}
.tx-auth-fab:active { transform: scale(0.94); }
.tx-auth-spin { animation: tx-auth-rot 0.8s linear infinite; }
@keyframes tx-auth-rot { to { transform: rotate(360deg); } }

/* Code boxes */
.tx-auth-boxes { display: flex; justify-content: center; gap: 10px; margin: 4px 0 18px; }
.tx-auth-box {
  width: 36px; height: 44px; border: 1px solid #484848; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 22px; font-weight: 500; transition: border-color 0.12s;
}
.tx-auth-box.is-active { border-color: #7b8be8; border-width: 2px; }
.tx-auth-boxes.is-busy { opacity: 0.55; }
.tx-auth-hidden-in { position: absolute !important; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 0; top: 0; }

/* QR */
.tx-auth-qr {
  align-self: center; width: 252px; height: 252px; background: #fff; border-radius: 20px; padding: 16px; margin: 6px 0 12px;
  display: flex; align-items: center; justify-content: center; color: #5a83f3;
}
.tx-auth-qr img, .tx-auth-qr canvas { display: block; }

/* Country picker */
.tx-auth-picker { position: absolute; inset: 0; background: #1a1a1a; z-index: 5; display: flex; flex-direction: column; }
.tx-auth-picker-top { position: relative; padding: calc(10px + var(--tx-safe-top)) 12px 8px 68px; }
.tx-auth-picker-top .tx-auth-back { top: calc(10px + var(--tx-safe-top)); left: 8px; }
.tx-auth-search { width: 100%; height: 48px; background: transparent; border: 0; outline: 0; color: #fff; font: inherit; font-size: 20px; }
.tx-auth-list { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.tx-auth-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 24px; text-align: left; font-size: 18px; }
.tx-auth-row:active { background: rgba(255, 255, 255, 0.07); }
.tx-auth-flag { font-size: 26px; width: 34px; text-align: center; flex: none; }
.tx-auth-rname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-auth-rcode { color: #8d8d92; flex: none; }

body.tx-auth-open { overflow: hidden; }
@media (min-width: 700px) {
  .tx-auth-body { padding-top: 170px; }
  .tx-auth-fab { right: calc(50% - 239px); }
}
