/* ==========================================================================
   طراحی جدید صفحه‌های ورود / عضویت / ورود با رمز یکبار مصرف / ریست رمز
   فقط ظاهر؛ همه‌ی class و id ها و جاوااسکریپت قالب دست‌نخورده است.
   ========================================================================== */

html:has(.register) {
  background: #060919;
}
body:has(.register) {
  margin: 0;
  background: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.register {
  --ka: #4d6bff;
  --ka2: #2fa8ff;
  --ka-glow: rgba(77, 107, 255, .45);
  --ink: #e8eeff;
  --dim: #8f9cc7;
  --line: rgba(130, 160, 255, .18);
  --field: rgba(255, 255, 255, .045);

  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 36px 16px;
  color: var(--ink);
}

/* پس‌زمینه: شفق آبی + نوارهای نوار فیلم */
.register::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(40% 36% at 18% 22%, rgba(77, 107, 255, .42), transparent 70%),
    radial-gradient(36% 34% at 84% 18%, rgba(47, 168, 255, .30), transparent 70%),
    radial-gradient(44% 40% at 70% 90%, rgba(120, 70, 255, .28), transparent 70%),
    radial-gradient(30% 30% at 12% 86%, rgba(47, 168, 255, .20), transparent 70%);
  filter: saturate(1.2);
  animation: kfAurora 18s ease-in-out infinite alternate;
  pointer-events: none;
}
.register::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .09) 0 16px, transparent 16px 34px) 18px 0 / 9px 100% no-repeat,
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .09) 0 16px, transparent 16px 34px) calc(100% - 18px) 0 / 9px 100% no-repeat,
    linear-gradient(180deg, rgba(6, 9, 25, .15), rgba(6, 9, 25, .55));
  pointer-events: none;
}
@media (max-width: 560px) {
  .register::after {
    background: linear-gradient(180deg, rgba(6, 9, 25, .15), rgba(6, 9, 25, .55));
  }
}
@keyframes kfAurora {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* کارت */
.register .manual-register-form {
  position: relative;
  width: 440px !important;
  max-width: 100%;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(22, 30, 62, .78), rgba(12, 17, 40, .86));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 0 90px rgba(77, 107, 255, .16);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  color: var(--ink);
  animation: kfRise .55s cubic-bezier(.2, .8, .2, 1) both;
}
/* خط نور بالای کارت */
.register .manual-register-form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ka) 30%, var(--ka2) 70%, transparent);
  opacity: .9;
}
@keyframes kfRise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .register::before, .register .manual-register-form { animation: none; }
}

/* لوگو: داخل کارت، وسط */
.register .manual-register-form .logo {
  position: static;
  transform: none;
  margin: 32px 0 6px;
  text-align: center;
}
.register .manual-register-form .logo a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  text-decoration: none;
}
.register .manual-register-form .logo img {
  height: 54px;
  width: auto !important;
  max-width: 190px;
  filter: drop-shadow(0 8px 22px var(--ka-glow));
}
.register .manual-register-form .logo span {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.2px;
}

/* سوییچ ورود / عضویت */
.kf-auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 18px 26px 0;
  padding: 4px;
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.register .manual-register-form .kf-auth-tabs a {
  display: block;
  margin: 0;
  padding: 11px 0;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 14px;
  transition: color .2s, background .2s, box-shadow .2s;
}
.register .manual-register-form .kf-auth-tabs a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--ka), var(--ka2));
  box-shadow: 0 8px 22px var(--ka-glow);
}

