/* ========== صفحه ورود و ثبت‌نام — کاشت مروارید آرا ========== */

.cl-login-demo {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background:
    radial-gradient(40% 50% at 15% 20%, #ffe3ef, transparent 70%),
    radial-gradient(35% 45% at 85% 25%, #ffeaf3, transparent 70%),
    radial-gradient(45% 50% at 60% 95%, #fff5f9, transparent 70%),
    #fff5f9;
  font-family: "B Mitra", Tahoma, sans-serif;
  direction: rtl;
  color: #151515;
}

.cl-login {
  --pink-50:  #fff5f9;
  --pink-100: #ffe3ef;
  --pink-300: #f7a8c8;
  --pink-500: #e5528f;
  --pink-600: #d63384;
  --pink-700: #a8225f;
  --black:    #151515;
  --gray:     #6a6a6a;
  --white:    #ffffff;

  width: 100%;
  max-width: 440px;
  padding: 2rem clamp(1.2rem, 5vw, 2.2rem) 1.6rem;
  border: 1.5px solid var(--pink-100);
  border-radius: 28px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 60px -20px rgba(214, 51, 132, .28);
  color: var(--black);
  line-height: 1.9;
}

.cl-login *,
.cl-login *::before,
.cl-login *::after { box-sizing: border-box; }
.cl-login [hidden] { display: none !important; }
.cl-login a { color: inherit; text-decoration: none; }

/* ---------- انیمیشن ورود کارت ---------- */
.cl-login[data-anim] {
  animation: cl-card-in .7s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes cl-card-in {
  from { opacity: 0; transform: translateY(24px) scale(.96); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.cl-login [data-anim-item] {
  opacity: 0;
  animation: cl-item-in .6s cubic-bezier(.2, .8, .2, 1) both;
}
.cl-login [data-anim-item]:nth-child(1) { animation-delay: .15s; }
.cl-login [data-anim-item]:nth-child(2) { animation-delay: .28s; }
.cl-login [data-anim-item]:nth-child(3) { animation-delay: .42s; }
@keyframes cl-item-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- سربرگ ---------- */
.cl-login__head {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .7rem;
  align-items: center;
  margin-bottom: 1.6rem;
}
.cl-login__logo { grid-row: span 2; animation: cl-pulse 3.2s ease-in-out infinite; }
@keyframes cl-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.cl-login__brand {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--pink-700);
  line-height: 1.3;
}
.cl-login__tagline {
  margin: 0;
  color: var(--gray);
  font-size: .9rem;
}

/* ---------- تب‌ها ---------- */
.cl-login__tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--pink-50);
  margin-bottom: 1.4rem;
}
.cl-login__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(214, 51, 132, .12), 0 4px 10px -4px rgba(214, 51, 132, .25);
  transition: transform .35s cubic-bezier(.3, .7, .2, 1);
}
.cl-login__tabs.is-second .cl-login__thumb {
  transform: translateX(-100%);
}
.cl-login__tab {
  position: relative;
  z-index: 1;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--gray);
  font: inherit;
  font-family: "B Mitra", Tahoma, sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  
}
.cl-login__tab.on { color: var(--pink-700); }
.cl-login__tab:hover { color: var(--pink-600); }

/* ---------- پنل‌ها ---------- */
.cl-login__panels { overflow: hidden; }
.cl-login__panel { padding-top: .4rem; border-radius: 12px; }
.cl-login__panel.is-from-right { animation: cl-right .38s cubic-bezier(.3, .7, .2, 1); }
.cl-login__panel.is-from-left  { animation: cl-left  .38s cubic-bezier(.3, .7, .2, 1); }
@keyframes cl-right { from { opacity: 0; transform: translateX(-40px); } }
@keyframes cl-left  { from { opacity: 0; transform: translateX(40px);  } }

/* ---------- عنوان ---------- */
.cl-login__title {
  margin: 0 0 1.1rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--pink-700);
}

