/* RG COMPANY auth card + direct Telegram popup login */
.theme-brand-logo {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}
.theme-brand-logo img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity .18s ease;
}
html[data-theme="light"] .theme-brand-logo-dark,
html[data-theme="dark"] .theme-brand-logo-light { opacity: 0; visibility: hidden; }
html[data-theme="light"] .theme-brand-logo-light,
html[data-theme="dark"] .theme-brand-logo-dark { opacity: 1; visibility: visible; }
.sidebar-brand-mark { width: 36px; height: 36px; flex-basis: 36px; }

.auth-login-page { min-height: 100vh; }
.public-shell .auth-login-main {
  min-height: min(720px, calc(100vh - 76px));
  display: grid;
  place-items: center;
  padding: 72px 0 86px;
}
.auth-card {
  position: relative;
  isolation: isolate;
  width: min(448px, calc(100vw - 34px));
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, .18);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 24px 58px rgba(28, 24, 45, .10), 0 0 38px rgba(139, 92, 246, .08);
  padding: 34px 32px 30px;
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.auth-card-glow {
  position: absolute;
  z-index: -1;
  inset: -90px -70px auto auto;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.14), transparent 70%);
  pointer-events: none;
}
.auth-card h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(26px, 4vw, 30px);
  line-height: 1.1;
  letter-spacing: -.035em;
  font-weight: 850;
}
.auth-subtitle {
  margin: 9px 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.auth-telegram-slot { min-height: 50px; margin: 0; }
.auth-telegram-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, rgba(139,92,246,.22));
  border-radius: 15px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  font: 760 14px/1 Manrope Variable, Manrope, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(21, 19, 35, .035);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.auth-telegram-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(139,92,246,.46);
  background: color-mix(in srgb, var(--panel) 96%, rgba(139,92,246,.04));
  box-shadow: 0 12px 30px rgba(139,92,246,.10);
}
.auth-telegram-button:active:not(:disabled) { transform: scale(.985); }
.auth-telegram-button:focus-visible { outline: 3px solid rgba(139,92,246,.20); outline-offset: 3px; }
.auth-telegram-button:disabled { cursor: wait; opacity: .72; }
.auth-telegram-button.is-error { cursor: pointer; opacity: 1; }
.auth-telegram-icon {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #9b6cff, #7b55ed);
  box-shadow: 0 5px 13px rgba(139,92,246,.28);
  flex: none;
}
.auth-telegram-icon svg { width: 12px; height: 12px; stroke-width: 2.1; }
.auth-telegram-button.is-loading .auth-telegram-icon { animation: authPulse 1s ease-in-out infinite; }
@keyframes authPulse { 50% { transform: scale(.86); opacity: .65; } }
.auth-login-error {
  display: none;
  margin: 13px 0 0;
  border: 1px solid rgba(239,68,68,.18);
  border-radius: 12px;
  background: rgba(239,68,68,.055);
  color: #dc3d3d;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}
.auth-login-error:not(:empty) { display: block; }
.auth-help {
  display: inline-flex;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color .18s ease;
}
.auth-help:hover { color: #8b5cf6; }

html[data-theme="dark"] .auth-card {
  border-color: rgba(139,92,246,.20);
  background: rgba(15, 15, 23, .88);
  box-shadow: 0 28px 70px rgba(0,0,0,.42), 0 0 46px rgba(139,92,246,.06);
}
html[data-theme="dark"] .auth-telegram-button {
  border-color: rgba(255,255,255,.075);
  background: rgba(255,255,255,.025);
}
html[data-theme="dark"] .auth-telegram-button:hover:not(:disabled) {
  border-color: rgba(139,92,246,.35);
  background: rgba(255,255,255,.045);
}
html[data-theme="dark"] .auth-login-error { color: #ff8585; }

@media (max-width: 720px) {
  .public-shell .auth-login-main { min-height: auto; padding: 48px 0 62px; }
  .auth-card { padding: 30px 24px 26px; border-radius: 18px; }
}
@media (max-width: 420px) {
  .auth-card { width: calc(100vw - 24px); padding-inline: 20px; }
  .auth-telegram-button { font-size: 13px; }
}

/* Telegram bot confirmation flow — hero restored, no Login Widget. */
.bot-auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.bot-auth-main {
  min-height: min(760px, calc(100vh - 76px));
  padding-top: 68px;
  padding-bottom: 82px;
}
.bot-auth-shell { width: 100%; }
.bot-auth-copy { min-width: 0; }
.bot-auth-card-wrap {
  position: relative;
  width: 100%;
  max-width: 470px;
  justify-self: end;
}
.bot-auth-card-wrap::before {
  content: '';
  position: absolute;
  inset: -34px;
  z-index: -1;
  border-radius: 46px;
  background: radial-gradient(circle, rgba(139,92,246,.15), transparent 68%);
  filter: blur(18px);
  pointer-events: none;
}
.bot-auth-card {
  width: 100%;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bot-auth-card .auth-subtitle { margin-bottom: 24px; }
.bot-auth-card .auth-telegram-slot { width: 100%; }
.auth-progress {
  margin: 16px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.auth-progress[hidden] { display: none; }
.auth-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 0 6px rgba(139,92,246,.12);
  animation: botAuthPulse 1.15s ease-in-out infinite;
}
@keyframes botAuthPulse {
  50% { transform: scale(.72); opacity: .55; }
}
.bot-auth-card .auth-help { margin-top: 24px; }

@media (max-width: 1040px) {
  .bot-auth-main { padding-top: 50px; }
  .bot-auth-card-wrap { max-width: 560px; justify-self: stretch; }
}
@media (max-width: 720px) {
  .bot-auth-main { padding: 38px 0 58px; }
  .bot-auth-shell { gap: 34px; }
  .bot-auth-copy .login-points { margin-top: 24px; }
  .bot-auth-card-wrap { max-width: none; }
  .bot-auth-card { min-height: 0; }
}


/* RG COMPANY unified visual patch: main-site blue, reliable logos, loader and cursor. */
.theme-brand-logo {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  filter: none !important;
}
.theme-brand-logo .theme-brand-logo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}
html[data-theme="light"] .theme-brand-logo .theme-brand-logo-image {
  filter: invert(1) brightness(.14) saturate(0) !important;
}
html[data-theme="dark"] .theme-brand-logo .theme-brand-logo-image {
  filter: none !important;
}
.header-brand-logo, .footer-brand-logo { width: 34px; height: 34px; flex-basis: 34px; }
.sidebar-brand-mark { width: 36px; height: 36px; flex-basis: 36px; }

/* Exact full-screen loader behavior from the Astro main page. */
html.is-page-loading,
html.is-page-loading body { overflow: hidden !important; }
html.is-page-loading body > :not(.page-loader) { visibility: hidden !important; }
.page-loader {
  z-index: 20000;
  background: var(--bg);
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  place-items: center;
  transition: opacity .22s ease, visibility .22s ease;
  display: grid;
  position: fixed;
  inset: 0;
}
.page-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loader-spinner {
  filter: drop-shadow(0 10px 28px rgba(0,0,0,.14));
  width: 54px;
  height: 54px;
  animation: .76s linear infinite rg-page-loader-spin;
  overflow: visible;
}
.page-loader-track,
.page-loader-arc { fill: none; stroke-width: 4.2px; }
.page-loader-track { stroke: transparent; }
.page-loader-arc { stroke: #1688ff; stroke-linecap: round; stroke-dasharray: 31 95; }
@keyframes rg-page-loader-spin { to { transform: rotate(360deg); } }

/* Same elastic cursor used on the main page. */
.cursor-blob {
  z-index: 10000;
  -webkit-backdrop-filter: blur(2px) saturate(1.02) brightness(.97);
  backdrop-filter: blur(2px) saturate(1.02) brightness(.97);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
  background: rgba(5,8,13,.07);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  transition: width .18s cubic-bezier(.22,1,.36,1), height .18s cubic-bezier(.22,1,.36,1), border-color .18s, background .18s, box-shadow .18s, opacity .15s;
  position: fixed;
  top: 0;
  left: 0;
  box-shadow: 0 3px 12px rgba(0,0,0,.13), inset 1px 1px 4px rgba(255,255,255,.08);
}
.cursor-blob.is-visible { opacity: 1; }
.cursor-blob.is-interactive { width: 50px; height: 50px; background: rgba(5,8,13,.10); border-color: rgba(255,255,255,.25); box-shadow: 0 4px 14px rgba(0,0,0,.15), inset 1px 1px 5px rgba(255,255,255,.10); }
.cursor-blob.is-pressed { width: 31px; height: 31px; }
html[data-theme="light"] .cursor-blob { background: rgba(8,12,18,.035); border-color: rgba(17,24,39,.16); box-shadow: 0 3px 12px rgba(17,24,39,.09), inset 1px 1px 4px rgba(255,255,255,.28); }
html[data-theme="light"] .cursor-blob.is-interactive { background: rgba(8,12,18,.055); border-color: rgba(17,24,39,.22); box-shadow: 0 4px 14px rgba(17,24,39,.11), inset 1px 1px 5px rgba(255,255,255,.34); }

html, body, body *:not(input):not(textarea) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img, a { -webkit-user-drag: none; user-drag: none; }

/* Remove the purple copied from the reference and use the product blue. */
.auth-card {
  border-color: rgba(39,140,255,.16) !important;
  box-shadow: 0 24px 58px rgba(28,36,48,.10), 0 0 38px rgba(39,140,255,.075) !important;
}
.auth-card-glow,
.bot-auth-card-wrap::before {
  background: radial-gradient(circle, rgba(39,140,255,.14), transparent 70%) !important;
}
.auth-telegram-button {
  border-color: color-mix(in srgb, var(--line) 78%, rgba(39,140,255,.20)) !important;
}
.auth-telegram-button:hover:not(:disabled) {
  border-color: rgba(39,140,255,.46) !important;
  background: color-mix(in srgb, var(--panel) 96%, rgba(39,140,255,.04)) !important;
  box-shadow: 0 12px 30px rgba(39,140,255,.10) !important;
}
.auth-telegram-button:focus-visible { outline-color: rgba(39,140,255,.22) !important; }
.auth-telegram-icon {
  background: #278cff !important;
  box-shadow: 0 5px 13px rgba(39,140,255,.28) !important;
}
.auth-help:hover { color: #278cff !important; }
.auth-progress-dot {
  background: #278cff !important;
  box-shadow: 0 0 0 6px rgba(39,140,255,.12) !important;
}
html[data-theme="dark"] .auth-card {
  border-color: rgba(39,140,255,.18) !important;
  box-shadow: 0 28px 70px rgba(0,0,0,.42), 0 0 46px rgba(39,140,255,.055) !important;
}
html[data-theme="dark"] .auth-telegram-button:hover:not(:disabled) { border-color: rgba(39,140,255,.34) !important; }

/* Remove the remaining plum accent from the cabinet shell. */
.cabinet-orb-two { background: #237fdf !important; opacity: .10 !important; }
.avatar { background: linear-gradient(145deg,#278cff,#237fdf) !important; }

@media (hover: none), (pointer: coarse), (max-width: 820px), (prefers-reduced-motion: reduce) {
  .cursor-blob { display: none !important; }
}
