.tg-login-btn {
    --_radius: var(--tg-login-radius, 12px);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 30px; padding: 0 12px; margin: 0;
    border: 0; border-radius: var(--_radius);
    background: #54a9eb; color: #fff;
    font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
    cursor: pointer; transition: background-color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.tg-login-btn:hover { background: #4a9fe0; }
.tg-login-btn:active { transform: scale(0.97); }
.tg-login-btn:focus-visible { outline: 2px solid #54a9eb; outline-offset: 2px; }
.tg-login-btn__icon { width: 16px; height: 16px; flex-shrink: 0; }

.tg-login-btn--small { height: 26px; padding: 0 10px; gap: 5px; font-size: 12px; }
.tg-login-btn--small .tg-login-btn__icon { width: 14px; height: 14px; }
.tg-login-btn--large { height: 40px; padding: 0 18px; gap: 8px; font-size: 15px; }
.tg-login-btn--large .tg-login-btn__icon { width: 20px; height: 20px; }
.tg-login-btn--block { width: 100%; }
@media (max-width: 768px) {
    .tg-login-btn--responsive { height: 26px; padding: 0 10px; gap: 5px; font-size: 12px; }
    .tg-login-btn--responsive .tg-login-btn__icon { width: 14px; height: 14px; }
}

.tg-login[hidden], .tg-login [hidden] { display: none; }
.tg-login { position: fixed; inset: 0; z-index: 2147483200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tg-login__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.2s ease; }
.tg-login.is-open .tg-login__backdrop { opacity: 1; }

.tg-login__panel {
    position: relative; width: min(360px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 28px 22px 20px; border-radius: 18px;
    background: #fff; color: #1c1c1e; text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    opacity: 0; transform: scale(0.96); transition: opacity 0.2s ease, transform 0.2s ease;
}
.tg-login.is-open .tg-login__panel { opacity: 1; transform: none; }

.tg-login__close {
    position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.06); color: #1c1c1e;
    font-size: 22px; line-height: 1; cursor: pointer;
}
.tg-login__badge { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #54a9eb; color: #fff; }
.tg-login__badge svg { width: 30px; height: 30px; }
.tg-login__title { margin: 0; font-size: 18px; font-weight: 700; color: inherit; }

.tg-login__steps { margin: 0; padding: 0 0 0 20px; align-self: stretch; text-align: left; font-size: 14px; line-height: 1.7; color: #3a3a3c; }

.tg-login__open {
    display: flex; align-items: center; justify-content: center; align-self: stretch;
    height: 48px; border-radius: 12px; background: #54a9eb; color: #fff !important;
    font-size: 16px; font-weight: 700; text-decoration: none !important;
}
.tg-login__open:hover { background: #4a9fe0; }

.tg-login__qr { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tg-login__qr-image { width: 168px; height: 168px; image-rendering: pixelated; }
.tg-login__qr p { margin: 0; font-size: 13px; color: #6c6c70; }

.tg-login__status { margin: 0; min-height: 1.4em; font-size: 14px; color: #6c6c70; }
.tg-login__status[data-state="error"] { color: #d93025; }
.tg-login__status[data-state="done"] { color: #1e8e3e; font-weight: 600; }

.tg-login__retry {
    align-self: stretch; height: 44px; border: 1px solid #54a9eb; border-radius: 12px;
    background: #fff; color: #2b8ad6; font-size: 15px; font-weight: 600; cursor: pointer;
}

.tg-login__fallback { padding: 4px; border: 0; background: none; color: #6c6c70; font-size: 13px; text-decoration: underline; cursor: pointer; }
.tg-login.is-slow .tg-login__fallback { color: #2b8ad6; font-weight: 600; }

body.tg-login-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .tg-login__backdrop, .tg-login__panel, .tg-login-btn { transition: none; }
}
