/* ===========================================================================
   طراحی تازهٔ صفحه‌های ورود (/login)، ورود با موبایل (/auth) و عضویت (/register)

   فقط روی این صفحه‌ها بارگذاری می‌شود (kft/loader.php). ساختار HTML و کلاس‌های قالب
   دست‌نخورده‌اند و فقط ظاهر عوض شده، پس همهٔ جاوااسکریپت قالب (ارسال فرم، کپچا،
   کد تأیید) مثل قبل کار می‌کند.

   مینیمال و شفاف (بدون مه و محو)، هم‌رنگ سایت (سرمه‌ای + آبی)، با حرکت‌های ملایم:
   ورود پله‌ای اجزا، نور چرخان لبهٔ کارت، شناوری لوگو، درخشش دکمه.
   با prefers-reduced-motion همهٔ حرکت‌ها خاموش می‌شوند.
   =========================================================================== */

@property --kft-ang {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* ---------- صحنه ---------- */
html:has(.manual-register-form),
body:has(.manual-register-form) {
  background: linear-gradient(180deg, #070842 0%, #04052b 100%) fixed !important;
}

.register {
  --kft-blue: #2f9bff;
  --kft-blue-deep: #0a74d6;
  --kft-ice: #9ccbff;
  --kft-text: #eaf1ff;
  --kft-dim: rgba(220, 230, 255, 0.66);
  --kft-line: rgba(160, 185, 240, 0.34);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 !important;
  padding: 28px 16px;
  align-items: center !important;
}

/* نقطه‌های ریز، محو در لبه‌ها */
.register::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.2px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 18%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 18%, transparent 72%);
  pointer-events: none;
}

/* ---------- کارت شیشه‌ای ---------- */
.register .manual-register-form {
  position: relative;
  width: min(430px, 100%);
  border-radius: 28px;
  padding: 26px 6px 8px;
  color: var(--kft-text);
  background: #0a0e45;
  border: 1px solid rgba(160, 185, 240, 0.22);
  box-shadow: 0 24px 56px -24px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: kftCardIn 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* لبهٔ نورانی که دور کارت می‌چرخد */
.register .manual-register-form::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--kft-ang), transparent 0 58%, rgba(78, 166, 255, 0.95) 78%, rgba(46, 229, 157, 0.7) 88%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: kftSpin 7s linear infinite;
  pointer-events: none;
}

@keyframes kftSpin { to { --kft-ang: 360deg; } }

@keyframes kftCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- لوگو ---------- */
.register .manual-register-form .logo {
  position: static !important;
  transform: none !important;
  text-align: center;
  margin: 4px 0 2px;
}

.register .manual-register-form .logo a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  color: #fff;
}

.register .manual-register-form .logo img {
  height: 54px;
  width: auto !important;
  animation: kftFloat 5.5s ease-in-out infinite;
}