/* تیتر */
.kf-auth-head {
  padding: 22px 28px 0;
  text-align: center;
}
.kf-auth-head h1 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
}
.kf-auth-head p {
  margin: 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.9;
}
/* صفحه‌ی /auth (قالب اصلی عنوان خودش را دارد) */
.register .manual-register-form .title {
  padding: 22px 28px 0;
  border: 0;
  text-align: center;
}
.register .manual-register-form .title h2 {
  margin: 0;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

/* فرم */
.register .manual-register-form .ajax_form,
.register .manual-register-form .rcp_login_data {
  position: relative;
  padding: 18px 26px 28px;
  margin: 0;
}
.register .manual-register-form .ajax_form .msg:empty { display: none; }
.register .manual-register-form .ajax_form .msg { margin-bottom: 10px; }

/* فیلدها: برچسب بالای فیلد، فیلد شیشه‌ای */
.register .manual-register-form .input_float_label {
  position: relative;
  margin: 0 0 14px;
}
.register .manual-register-form .input_float_label label {
  position: static;
  display: block;
  margin: 0 3px 7px;
  padding: 0;
  background: none;
  color: #b4c1ee;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 1;
}
.register .manual-register-form .register-input,
.register .manual-register-form .ajax_form .register-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 16px;
  text-indent: 0;
  line-height: normal;
  text-align: start;
  color: #fff;
  font-size: 16px; /* زیر ۱۶ در iOS زوم می‌کند */
  font-weight: 500;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: 0;
  box-shadow: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.register .manual-register-form .register-input:focus {
  background: rgba(255, 255, 255, .07);
  border-color: var(--ka);
  box-shadow: 0 0 0 4px rgba(77, 107, 255, .2);
}
.register .manual-register-form .register-input::placeholder { color: #6f7ca8; }
.register .manual-register-form input:-webkit-autofill,
.register .manual-register-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #121a3d inset;
  border: 1px solid var(--line);
  caret-color: #fff;
}

/* دکمه‌ی نمایش رمز */
.register .manual-register-form .kelaket_showpass {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 52px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 16px;
  background: none;
  border: 0;
  cursor: pointer;
}
.register .manual-register-form .kelaket_showpass:hover { color: #fff; }
.register .manual-register-form .register-input[type="password"] { padding-left: 50px; }

/* رمز و تکرار رمز: در موبایل زیر هم */
.register .manual-register-form .register__step1 .d-flex.gap-2 { gap: 12px !important; }
.register .manual-register-form .register__step1 .d-flex.gap-2 .register-input { margin: 0 !important; }
@media (max-width: 440px) {
  .register .manual-register-form .register__step1 .d-flex.gap-2 { flex-direction: column; gap: 0 !important; }
}

/* کپچا */
.register .manual-register-form .kelaket_local_captcha { margin-top: 4px !important; }
.register .manual-register-form .kelaket_local_captcha_row {
  gap: 10px;
  align-items: flex-end !important;
  justify-content: space-between !important;
}
.register .manual-register-form .kelaket_local_captcha .input_float_label {
  flex: 1;
  width: auto;
  min-width: 0;
  margin: 0 0 14px;
  text-align: start;
}
.register .manual-register-form .kelaket_local_captcha_code {
  letter-spacing: 6px;
  text-align: center;
  font-weight: 800;
}
.register .manual-register-form .kelaket_local_captcha_image {
  flex: none;
  width: 124px;
  height: 52px;
  margin: 0 0 14px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  cursor: pointer;
}

/* دکمه‌های اصلی */
.register .manual-register-form .ajax_from__login,
.register .manual-register-form .ajax_form__register,
.register .manual-register-form .submit-reg,
.register .manual-register-form .submit_auth_2,
.register .manual-register-form #mobile_auth_submit {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  margin: 6px 0 0;
  padding: 0 16px;
  color: #fff !important;
  font-size: 15.5px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ka), var(--ka2));
  border: 0 !important;
  border-radius: 18px;
  box-shadow: 0 12px 28px var(--ka-glow);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.register .manual-register-form .ajax_from__login::after,
