.auth-gate {
  overflow-y: auto;
  background-color: #080a0e;
  background-image: linear-gradient(rgba(8, 10, 14, 0.92), rgba(8, 10, 14, 0.96)), repeating-linear-gradient(0deg, transparent 0 39px, rgba(255, 255, 255, 0.035) 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, 0.035) 40px);
}

.auth-card {
  max-width: 820px;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid #252b36;
  border-radius: 18px;
  background: #0e1017;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(220, 38, 38, 0.06);
  animation: auth-card-enter 420ms cubic-bezier(.2, .75, .25, 1) both;
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px clamp(24px, 5vw, 54px);
  background: #0e1017;
}

.auth-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 38px;
}

.auth-lockup-mark {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
}

.auth-lockup-mark img {
  width: 29px;
  height: 29px;
  object-fit: contain;
}

.auth-lockup h1 {
  color: #f4f5f7;
  font-size: 13px;
  font-weight: 700;
}

.auth-lockup p {
  margin-top: 3px;
  color: #7d8795;
  font-size: 10px;
}

.auth-form-heading {
  margin-bottom: 22px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ef7777;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-kicker i {
  width: 13px;
  height: 13px;
}

.auth-form-heading h2 {
  margin-top: 10px;
  color: #f4f5f7;
  font-size: 22px;
  font-weight: 700;
}

.auth-form-heading p {
  margin-top: 4px;
  color: #8993a0;
  font-size: 11px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: #aab2bd;
  font-size: 10px;
  font-weight: 600;
}

.auth-input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #272d39;
  border-radius: 9px;
  color: #778292;
  background: #131722;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-input-shell:focus-within {
  border-color: rgba(239, 68, 68, 0.75);
  background: #151925;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.auth-input-shell > i {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.auth-input-shell input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: #f3f4f6;
  background: transparent;
  font-size: 12px;
}

.auth-input-shell input::placeholder {
  color: #687383;
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  margin-top: 4px;
  padding: 0 14px;
  border: 1px solid #f04444;
  border-radius: 9px;
  color: #fff;
  background: #d92d32;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.2);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.auth-submit:hover {
  border-color: #ff6262;
  background: #ec3c42;
  transform: translateY(-1px);
}

.auth-submit i {
  width: 16px;
  height: 16px;
}

.auth-form-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 28px;
  color: #697382;
  font-size: 9px;
  text-transform: uppercase;
}

.auth-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #54c99a;
  box-shadow: 0 0 9px rgba(84, 201, 154, 0.55);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 430px;
  padding: 40px 28px;
  border-left: 1px solid #252b36;
  background: radial-gradient(ellipse at 50% 45%, rgba(127, 29, 29, 0.14), transparent 44%), #0a0c11;
  text-align: center;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  content: "";
  pointer-events: none;
}

.auth-brand-panel::after {
  inset: 30px;
  border-color: rgba(239, 68, 68, 0.08);
}

.auth-brand-index,
.auth-brand-meta,
.auth-brand-seal,
.auth-brand-panel h2,
.auth-brand-panel p,
.auth-brand-rule {
  position: relative;
  z-index: 1;
}

.auth-brand-index {
  position: absolute;
  top: 28px;
  left: 28px;
  color: #7f8996;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.auth-brand-index span {
  padding: 0 4px;
  color: #d84449;
}

.auth-brand-seal {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin-bottom: 22px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 18px;
  background: rgba(239, 68, 68, 0.055);
  box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.04), 0 14px 40px rgba(0, 0, 0, 0.24);
}

.auth-brand-seal img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.auth-brand-panel h2 {
  color: #f4f5f7;
  font-family: Rajdhani, sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.auth-brand-panel > p {
  margin-top: 3px;
  color: #e65358;
  font-size: 10px;
  font-weight: 600;
}

.auth-brand-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 124px;
  margin-top: 22px;
  color: #c73a40;
}

.auth-brand-rule span {
  flex: 1;
  height: 1px;
  background: #34303a;
}

.auth-brand-rule i {
  width: 13px;
  height: 13px;
}

.auth-brand-meta {
  position: absolute;
  right: 28px;
  bottom: 25px;
  left: 28px;
  display: flex;
  justify-content: space-between;
  color: #5f6874;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .7px;
}

.auth-brand-meta span + span {
  color: #a13d42;
}