.register .manual-register-form .logo span {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

@keyframes kftFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* ---------- عنوان (فقط /auth) ---------- */
.register .manual-register-form .title {
  border: 0 !important;
  padding: 8px 24px 0 !important;
}

.register .manual-register-form .title h2 {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(90deg, #fff 20%, var(--kft-ice));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.register .manual-register-form .title::after {
  content: "با شماره موبایل وارد شوید یا ثبت‌نام کنید";
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--kft-dim);
}

/* ---------- فرم‌ها ---------- */
.register .ajax_form,
.register .rcp_login_data {
  padding: 16px 26px 22px !important;
}

/* ورود پله‌ای اجزا */
.register .logo,
.register .title,
.register .ajax_form > *,
.register #mobile_auth > *,
.register #mobile_auth_2 > *,
.register .register__step1 > *,
.register .register__step2 > * {
  animation: kftUp 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.register .logo { animation-delay: 0.1s; }
.register .title { animation-delay: 0.18s; }
.register .ajax_form > :nth-child(1), .register #mobile_auth > :nth-child(1), .register #mobile_auth_2 > :nth-child(1) { animation-delay: 0.22s; }
.register .ajax_form > :nth-child(2), .register #mobile_auth > :nth-child(2), .register #mobile_auth_2 > :nth-child(2) { animation-delay: 0.27s; }
.register .ajax_form > :nth-child(3), .register #mobile_auth > :nth-child(3), .register #mobile_auth_2 > :nth-child(3) { animation-delay: 0.32s; }
.register .ajax_form > :nth-child(4), .register #mobile_auth > :nth-child(4), .register #mobile_auth_2 > :nth-child(4) { animation-delay: 0.37s; }
.register .ajax_form > :nth-child(5), .register #mobile_auth > :nth-child(5), .register #mobile_auth_2 > :nth-child(5) { animation-delay: 0.42s; }
.register .ajax_form > :nth-child(6), .register #mobile_auth > :nth-child(6), .register #mobile_auth_2 > :nth-child(6) { animation-delay: 0.47s; }
.register .ajax_form > :nth-child(7), .register #mobile_auth > :nth-child(7), .register #mobile_auth_2 > :nth-child(7) { animation-delay: 0.52s; }
.register .ajax_form > :nth-child(n + 8), .register #mobile_auth > :nth-child(n + 8), .register #mobile_auth_2 > :nth-child(n + 8) { animation-delay: 0.57s; }

@keyframes kftUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- ورودی‌ها با برچسب شناور ---------- */
.register .input_float_label {
  position: relative;
  margin-bottom: 14px;
}

.register .input_float_label label {
  position: absolute !important;
  top: 12px !important;
  right: 16px !important;
  z-index: 2;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  opacity: 1 !important;
  color: var(--kft-dim) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  line-height: 1;
  transform: translateY(-50%);
  transform-origin: right center;
  pointer-events: none;
  white-space: nowrap;
  transition: top 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), font-size 0.22s, color 0.22s;
}

.register .register-input,
.register .otp-field,
.register .input_float_label input {
  height: 58px !important;
  width: 100%;
  padding: 22px 16px 4px !important;
  text-indent: 0 !important;
  line-height: normal !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1.5px solid var(--kft-line) !important;
  border-radius: 15px !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s !important;
}

.register .register-input:hover,
.register .input_float_label input:hover {
  border-color: rgba(190, 208, 250, 0.6) !important;
}

.register .input_float_label:focus-within label {
  color: var(--kft-ice) !important;
}

.register .register-input:focus,
.register .input_float_label input:focus {
  border-color: var(--kft-blue) !important;
  background: rgba(47, 155, 255, 0.09) !important;
  box-shadow: 0 0 0 4px rgba(47, 155, 255, 0.22) !important;
}

/* شماره موبایل و کد: ارقام چپ‌به‌راست */
.register #phone_field,
.register .kelaket_local_captcha_code {
  direction: ltr;
  text-align: right;
}

.register input:-webkit-autofill,
.register input:-webkit-autofill:hover,
.register input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff !important;
  -webkit-box-shadow: 0 0 0 1000px #0c1450 inset !important;
  border: 1.5px solid var(--kft-blue) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* نمایش/پنهان رمز */
.register .kelaket_showpass {
  position: absolute !important;
  left: 6px !important;
  top: 50% !important;
  transform: translateY(-50%);
  margin: 0 !important;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent !important;
  color: var(--kft-dim) !important;
  z-index: 3;
  transition: color 0.2s, background 0.2s;
}

.register .kelaket_showpass:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* ---------- دکمهٔ اصلی ---------- */
.register .ajax_from__login,
.register .ajax_form__register,
.register .submit-reg,
.register .submit_auth_2 {
  position: relative;
  overflow: hidden;
  width: 100% !important;
  height: 58px !important;
  margin: 8px 0 0 !important;
  padding: 0 20px !important;
  font-size: 16.5px !important;
  font-weight: 800 !important;
  color: #fff !important;
  background: linear-gradient(115deg, var(--kft-blue-deep), var(--kft-blue) 55%, #5cb0ff) !important;
  background-size: 220% 100% !important;
  background-position: 0 0 !important;
  border: 0 !important;
  border-radius: 15px !important;
  box-shadow: 0 8px 18px -8px rgba(47, 155, 255, 0.55) !important;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s, background-position 0.6s !important;
}

.register .ajax_from__login:hover,
.register .ajax_form__register:hover,
.register .submit-reg:hover,
.register .submit_auth_2:hover {
  transform: translateY(-2px);
  background-position: 100% 0 !important;
  box-shadow: 0 12px 24px -8px rgba(47, 155, 255, 0.7) !important;
}

.register .ajax_from__login:active,
.register .ajax_form__register:active,
.register .submit-reg:active,
.register .submit_auth_2:active {
  transform: translateY(0) scale(0.985);
}

/* درخشش عبوری روی دکمه‌های button */
.register button.ajax_from__login::after,
.register button.ajax_form__register::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg);
  animation: kftShine 4.5s ease-in-out infinite 1.2s;
  pointer-events: none;
}

@keyframes kftShine {
  0%, 60% { left: -60%; }
  100%    { left: 130%; }
}

/* ---------- دکمهٔ دوم (موبایل / عضویت) و جداکننده ---------- */
.register .custom_register_button,
.register .kft_mobile_login {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 9px;
  width: 100% !important;
  height: 56px;
  margin: 0 !important;
  padding: 0 18px !important;
  font-size: 16px !important;
  font-weight: 700;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1.5px solid rgba(160, 185, 240, 0.42) !important;
  border-radius: 15px;
  box-shadow: none !important;
  transition: transform 0.2s, border-color 0.25s, background 0.25s;
}

.register .custom_register_button:hover,
.register .kft_mobile_login:hover {
  transform: translateY(-2px);
  border-color: var(--kft-blue) !important;
  background: rgba(47, 155, 255, 0.15) !important;
}