.register .manual-register-form .ajax_form__register::after,
.register .manual-register-form .submit-reg::after,
.register .manual-register-form .submit_auth_2::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  transition: inset .7s ease;
  pointer-events: none;
}
.register .manual-register-form .ajax_from__login:hover::after,
.register .manual-register-form .ajax_form__register:hover::after,
.register .manual-register-form .submit-reg:hover::after,
.register .manual-register-form .submit_auth_2:hover::after { inset: 0 auto 0 130%; }
.register .manual-register-form .ajax_from__login:active,
.register .manual-register-form .ajax_form__register:active,
.register .manual-register-form .submit-reg:active,
.register .manual-register-form .submit_auth_2:active { transform: scale(.98); }
.register .manual-register-form .submit-reg:disabled,
.register .manual-register-form .ajax_from__login:disabled,
.register .manual-register-form .ajax_form__register:disabled { filter: grayscale(.5) brightness(.8); cursor: not-allowed; }
.register .manual-register-form .ajax_form__submit { margin: 0; }

/* «یا» + ورود با رمز یکبار مصرف */
.kf-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--dim);
  font-size: 12px;
}
.kf-or::before, .kf-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.register .manual-register-form .mt-3,
.register .manual-register-form .mt-4 { width: 100%; margin-top: 0 !important; }
.register .manual-register-form .mt-3 a.otp_login_button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0;
  color: var(--ink) !important;
  font-size: 14.5px;
  font-weight: 700;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: background .2s, border-color .2s;
}
.register .manual-register-form .mt-3 a.otp_login_button:hover,
.register .manual-register-form .mt-3 a.otp_login_button:active {
  background: rgba(77, 107, 255, .18);
  border-color: var(--ka);
}

/* لینک‌های جانبی */
.register .manual-register-form .lost_pass_link {
  display: block;
  margin: 16px 0 0;
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
  background: none;
}
.register .manual-register-form .lost_pass_link:hover { color: #fff; }
.register .manual-register-form .lost_pass_link i { margin-inline-end: 6px; }
/* لینک عضویت/ورود پایین فرم، چون سوییچ بالا همین کار را می‌کند */
.register .manual-register-form .ajax_form__links { display: none !important; }
.register .manual-register-form .kelaket_rules {
  margin: 18px 0 0 !important;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 2;
}
.register .manual-register-form .kelaket_rules a {
  margin: 0;
  color: #b4c1ee;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.register .manual-register-form .wrong_phone_number {
  margin: 10px 0 18px !important;
  color: var(--dim);
  font-size: 13px !important;
  text-align: center;
}

/* پیام‌ها */
.register .manual-register-form .rcp_error,
.register .manual-register-form .rcp_success {
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.8;
}
.register .manual-register-form .rcp_error {
  color: #ffb3bc;
  background: rgba(255, 45, 64, .12);
  border: 1px solid rgba(255, 45, 64, .28);
}
.register .manual-register-form .rcp_success {
  color: #8ff0bd;
  background: rgba(16, 216, 118, .12);
  border: 1px solid rgba(16, 216, 118, .28);
}

/* کد تایید ۶ رقمی */
.register .manual-register-form .otp-form .otp-field {
  box-sizing: border-box;
  height: 56px;
  padding: 0;
  line-height: normal;
  color: #fff;
  font-size: 20px; /* ≥16 تا iOS زوم نکند */
  font-weight: 800;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.register .manual-register-form .otp-form .otp-field:focus {
  border-color: var(--ka);
  box-shadow: 0 0 0 4px rgba(77, 107, 255, .2);
}
.register .manual-register-form #resend_timer { color: var(--dim); font-size: 12.5px; }

/* لودینگ */
.register .manual-register-form .load_overlay {
  background: rgba(7, 10, 26, .66);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 0 0 30px 30px;
}

@media (max-width: 440px) {
  .register { padding: 20px 12px; }
  .register .manual-register-form { border-radius: 26px; }
  .register .manual-register-form .ajax_form,
  .register .manual-register-form .rcp_login_data { padding-inline: 20px; }
  .kf-auth-tabs { margin-inline: 20px; }
}