/* ---------- فیلدها ---------- */
.cl-login__field { margin-bottom: .95rem; }
.cl-login__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: .35rem;
}
.cl-login__label {
  display: block;
  margin-bottom: .35rem;
  font-size: .92rem;
  font-weight: 700;
  color: var(--black);
}
.cl-login__row .cl-login__label { margin-bottom: 0; }

.cl-login__input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: .65rem .9rem;
  border: 1.5px solid var(--pink-100);
  border-radius: 14px;
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-family: "B Mitra", Tahoma, sans-serif;
  font-size: 1rem;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.cl-login__input::placeholder { color: #b9b9b9; }
.cl-login__input:hover { border-color: var(--pink-300); }
.cl-login__input:focus {
  outline: none;
  border-color: var(--pink-600);
  box-shadow: 0 0 0 4px var(--pink-100);
  transform: translateY(-1px);
}
.cl-login__field.is-error .cl-login__input {
  border-color: var(--pink-700);
  box-shadow: 0 0 0 3px rgba(168, 34, 95, .12);
  animation: cl-shake .35s;
}
@keyframes cl-shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-4px); }
  75%     { transform: translateX(4px); }
}
.cl-login__field.is-ok .cl-login__input {
  border-color: #1f9d55;
  box-shadow: 0 0 0 3px #d6f3e1;
}

.cl-login__pw { position: relative; }
.cl-login__pw .cl-login__input { padding-left: 50px; }
.cl-login__eye {
  position: absolute;
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--pink-600);
  cursor: pointer;
  transition: background .2s;
}
.cl-login__eye:hover { background: var(--pink-50); }
.cl-login__eye-off,
.cl-login__eye[aria-pressed="true"] .cl-login__eye-on { display: none; }
.cl-login__eye[aria-pressed="true"] .cl-login__eye-off { display: block; }

/* ---------- تاریخ تولد ---------- */
.cl-login__birth {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: .4rem;
}
.cl-login__birth select {
  padding: .65rem 2rem .65rem .8rem;
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--pink-600) 50%),
    linear-gradient(135deg, var(--pink-600) 50%, transparent 50%);
  background-position: right 14px center, right 20px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* ---------- پیام‌ها ---------- */
.cl-login__alert {
  margin: 0 0 1rem;
  padding: .7rem .95rem;
  border-right: 5px solid var(--pink-600);
  border-radius: 10px;
  background: var(--pink-100);
  color: var(--pink-700);
  font-size: .9rem;
  font-weight: 600;
  animation: cl-item-in .4s ease both;
}
.cl-login__error {
  margin: .3rem 0 0;
  color: var(--pink-700);
  font-size: .85rem;
  font-weight: 600;
}
.cl-login__hint {
  margin: .3rem 0 0;
  color: var(--gray);
  font-size: .82rem;
}

/* ---------- لینک ---------- */
.cl-login__link {
  color: var(--pink-600);
  font-size: .88rem;
  font-weight: 700;
  transition: color .2s;
}
.cl-login__link:hover { color: var(--pink-700); text-decoration: underline; }

/* ---------- دکمه ---------- */
.cl-login__submit {
  position: relative;
  width: 100%;
  min-height: 50px;
  margin-top: .6rem;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--pink-500), var(--pink-700));
  background-size: 200% 100%;
  color: var(--white);
  font: inherit;
  font-family: "B Mitra", Tahoma, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(214, 51, 132, .55);
  transition: background-position .4s, transform .15s, box-shadow .25s;
  overflow: hidden;
}
.cl-login__submit:hover {
  background-position: 100% 0;
  box-shadow: 0 14px 30px -8px rgba(214, 51, 132, .7);
}
.cl-login__submit:active { transform: scale(.98); }
.cl-login__submit[aria-busy="true"] .cl-login__submit-text { opacity: 0; }
.cl-login__submit-spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
}
.cl-login__submit[aria-busy="true"] .cl-login__submit-spin {
  opacity: 1;
  animation: cl-spin .8s linear infinite;
}
@keyframes cl-spin { to { transform: rotate(360deg); } }

