/* ================================================================
   TEGO Auth — Login / Register (screenshot-inspired)
   ================================================================ */

.auth-body {
  --tego-purple: #7B2CBF;
  --tego-purple-deep: #3C096C;
  --tego-purple-neon: #a855f7;
  --tego-gold: #D4AF37;
  --tego-gold-bright: #f5b83d;
  --tego-charcoal: #1F2937;
  --tego-bg: #0a0614;
  --tego-card: rgba(24, 16, 42, 0.92);
  --tego-border: rgba(123, 44, 191, 0.55);
  --tego-muted: #9ca3af;
  --tego-ink: #ffffff;
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--tego-ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(123, 44, 191, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 40% at 95% 8%, rgba(212, 175, 55, 0.12), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(60, 9, 108, 0.35), transparent 55%),
    var(--tego-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(212, 175, 55, 0.55) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(168, 85, 247, 0.35) 1px, transparent 1.5px);
  background-size: 48px 48px, 72px 72px;
  background-position: 12px 8px, 36px 40px;
  opacity: 0.35;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

.auth-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(125deg, transparent 40%, rgba(168, 85, 247, 0.07) 50%, transparent 60%),
    linear-gradient(55deg, transparent 35%, rgba(212, 175, 55, 0.05) 48%, transparent 58%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 1.25rem 1.15rem 2.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.auth-flash {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.auth-flash--success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

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

/* Language chip */
.auth-lang {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--tego-muted);
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.auth-lang__flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  background: linear-gradient(180deg, #012169 33%, #fff 33%, #fff 66%, #c8102e 66%);
}

/* Brand block */
.auth-brand {
  text-align: center;
  margin: 1.25rem 0 1.75rem;
}

.auth-brand__mark {
  width: 88px;
  height: 88px;
  margin: 0 auto 0.85rem;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 2.35rem;
  letter-spacing: -1px;
  background: linear-gradient(145deg, rgba(60, 9, 108, 0.9), rgba(15, 8, 28, 0.95));
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow:
    0 0 40px rgba(123, 44, 191, 0.45),
    0 0 80px rgba(212, 175, 55, 0.12),
    inset 0 0 20px rgba(168, 85, 247, 0.15);
}

.auth-brand__mark img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
}

.auth-brand__tg .t {
  background: linear-gradient(180deg, #c084fc, #7B2CBF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-brand__tg .g {
  background: linear-gradient(180deg, #ffcf6b, #D4AF37);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-brand__name {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.35rem;
  line-height: 1.1;
}

.auth-brand__name .part-purple {
  color: var(--tego-purple-neon);
}

.auth-brand__name .part-gold {
  color: var(--tego-gold-bright);
}

.auth-brand__tagline {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tego-gold);
  opacity: 0.9;
}

/* Form card */
.auth-card {
  background: var(--tego-card);
  border: 1.5px solid var(--tego-border);
  border-radius: 18px;
  padding: 0.35rem 0.85rem;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.auth-form--register .auth-card,
.auth-card--flat {
  padding: 0.35rem 0.85rem;
}

.auth-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.15rem;
  border-bottom: 1px solid rgba(123, 44, 191, 0.35);
  position: relative;
}

.auth-field:last-of-type,
.auth-card .auth-field:last-child {
  border-bottom: none;
}

.auth-field__req {
  color: #ef4444;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  width: 0.65rem;
  text-align: center;
}

.auth-field__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--tego-purple), var(--tego-purple-deep));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(123, 44, 191, 0.4);
}

.auth-field__icon svg {
  width: 16px;
  height: 16px;
}

.auth-field__cc {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--tego-ink);
  font-size: 0.88rem;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0;
  cursor: default;
}

.auth-field__cc svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.auth-field__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--tego-ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.15rem 0;
}

.auth-field__input::placeholder {
  color: #6b7280;
  font-weight: 400;
}

.auth-field__input--select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  color: var(--tego-ink);
}

.auth-field__input--select option {
  background: #1a1028;
  color: #fff;
}

.auth-field__chevron {
  color: var(--tego-muted);
  font-size: 1.1rem;
  transform: rotate(90deg);
  opacity: 0.6;
}

.auth-field__suffix {
  background: none;
  border: none;
  color: #9ca3af;
  padding: 0.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-field__suffix:hover {
  color: var(--tego-gold);
}

.auth-field--captcha {
  gap: 0.45rem;
}

.auth-field__input--captcha {
  letter-spacing: 0.15em;
}

.auth-captcha-thumb {
  background: rgba(123, 44, 191, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
  overflow: hidden;
}

.auth-captcha-thumb:hover {
  border-color: var(--tego-gold);
}

.auth-captcha-thumb img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 110px;
  border-radius: 6px;
}

.auth-error {
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem 0.55rem;
  margin: 0;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.35rem 0.85rem;
  flex-wrap: wrap;
}

.auth-link {
  color: var(--tego-muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--tego-gold);
}

.auth-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--tego-muted);
  cursor: pointer;
  user-select: none;
}

.auth-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-switch__ui {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--tego-purple-neon);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-switch__ui::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s ease;
}

.auth-switch input:checked + .auth-switch__ui {
  border-color: var(--tego-purple-neon);
  background: rgba(123, 44, 191, 0.35);
}

.auth-switch input:checked + .auth-switch__ui::after {
  background: var(--tego-purple-neon);
}

.auth-after-card {
  margin-top: 1.15rem;
  text-align: center;
}

.auth-footer-line {
  margin: 0 0 1.15rem;
  font-size: 0.88rem;
  color: var(--tego-muted);
  text-align: center;
}

.auth-footer-line a {
  color: var(--tego-gold-bright);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer-line a:hover {
  text-decoration: underline;
}

.auth-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffcf6b 0%, var(--tego-gold) 50%, #c9a227 100%);
  color: #1a1200 !important;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(212, 175, 55, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.5);
  text-decoration: none;
  color: #1a1200 !important;
}

.auth-btn-primary:active {
  transform: translateY(0);
}

.auth-btn-primary--loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
}

.auth-btn-primary--loading:hover {
  transform: none;
  filter: none;
}

.auth-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(26, 18, 0, 0.25);
  border-top-color: #1a1200;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* Legacy / forgot password helpers */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.auth-topbar__back {
  color: var(--tego-ink);
  display: inline-flex;
  padding: 0.35rem;
  border-radius: 10px;
  text-decoration: none;
}

.auth-topbar__back:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--tego-gold);
}

.auth-topbar__title {
  font-weight: 700;
  font-size: 1rem;
}

.auth-topbar__spacer {
  width: 30px;
}

.auth-page-title {
  display: none;
}

.auth-section {
  margin: 0;
}

.auth-section__head {
  display: none;
}

.auth-section__body {
  display: contents;
}

.auth-logo {
  display: none;
}

.auth-hint {
  font-size: 0.82rem;
  color: var(--tego-muted);
  margin: 0 0 1rem;
  line-height: 1.45;
  text-align: left;
}

@media (max-width: 380px) {
  .auth-brand__mark {
    width: 76px;
    height: 76px;
    font-size: 2rem;
  }

  .auth-brand__name {
    font-size: 1.4rem;
  }

  .auth-brand__tagline {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
  }

  .auth-field__cc {
    font-size: 0.8rem;
  }
}
