/* Selected styles from the original telegram.css for layout purposes */
body,
html.theme_dark body.bg_light {
  --text-color: #000;
  --second-text-color: #7d7f81;
  --accent-btn-color: #2481cc;
  --accent-color-hover: #1a8ad5;
  --body-bg: #fff;
  --box-bg: #fff;
  --box-bg-blured: rgba(255, 255, 255, .84);
  --tme-logo-color: #363b40;
  --accent-link-color: #2481cc;
}

html.theme_dark body,
html body.bg_dark {
  --text-color: #fff;
  --accent-btn-color: #1c93e3;
  --body-bg: #000;
  --box-bg: #1e1e1e;
  --box-bg-blured: rgba(34, 34, 34, .84);
  --tme-logo-color: #fff;
  --accent-link-color: #3ca1eb;
}
body {
  background: var(--body-bg);
  font-family: 'Roboto', sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  margin: 0;
  overflow: hidden;
}
.no_transition, .no_transition * {
  transition: none !important;
}
a {
  color: var(--accent-link-color);
}

/* Background styles */
.tgme_background_wrap {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: var(--body-bg);
}
.tgme_background {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}
.tgme_background_pattern {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: overlay;
  background: center repeat;
  background-size: 420px auto;
  opacity: 0.3;
  background-image: url('https://telegram.org/img/tgme/pattern.svg?1');
}

/* Header styles */
.tgme_head_wrap {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 54px;
  padding: 10px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: var(--box-bg-blured);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  z-index: 10;
  box-sizing: border-box;
}
.tgme_head {
  display: flex;
  justify-content: space-between;
}
.tgme_head_brand {
  display: inline-block;
  vertical-align: top;
}
.tgme_logo {
  display: inline-block;
  vertical-align: top;
}

/* Body and content styles */
.tgme_page_wrap {
  font-family: 'Roboto', sans-serif;
  color: var(--text-color);
}
.tgme_body_wrap {
  padding: 70px 16px 40px;
}
.tgme_page {
  position: relative;
  margin: 16px auto;
  max-width: 500px;
}
.tgme_page_post {
  padding: 3px 0 0;
  margin: 0 auto;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

/* Full screen overlay for auth widget */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: grid;
    place-items: center;
    z-index: 1000;
}

.popup-stage {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
    display: none;
}

.popup-stage:has(> *:not([style*="display: none"])) {
    display: block;
}

.popup-stage #default-authenticator > div {
    box-shadow: none !important;
    padding: 0 !important;
}