/* ---------- فوکوس ---------- */
.cl-login__tab:focus-visible,
.cl-login__panel:focus-visible,
.cl-login__input:focus-visible,
.cl-login__eye:focus-visible,
.cl-login__link:focus-visible,
.cl-login__submit:focus-visible {
  outline: 2px solid var(--pink-600);
  outline-offset: 2px;
}

/* ---------- پیام زنده ---------- */
.cl-login__live {
  color: var(--pink-700);
  font-size: .9rem;
  font-weight: 600;
}
.cl-login__live:not(:empty) {
  margin-top: 1rem;
  padding: .7rem 1rem;
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: 10px;
  animation: cl-item-in .35s ease both;
}

/* ---------- موبایل ---------- */
@media (max-width: 480px) {
  .cl-login { padding: 1.5rem 1.1rem 1.3rem; border-radius: 22px; }
  .cl-login__title { font-size: 1.2rem; }
  .cl-login__brand { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cl-login *, .cl-login *::before, .cl-login *::after {
    transition: none !important; animation: none !important;
  }
}

/* =========================================
   صفحه‌های تک‌فرمی: فراموشی، کد، رمز عبور
   ========================================= */

.cl-login__subtitle {
  margin: -.4rem 0 1.3rem;
  color: var(--gray);
  font-size: .98rem;
  line-height: 1.9;
}
.cl-login__phone {
  color: var(--pink-700);
  font-weight: 800;
  letter-spacing: .04em;
}

/* ----- فیلد کد OTP ----- */
.cl-login__otp {
  text-align: center;
  font-size: 1.5rem !important;
  letter-spacing: .55em;
  font-weight: 800;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  font-family: "B Mitra", Tahoma, sans-serif;
}

/* ----- لیست قوانین رمز عبور ----- */
.cl-login__rules {
  list-style: none;
  margin: -.35rem 0 1rem;
  padding: .85rem 1rem;
  background: var(--pink-50);
  border: 1.5px dashed var(--pink-300);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem .8rem;
}
@media (max-width: 480px) {
  .cl-login__rules { grid-template-columns: 1fr; }
}

.cl-login__rules li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  color: var(--gray);
  transition: color .2s;
}
.cl-login__rules li.ok {
  color: #1f9d55;
  font-weight: 700;
}

.cl-login__rule-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--pink-300);
  background: var(--white);
  position: relative;
  transition: background .2s, border-color .2s, transform .2s;
}
.cl-login__rules li.ok .cl-login__rule-icon {
  background: #1f9d55;
  border-color: #1f9d55;
  transform: scale(1.08);
}
.cl-login__rules li.ok .cl-login__rule-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

/* ----- دکمه انصراف/رد کردن ----- */
.cl-login__skip-wrap,
.cl-login__resend {
  margin-top: .9rem;
  text-align: center;
}
.cl-login__skip-wrap .cl-login__link,
.cl-login__resend .cl-login__link {
  border: 0;
  background: none;
  padding: .3rem .6rem;
  cursor: pointer;
  font: inherit;
  font-family: "B Mitra", Tahoma, sans-serif;
  font-size: .92rem;
}
.cl-login__skip-wrap .cl-login__link {
  color: var(--gray);
}
.cl-login__skip-wrap .cl-login__link:hover {
  color: var(--pink-700);
}

/* ----- پیام خطای مطابقت رمز ----- */
[data-match-msg]:not([hidden]) {
  animation: cl-item-in .3s ease both;
}

/* =========================================
   صفحه‌ی کد تایید (OTP)
   ========================================= */

.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .55rem;
  margin: .4rem 0 1rem;
  direction: ltr;
  justify-items: center;
}

