:root {
  --bg-body: #151515;
  --bg-card: #191919;
  --bg-input: #1f1f1f;
  --bg-input-focus: #242426;
  --border-color: #2b2b2b;
  --border-focus: #3f3f46;
  --text-heading: #ffffff;
  --text-body: #cfcfd4;
  --text-muted: #8a8a8e;
  --tg-color: #229ed9;
  --tg-hover: #1e8ec3;
  --primary: #229ed9;
  --primary-hover: #1e8ec3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-heading);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
  position: relative;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

.brand-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.brand-dragon-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7));
}

.auth-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  text-align: center;
  line-height: 1.45;
}

.tg-info-box {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.tg-info-icon {
  font-size: 1.4rem;
  color: var(--tg-color);
  flex-shrink: 0;
  margin-top: 1px;
}

.tg-info-text {
  font-size: 0.82rem;
  color: var(--text-body);
  line-height: 1.45;
}

.tg-info-text b {
  color: var(--text-heading);
}

.btn-tg-main {
  width: 100%;
  height: 50px;
  background-color: var(--tg-color);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
  text-decoration: none;
  box-shadow: none !important;
}

.btn-tg-main:hover:not(:disabled) {
  background-color: var(--tg-hover);
}

.btn-tg-main:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-tg-main svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.btn-tg-main.loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-tg-main.loading .btn-spinner {
  display: inline-block;
}

.animate-spin {
  animation: spinLoader 0.75s linear infinite !important;
  transform-origin: center center !important;
  display: inline-block;
}

@keyframes spinLoader {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.first-login-block {
  display: none;
  animation: fadeIn 0.3s ease;
}

.first-login-block.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-body);
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i.field-icon {
  position: absolute;
  left: 14px;
  font-size: 1.15rem;
  color: #636368;
  pointer-events: none;
}

.form-input {
  width: 100%;
  height: 48px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0 1rem 0 2.75rem;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-heading);
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  background-color: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.02);
}

.form-input::placeholder {
  color: #55555a;
}

.btn-finish-auth {
  width: 100%;
  height: 48px;
  background-color: var(--tg-color);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s ease;
  box-shadow: none !important;
}

.btn-finish-auth:hover {
  background-color: var(--tg-hover);
}

.auth-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: #636368;
  line-height: 1.55;
}

.auth-footer a {
  color: var(--text-muted);
  text-decoration: underline;
}

#page-loader {
  position: fixed;
  inset: 0;
  background-color: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#page-loader.show {
  opacity: 1;
  visibility: visible;
}
