.auth-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(100vw - 2rem, 27rem);
  width: 100%;
}

.auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
}

.auth-modal-card-wrap {
  position: relative;
}

.auth-modal-card {
  background: linear-gradient(180deg, #1e1e1e 0%, #171717 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.125rem;
  padding: 1.65rem 1.45rem 1.4rem;
  color: #fff;
  font-family: Vazirmatn, ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.auth-modal-close {
  position: absolute;
  top: 0.8rem;
  inset-inline-end: 0.8rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.auth-modal-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.auth-modal-logo {
  width: 2.25rem;
  height: 2.25rem;
  display: block;
}

.auth-modal-title {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
}

.auth-modal-subtitle {
  margin: 0 0 1.1rem;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.55;
}

.auth-modal-reason {
  margin: 0 0 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(20, 184, 166, 0.35);
  background: rgba(20, 184, 166, 0.1);
  color: #99f6e4;
  font-size: 0.8125rem;
  line-height: 1.65;
  text-align: center;
}

.auth-modal-reason.hidden,
.auth-modal-form.hidden,
.auth-modal .hidden {
  display: none !important;
}

.auth-modal-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.28rem;
  margin-bottom: 1.15rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-modal-tab {
  flex: 1;
  min-height: 2.7rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-modal-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.auth-modal-field {
  margin-bottom: 0.9rem;
}

.auth-modal-field label {
  display: block;
  margin-bottom: 0.38rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
}

.auth-modal-field input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-modal-field input:focus {
  border-color: rgba(20, 184, 166, 0.55);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.auth-modal-field input[name="username"],
.auth-modal-field input[name="s_username"] {
  direction: ltr;
  text-align: left;
}

.auth-modal-submit {
  width: 100%;
  min-height: 2.9rem;
  margin-top: 0.35rem;
  border: none;
  border-radius: 0.75rem;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.auth-modal-submit-accent {
  background: linear-gradient(180deg, #2dd4bf, #14b8a6);
  color: #042f2e;
}

.auth-modal-submit:hover:not(:disabled) {
  opacity: 0.92;
}

.auth-modal-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-modal-error {
  min-height: 1.25rem;
  margin-top: 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  font-size: 0.8125rem;
  text-align: center;
  line-height: 1.5;
}

.auth-modal-error:empty {
  display: none;
  padding: 0;
  border: none;
  background: transparent;
  min-height: 0;
  margin-top: 0;
}

.auth-modal-hint {
  margin: 0.95rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-modal-hint p {
  margin: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.65;
}

html[data-lang="fa"] .auth-modal-card {
  font-family: Vazirmatn, ui-sans-serif, system-ui, sans-serif;
}