.otp__digit {
  width: 100%;
  max-width: 58px;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--pink-100);
  border-radius: 16px;
  background: var(--white);
  color: var(--pink-700);
  font-family: "B Mitra", Tahoma, sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  text-align: center;
  padding: 0;
  outline: none;
  transition: border-color .2s, box-shadow .25s, transform .15s, background .25s;
  caret-color: var(--pink-600);
  animation: otp-pop .5s cubic-bezier(.2, .8, .2, 1) both;
}
.otp__digit:nth-child(1) { animation-delay: .05s; }
.otp__digit:nth-child(2) { animation-delay: .12s; }
.otp__digit:nth-child(3) { animation-delay: .19s; }
.otp__digit:nth-child(4) { animation-delay: .26s; }
.otp__digit:nth-child(5) { animation-delay: .33s; }
.otp__digit:nth-child(6) { animation-delay: .40s; }

@keyframes otp-pop {
  from { opacity: 0; transform: translateY(14px) scale(.85); }
  to   { opacity: 1; transform: none; }
}

.otp__digit:hover {
  border-color: var(--pink-300);
}

.otp__digit:focus {
  border-color: var(--pink-600);
  box-shadow: 0 0 0 4px var(--pink-100);
  transform: translateY(-2px) scale(1.05);
}

.otp__digit.filled {
  border-color: var(--pink-600);
  background: var(--pink-50);
  animation: otp-fill .35s cubic-bezier(.2, .8, .2, 1);
}

@keyframes otp-fill {
  0%   { transform: scale(.85); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* وقتی همه پر شدند — رقص کوچک */
.otp.complete .otp__digit {
  animation: otp-dance .55s cubic-bezier(.2, .8, .2, 1) both;
}
.otp.complete .otp__digit:nth-child(1) { animation-delay: 0s; }
.otp.complete .otp__digit:nth-child(2) { animation-delay: .06s; }
.otp.complete .otp__digit:nth-child(3) { animation-delay: .12s; }
.otp.complete .otp__digit:nth-child(4) { animation-delay: .18s; }
.otp.complete .otp__digit:nth-child(5) { animation-delay: .24s; }
.otp.complete .otp__digit:nth-child(6) { animation-delay: .30s; }

@keyframes otp-dance {
  0%   { transform: translateY(0)    scale(1); }
  35%  { transform: translateY(-6px) scale(1.08); }
  70%  { transform: translateY(2px)  scale(.98); }
  100% { transform: translateY(0)    scale(1); }
}

/* ---------- انیمیشن موفقیت ---------- */
.otp-success {
  margin: 1.2rem 0 .8rem;
  text-align: center;
  animation: cl-item-in .5s ease both;
}
.otp-success[hidden] { display: none; }

.otp-success__svg {
  width: 110px;
  height: 110px;
  color: #1f9d55;
  display: block;
  margin: 0 auto .6rem;
}

.otp-success__ring {
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  animation: otp-ring 1s ease-out forwards;
  opacity: .35;
}
.otp-success__pulse {
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  animation: otp-ring 1.4s ease-out .25s forwards;
  opacity: .15;
}
.otp-success__check {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: otp-check .5s ease-out .55s forwards;
}

@keyframes otp-ring  { to { stroke-dashoffset: 0; } }
@keyframes otp-check { to { stroke-dashoffset: 0; } }

.otp-success__text {
  margin: 0;
  color: #1f9d55;
  font-weight: 800;
  font-size: 1.02rem;
}

/* ---------- پیام خطای OTP ---------- */
.otp-error {
  margin-top: -.4rem;
  margin-bottom: .6rem;
  text-align: center;
  animation: cl-shake .35s;
}

/* ---------- تایمر ---------- */
.otp-timer {
  color: var(--gray);
  font-size: .85rem;
  font-weight: 600;
  direction: ltr;
  display: inline-block;
  margin-right: .25rem;
}
.cl-login__resend button[disabled] { cursor: not-allowed; }

/* ---------- موبایل: ۶ خانه در دو ردیف ---------- */
@media (max-width: 400px) {
  .otp {
    grid-template-columns: repeat(3, 1fr);
    row-gap: .55rem;
  }
  .otp__digit { font-size: 1.5rem; }
}