.ton-toast {
  --toast-accent: #4dd6a0;
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: min(360px, calc(100vw - 32px));
  min-height: 78px;
  padding: 13px 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--toast-accent) 40%, #252b36);
  border-radius: 12px;
  color: #f4f5f7;
  background: rgba(14, 16, 23, 0.97);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(12px) scale(.985);
  transition: opacity 200ms ease, transform 220ms cubic-bezier(.2, .75, .25, 1);
  backdrop-filter: blur(16px);
}

.ton-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ton-toast.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(.985);
}

.ton-toast-error { --toast-accent: #f06464; }
.ton-toast-warning { --toast-accent: #f3b64d; }
.ton-toast-info { --toast-accent: #54c7e8; }

.ton-toast-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--toast-accent) 28%, transparent);
  border-radius: 10px;
  color: var(--toast-accent);
  background: color-mix(in srgb, var(--toast-accent) 10%, transparent);
}

.ton-toast-icon i {
  width: 18px;
  height: 18px;
}

.ton-toast-content {
  min-width: 0;
}

.ton-toast-content h4 {
  color: var(--toast-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.ton-toast-content p {
  margin-top: 4px;
  color: #b6bec9;
  font-family: Inter, sans-serif;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ton-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  transform-origin: left;
  background: var(--toast-accent);
  animation: toast-progress 4200ms linear forwards;
}

#toast-container {
  right: 22px;
  bottom: 22px;
  z-index: 260;
  gap: 9px;
}

@keyframes auth-card-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-progress {
  to { transform: scaleX(0); }
}

[data-theme="light"] .auth-gate {
  background-color: #eef1f5;
  background-image: linear-gradient(rgba(238, 241, 245, 0.92), rgba(238, 241, 245, 0.96)), repeating-linear-gradient(0deg, transparent 0 39px, rgba(31, 35, 40, 0.04) 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(31, 35, 40, 0.04) 40px);
}

[data-theme="light"] .auth-card {
  border-color: #d5dbe3;
  background: #fff;
  box-shadow: 0 28px 80px rgba(31, 35, 40, 0.16);
}

[data-theme="light"] .auth-form-panel,
[data-theme="light"] .auth-brand-panel {
  background-color: #fff;
}

[data-theme="light"] .auth-brand-panel {
  border-left-color: #e3e7ec;
  background: radial-gradient(ellipse at 50% 45%, rgba(220, 38, 38, 0.08), transparent 44%), #f8fafc;
}

[data-theme="light"] .auth-lockup h1,
[data-theme="light"] .auth-form-heading h2,
[data-theme="light"] .auth-brand-panel h2 {
  color: #202630;
}

[data-theme="light"] .auth-lockup p,
[data-theme="light"] .auth-form-heading p,
[data-theme="light"] .auth-form-footer {
  color: #66717f;
}

[data-theme="light"] .auth-input-shell {
  border-color: #d8dee7;
  color: #66717f;
  background: #f7f9fb;
}

[data-theme="light"] .auth-input-shell input {
  color: #202630;
}

[data-theme="light"] .ton-toast {
  color: #202630;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 48px rgba(31, 35, 40, 0.18);
}

[data-theme="light"] .ton-toast-content p {
  color: #4f5a67;
}

@media (max-width: 767px) {
  .auth-card {
    min-height: 0;
  }

  .auth-form-panel {
    padding: 26px 24px 24px;
  }

  .auth-lockup {
    margin-bottom: 28px;
  }

  .auth-form-footer {
    margin-top: 20px;
  }

  .auth-brand-panel {
    min-height: 230px;
    padding: 32px 20px 42px;
  }

  .auth-brand-index {
    top: 19px;
    left: 20px;
  }

  .auth-brand-seal {
    width: 76px;
    height: 76px;
    margin-bottom: 12px;
    border-radius: 14px;
  }

  .auth-brand-seal img {
    width: 52px;
    height: 52px;
  }

  .auth-brand-panel h2 {
    font-size: 18px;
  }

  .auth-brand-rule {
    margin-top: 12px;
  }

  .auth-brand-meta {
    right: 20px;
    bottom: 15px;
    left: 20px;
  }

  #toast-container {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .ton-toast {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .ton-toast,
  .ton-toast-progress {
    animation: none;
    transition: none;
  }
}
