/* ===== Auth modal (ورود / عضویت) ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 10, 16, 0.66);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.auth-overlay.is-open { opacity: 1; visibility: visible; }
.auth-overlay-nested { z-index: 260; }

.auth-mobile-btn {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid rgba(240, 164, 40, 0.45);
  border-radius: 10px;
  color: var(--gold-soft);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 14px;
}
.auth-mobile-btn:hover {
  border-color: var(--gold);
  background: var(--gold-tint);
}
.auth-mobile-btn.is-locked {
  cursor: default;
  color: var(--text);
  border-color: rgba(70, 161, 113, 0.55);
  background: var(--surface-2);
}
.auth-mobile-btn.is-locked:hover {
  border-color: rgba(70, 161, 113, 0.55);
  background: var(--surface-2);
}

.auth-modal {
  width: min(100%, 420px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 28px 26px 24px;
  box-shadow: var(--shadow);
  transform: translateY(14px) scale(.98);
  transition: transform .22s ease;
}
.auth-modal-wide { width: min(100%, 640px); }
.auth-overlay.is-open .auth-modal { transform: translateY(0) scale(1); }

.auth-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.auth-head img { width: 40px; height: 40px; object-fit: contain; }
.auth-head h3 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-head h3 .pill {
  font-size: 12px;
  font-weight: 700;
}
.auth-head p { font-size: 12.5px; color: var(--text-2); }
.auth-head p[hidden] { display: none !important; }
.auth-close {
  margin-inline-start: auto;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: #6e3a3a;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background .15s ease;
}
.auth-close::before,
.auth-close::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  width: 15px;
  height: 2px;
  margin: -1px -7.5px;
  background: #f0d5d5;
  border-radius: 1px;
  pointer-events: none;
}
.auth-close::before { transform: rotate(45deg); }
.auth-close::after { transform: rotate(-45deg); }
.auth-close:hover { background: #7d4545; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 22px;
}
.auth-tabs[hidden] { display: none !important; }
.auth-tab {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 10px;
  min-height: 44px;
  border-radius: 9px;
  cursor: pointer;
  transition: all .15s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #1c1204;
}

.auth-form { display: none; }
.auth-form.is-active { display: block; }

.auth-otp-copy {
  text-align: center;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.8;
  margin: 0 0 18px;
}
.auth-otp-input {
  text-align: center !important;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.42em;
  padding-inline: 10px 0 !important;
}
.auth-otp-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.auth-otp-resend {
  border: none;
  background: none;
  color: var(--gold-soft);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
  padding: 0 8px;
}
.auth-otp-resend:disabled { color: var(--text-2); cursor: default; font-weight: 600; }
.auth-otp-back {
  appearance: none;
  border: none;
  background: none;
  color: var(--gold-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
  padding: 0 8px;
  text-decoration: none;
}
.auth-otp-back::before { content: "→ "; }
.auth-otp-back:hover { color: var(--gold); }

.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}
.auth-field input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  padding: 12px 14px;
  min-height: 46px;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-field input::placeholder { color: rgba(245,242,236,0.35); }
.auth-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-tint);
}
.auth-field select,
.auth-field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  padding: 12px 14px;
  min-height: 46px;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-field select { cursor: pointer; appearance: none; }
.auth-field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.8;
}
.auth-field textarea[name="address"],
.auth-field textarea[autocomplete="street-address"] {
  text-align: start;
}
.auth-field select:focus,
.auth-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-tint);
}
.auth-field textarea::placeholder { color: rgba(245,242,236,0.35); }
.auth-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
@media (max-width: 560px) {
  .auth-two-col { grid-template-columns: 1fr; }
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 16px;
  font-size: 13px;
}
.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.auth-remember input { accent-color: var(--gold); width: 15px; height: 15px; cursor: pointer; }
.auth-forgot { color: var(--gold-soft); font-size: 13px; }
.auth-forgot:hover { color: var(--gold); }

.auth-submit { width: 100%; justify-content: center; }

.auth-error {
  display: none;
  color: #ff8a8d;
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-error.is-visible { display: block; }

.auth-success {
  display: none;
  color: #7fd6a4;
  background: rgba(70, 161, 113, 0.12);
  border: 1px solid rgba(70, 161, 113, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-success.is-visible { display: block; }

.auth-switch {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13.5px;
  color: var(--text-2);
}
.auth-switch a {
  color: var(--gold-soft);
  font-weight: 700;
  cursor: pointer;
}
.auth-switch a:hover { color: var(--gold); }

.auth-terms {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.9;
}
.auth-terms a { color: var(--gold-soft); }

@media (max-width: 480px) {
  .auth-modal { padding: 22px 18px 20px; }
}
