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

.auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

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

.auth-modal-card {
  background: #2f2f2f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.6rem 1.4rem 1.35rem;
  color: #ececec;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

.auth-modal-close {
  position: absolute;
  top: 0.7rem;
  inset-inline-end: 0.7rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

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

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

.auth-modal-logo,
.auth-modal-mark {
  width: 2rem;
  height: 2rem;
  display: block;
}

.auth-modal-mark {
  border-radius: 0.4rem;
  background: #fff;
  color: #000;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-modal-title {
  margin: 0 0 0.3rem;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.03em;
}

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

.auth-modal-reason {
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
}

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

.auth-modal-tabs {
  display: flex;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-modal-tab {
  flex: 1;
  min-height: 2.45rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  cursor: pointer;
}

.auth-modal-tab.active {
  color: #fff;
  border-bottom-color: #fff;
}

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

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

.auth-modal-field input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid #4d4d4f;
  border-radius: 0.7rem;
  background: #212121;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.auth-modal-field input:focus {
  border-color: #fff;
}

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

.auth-modal-submit,
.auth-modal-submit-accent {
  width: 100%;
  min-height: 2.8rem;
  margin-top: 0.35rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #0d0d0d;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.12s ease;
}

.auth-modal-submit:hover:not(:disabled),
.auth-modal-submit-accent:hover:not(:disabled) {
  background: #d9d9d9;
}

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

.auth-modal-error {
  min-height: 1.2rem;
  margin-top: 0.75rem;
  color: #f87171;
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.5;
}

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

.auth-modal-hint {
  margin: 0.85rem 0 0;
}

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