/* «عضویت در سایت» / لینک‌های پایین: سبک و بدون کادر تا سلسله‌مراتب دکمه‌ها روشن باشد */
.register .ajax_form__links .custom_register_button {
  height: 46px;
  font-size: 15px !important;
  font-weight: 700;
  color: var(--kft-ice) !important;
  background: transparent !important;
  border-color: transparent !important;
}

.register .ajax_form__links .custom_register_button:hover {
  background: rgba(47, 155, 255, 0.12) !important;
  border-color: transparent !important;
}

.register .kft_mobile_login {
  border-color: rgba(78, 166, 255, 0.7) !important;
}

.register .kft_mobile_login i {
  color: var(--kft-ice);
  font-size: 18px;
}

.register .kft_or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 !important;
  color: var(--kft-dim);
  font-size: 12.5px;
}

.register .kft_or::before,
.register .kft_or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 185, 240, 0.4), transparent);
}

.register .ajax_form__links {
  margin-top: 6px !important;
}

/* ---------- لینک‌ها و متن‌های کوچک ---------- */
.register .lost_pass_link {
  margin: 18px 0 6px !important;
  text-align: center;
  font-size: 14px !important;
  color: var(--kft-dim) !important;
}

.register .lost_pass_link:hover {
  color: #fff !important;
}

.register .manual-register-form a {
  margin-right: 0;
}

.register .wrong_phone_number,
.register .wrong_phone_number a {
  font-size: 13.5px !important;
}

.register .wrong_phone_number a {
  color: var(--kft-ice) !important;
}

.register .kelaket_rules {
  margin: 14px 0 0 !important;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--kft-dim);
}

.register .kelaket_rules a,
.register #mobile_auth ~ * a {
  color: var(--kft-ice);
}

/* ---------- کد تأیید ---------- */
.register .otp-form .d-flex.gap-2 {
  gap: 9px !important;
}

.register .otp-form .otp-field {
  height: 58px !important;
  padding: 0 !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  text-align: center;
  border-radius: 14px !important;
  transition: transform 0.2s, border-color 0.25s, box-shadow 0.25s, background 0.25s !important;
}

.register .otp-form .otp-field:focus {
  transform: translateY(-3px) scale(1.06);
  border-color: var(--kft-blue) !important;
  background: rgba(47, 155, 255, 0.12) !important;
  box-shadow: 0 0 0 4px rgba(47, 155, 255, 0.22) !important;
}

/* ---------- کپچا ---------- */
.register .kelaket_local_captcha_image {
  border-radius: 12px;
  border: 1.5px solid var(--kft-line);
  margin-top: 0 !important;
}

/* ---------- پیام‌ها ---------- */
.register .msg:empty {
  display: none;
}

.register .rcp_error,
.register .alert {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 13px;
  font-size: 13.5px;
  color: #ffc2cb !important;
  background: rgba(255, 70, 100, 0.13) !important;
  border: 1px solid rgba(255, 100, 125, 0.4) !important;
  animation: kftUp 0.35s ease both;
}

.register .rcp_success,
.register .alert-success {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 13px;
  font-size: 13.5px;
  color: #b8f5d6 !important;
  background: rgba(46, 229, 157, 0.12) !important;
  border: 1px solid rgba(46, 229, 157, 0.4) !important;
}

/* ---------- موبایل ---------- */
@media (max-width: 480px) {
  .register {
    padding: 18px 12px;
  }

  .register .manual-register-form {
    border-radius: 24px;
  }

  .register .ajax_form,
  .register .rcp_login_data {
    padding: 14px 18px 20px !important;
  }

  .register .otp-form .otp-field {
    height: 52px !important;
    font-size: 20px !important;
  }
}

/* ---------- کاربرانی که حرکت کمتر خواسته‌اند ---------- */
@media (prefers-reduced-motion: reduce) {
  .register::before,
  .register .manual-register-form,
  .register .manual-register-form::before,
  .register .manual-register-form .logo img,
  .register .logo,
  .register .title,
  .register .ajax_form > *,
  .register #mobile_auth > *,
  .register #mobile_auth_2 > *,
  .register button.ajax_from__login::after,
  .register button.ajax_form__register::after {
    animation: none !important;
  }
}

/* فونت سایت برای ورودی‌ها و دکمه‌ها (مرورگر به‌صورت پیش‌فرض فونت سیستم می‌گذارد) */
.register input,
.register button,
.register textarea,
.register select,
.register label,
.register .custom_register_button {
  font-family: inherit !important;
}

/* فیلد پنهان خودکارپرکنِ کد (opacity:0 درون‌خطی) نباید با انیمیشن ورود دیده شود */
.register #hidden_otp_input {
  animation: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background: transparent !important;
  border: 0 !important;
  height: 1px !important;
  padding: 0 !important;
}
