.auth-dialog {
  width: min(94vw, 940px);
  max-width: 940px;
}

.auth-modal {
  background: #07152e;
  color: #fff;
  box-shadow: 0 28px 90px rgba(7, 21, 46, .34);
}

.auth-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  filter: invert(1);
  opacity: .82;
}

.auth-modal-grid {
  display: grid;
  grid-template-columns: minmax(390px, 1.08fr) minmax(360px, .92fr);
  min-height: 520px;
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px 46px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 40%),
    radial-gradient(circle at 18% 22%, rgba(212, 175, 95, .26), transparent 34%),
    linear-gradient(135deg, #071020, #0d3478);
  overflow: hidden;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: auto -70px -80px auto;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(212, 175, 95, .28);
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(30, 105, 232, .24);
}

.auth-kicker {
  display: inline-flex;
  padding: 7px 12px;
  border: 1px solid rgba(212, 175, 95, .34);
  border-radius: 8px;
  color: #d4af5f;
  font-size: .82rem;
  font-weight: 800;
}

.auth-visual h2 {
  margin: 24px 0 14px;
  color: #fff;
  font-size: 1.85rem;
  line-height: 1.8;
}

.auth-visual p {
  color: rgba(255, 255, 255, .76);
  font-size: 1rem;
  line-height: 2.05;
}

.auth-visual-card {
  position: relative;
  z-index: 1;
  width: min(100%, 300px);
  margin: 38px auto 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
}

.auth-visual-card span {
  display: block;
  width: 48px;
  height: 5px;
  margin-bottom: 16px;
  border-radius: 99px;
  background: linear-gradient(90deg, #d4af5f, #f8e7a8);
}

.auth-visual-card strong,
.auth-visual-card small {
  display: block;
  direction: ltr;
  text-align: left;
}

.auth-visual-card strong {
  font-size: 1.3rem;
  letter-spacing: 1px;
}

.auth-visual-card small {
  margin-top: 8px;
  color: rgba(255, 255, 255, .62);
}

.auth-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px 44px;
  background: #fff;
  color: #07152e;
}

.auth-form-head {
  margin-bottom: 28px;
}

.auth-form-head span {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(30, 105, 232, .08);
  color: #1e69e8;
  font-size: .82rem;
  font-weight: 900;
}

.auth-form-head h3 {
  margin: 16px 0 8px;
  color: #07152e;
  font-size: 1.45rem;
  font-weight: 900;
}

.auth-form-head p {
  margin: 0;
  color: #667085;
  font-size: .92rem;
  line-height: 1.9;
}

.auth-step {
  width: 100%;
}

.auth-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.auth-input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #d6e0f1;
  border-radius: 8px;
  outline: 0;
  direction: ltr;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 800;
  color: #07152e;
  background: #f8fbff;
}

.auth-input:focus {
  border-color: #1e69e8;
  box-shadow: 0 0 0 4px rgba(30, 105, 232, .12);
}

.auth-hint,
.auth-phone-preview {
  margin: 10px 0 0;
  color: #6c757d;
  font-size: .86rem;
  line-height: 1.8;
}

.auth-phone-preview strong {
  color: #1e69e8;
  direction: ltr;
  display: inline-block;
}

.auth-error {
  min-height: 24px;
  margin: 10px 0 12px;
  color: #d92d20;
  font-size: .85rem;
  font-weight: 700;
}

.auth-success {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(30, 179, 91, .24);
  border-radius: 8px;
  background: rgba(30, 179, 91, .08);
  color: #128445;
  font-size: .9rem;
  font-weight: 800;
}

.auth-back {
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1e69e8;
  font-size: .9rem;
  font-weight: 800;
}

/* فیلد مخفی فقط برای autofill/SMS (در DOM نباید دیده شود) */
.auth-otp-autofill {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}

.auth-otp-group {
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  gap: 10px;
}

.auth-otp-cell {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #d6e0f1;
  border-radius: 8px;
  outline: 0;
  background: #f8fbff;
  color: #07152e;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
}

.auth-otp-cell:focus {
  border-color: #1e69e8;
  box-shadow: 0 0 0 4px rgba(30, 105, 232, .12);
}

