
.auth-shell [hidden] { display: none !important; }

.auth-shell {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 18px 60px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 32px 30px 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.auth-head h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.auth-head p {
  margin: 0 0 22px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab:hover { color: var(--text); }

.auth-tab.is-active {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  box-shadow: 0 6px 18px var(--primary-glow);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}

.auth-link:hover { color: var(--text); }
.auth-link[hidden] { display: none !important; }

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input.auth-combo {
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.5) 50%),
                    linear-gradient(135deg, rgba(255, 255, 255, 0.5) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.auth-field input.auth-combo::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}

.auth-field input::placeholder { color: rgba(255, 255, 255, 0.3); }

.auth-hint {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.45);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.auth-password {
  position: relative;
  display: block;
}

.auth-password input { padding-right: 44px; }

.auth-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.auth-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
}

.auth-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.auth-strength-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #ef4444;
  transition: width 0.25s ease, background 0.25s ease;
}

.auth-strength-fill[data-level="fair"] { background: #f59e0b; }
.auth-strength-fill[data-level="strong"] { background: #22c55e; }

.auth-submit {
  margin-top: 4px;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 26px var(--primary-glow); }
.auth-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

.auth-back {
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
}

.auth-back:hover { color: var(--text); }

.auth-error,
.auth-notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-notice { margin-bottom: 16px; }
.auth-notice-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}
.auth-notice-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.auth-notice-info {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.32);
  color: #c7d2fe;
}

.auth-2fa-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

#auth-2fa-code {
  letter-spacing: 0.18em;
  font-size: 18px;
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--text-soft);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--brand-line, var(--line-strong));
  background: var(--brand-fill, rgba(255, 255, 255, 0.04));
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.auth-provider:hover {
  transform: translateY(-1px);
  background: var(--brand-fill-hover, rgba(255, 255, 255, 0.07));
  border-color: var(--brand);
}

.auth-provider-tg {
  --brand: #29a9eb;
  --brand-line: rgba(41, 169, 235, 0.4);
  --brand-fill: rgba(41, 169, 235, 0.1);
  --brand-fill-hover: rgba(41, 169, 235, 0.18);
}

.auth-provider-ds {
  --brand: #7c85f5;
  --brand-line: rgba(88, 101, 242, 0.45);
  --brand-fill: rgba(88, 101, 242, 0.12);
  --brand-fill-hover: rgba(88, 101, 242, 0.2);
}

.auth-provider-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--brand);
}

.auth-foot,
.auth-terms {
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

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

@media (max-width: 560px) {
  .auth-shell { padding: 24px 14px 40px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 20px; }
  .auth-head h1 { font-size: 22px; }
}

.auth-tg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.auth-tg-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-tg-qr-img {
  width: 168px;
  height: 168px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
}

.auth-tg-qr-img svg {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-tg-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.auth-tg-note {
  margin: -4px 0 0;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

.auth-tg-alt {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.auth-tg-alt-title {
  margin: 0;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}

.auth-tg-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-tg-copy {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-tg-copy:hover { background: rgba(255, 255, 255, 0.07); }
.auth-tg-copy.is-done { border-color: #4ade80; color: #86efac; }

.auth-tg-bot {
  color: #7c85f5;
  font-size: 13px;
  text-decoration: none;
}

.auth-tg-bot:hover { text-decoration: underline; }

.auth-tg-code {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 6px;
  padding: 14px 18px 14px 24px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.auth-tg-open { width: 100%; text-align: center; text-decoration: none; }

.auth-tg-status {
  margin: 0;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: center;
}

.auth-tg-status.is-bad { color: #ff9a9a; }

  .auth-captcha {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
  }
  .auth-captcha[hidden] { display: none !important; }

  .auth-captcha-row { display: flex; align-items: center; gap: 10px; }

  .auth-captcha-image {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1.5px solid var(--line-strong, rgba(255,255,255,0.15));
  }

  .auth-captcha-reload {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid var(--line-strong, rgba(255,255,255,0.15));
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .auth-captcha-reload:hover { border-color: rgba(99,102,241,0.6); }
  .auth-captcha-reload:disabled { opacity: 0.5; cursor: default; }

  .auth-captcha-external {
    display: flex;
    justify-content: center;
    padding: 4px 0 2px;
  }

  .auth-captcha-external[hidden] { display: none !important; }

  #auth-recaptcha {
    min-height: 78px;
  }

  @media (max-width: 390px) {
    .auth-captcha-external {
      justify-content: flex-start;
      overflow-x: auto;
    }
  }