@media (max-width: 991.98px) {
  .auth-dialog {
    width: min(94vw, 560px);
  }

  .auth-modal-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-visual {
    padding: 38px 30px 30px;
  }

  .auth-body {
    padding: 34px 30px;
  }
}

@media (max-width: 575.98px) {
  .auth-visual h2 {
    font-size: 1.25rem;
  }

  .auth-visual-card {
    margin-top: 20px;
  }

  .auth-body {
    padding: 28px 20px;
  }

  .auth-form-head h3 {
    font-size: 1.22rem;
  }

  .auth-otp-group {
    gap: 7px;
  }

  .auth-otp-cell {
    font-size: 1.05rem;
  }
}

/* ── سرمایه‌چی: صفحه /login و /otp ── */
.auth-page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font, "Vazirmatn", Tahoma, Arial, sans-serif);
  background: linear-gradient(180deg, #fbf7ee 0%, #eef3f8 100%);
  color: var(--text, #0b2a40);
}

html[data-theme="dark"] .auth-page-shell {
  background: linear-gradient(180deg, #041329 0%, #071b2a 100%);
  color: var(--text, #f9fbfd);
}

.auth-page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 8px;
}

.auth-page-top .brand-copy strong {
  font-size: 1.1rem;
}

.auth-back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #c9a227;
  text-decoration: none;
  white-space: nowrap;
}

.auth-page-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 48px;
}

.auth-page-card {
  width: min(940px, 100%);
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(7, 21, 46, 0.18);
  background: #07152e;
}

.auth-page-card .auth-modal-grid {
  min-height: 480px;
}

.auth-form-head__badge {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(239, 183, 62, 0.12);
  color: #b8860b;
  font-size: 0.82rem;
  font-weight: 900;
}

.auth-form-head__lead {
  margin: 0;
  color: #667085;
  font-size: 0.92rem;
  line-height: 1.9;
}

.auth-visual-lead {
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  line-height: 2.05;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.auth-tabs button,
.auth-tabs .auth-tab {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d6e0f1;
  background: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  color: #17324b;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.auth-tabs .active {
  border-color: #c9a227;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(248, 231, 168, 0.35));
  color: #0f2533;
}

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

.auth-step .auth-label {
  margin-top: 14px;
}

.auth-step .auth-label:first-child {
  margin-top: 0;
}

.auth-submit.btn-gold {
  width: 100%;
  margin-top: 18px;
}

.auth-footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  text-align: center;
  font-size: 0.9rem;
}

.auth-footer-links a {
  color: #c9a227;
  font-weight: 800;
  text-decoration: none;
}

.auth-alert-error {
  color: #d92d20;
  font-size: 0.88rem;
  font-weight: 700;
  margin: 8px 0 12px;
}

.auth-form-head span:not(.auth-form-head__badge) {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(30, 105, 232, 0.08);
  color: #1e69e8;
  font-size: 0.82rem;
  font-weight: 900;
}

.auth-input:focus,
.auth-otp-cell:focus {
  border-color: #c9a227;
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.15);
}

.auth-back {
  color: #c9a227;
}

.auth-phone-preview strong {
  color: #c9a227;
}

.d-none {
  display: none !important;
}

@media (min-width: 992px) {
  .auth-visual--desktop-only {
    display: flex;
  }
}

@media (max-width: 991.98px) {
  .auth-visual--desktop-only {
    display: none;
  }

  .auth-page-card .auth-modal-grid {
    min-height: auto;
  }

  .auth-page-main {
    align-items: flex-start;
    padding-top: 8px;
  }
}

/* Bootstrap modal (مودال ورود در صفحه اصلی) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.show {
  display: block;
}

.modal.fade .modal-dialog {
  transform: translate(0, -40px);
  transition: transform 0.25s ease-out;
}

.modal.show .modal-dialog {
  transform: none;
}

.modal-dialog {
  position: relative;
  width: auto;
  max-width: min(940px, 94vw);
  margin: 0.75rem auto;
  pointer-events: none;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1.5rem);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: transparent;
  background-clip: padding-box;
  border: 0;
  outline: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background-color: rgba(4, 19, 41, 0.65);
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 1;
}

body.modal-open {
  overflow: hidden;
}
