/* assets/phonotp.css — polished UI */

/* ---------- Theme tokens ---------- */
:root {
  --otp-bg: #ffffff;
  --otp-fg: #101827;
  --otp-muted: #6b7280;
  --otp-primary: #3b82f6;
  --otp-primary-hover: #2563eb;
  --otp-danger: #ef4444;
  --otp-success: #16a34a;
  --otp-border: #e5e7eb;
  --otp-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  --otp-radius: 16px;
  --otp-focus: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* جلوگیری از اسکرول هنگام باز بودن مودال (اگر در JS کلاس body اضافه شد) */
body.phonotp-no-scroll { overflow: hidden; }

/* ---------- Backdrop & Modal ---------- */
.phonotp-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.45);        /* نیمه‌تاریک */
  backdrop-filter: blur(6px);                 /* شیشه‌ای لطیف */
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 99999;
}

.phonotp-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.phonotp-modal {
  width: 100%;
  max-width: 380px;
  background: var(--otp-bg);
  color: var(--otp-fg);
  border-radius: var(--otp-radius);
  box-shadow: var(--otp-shadow);
  padding: 22px 20px;
  direction: rtl;
  font-family: inherit;
  transform: translateY(12px) scale(.98);
  opacity: 0;
  transition: transform .22s cubic-bezier(.22,.61,.36,1), opacity .22s ease;
}

.phonotp-modal-backdrop.active .phonotp-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ---------- Headings ---------- */
.phonotp-modal h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 14px 0;
  letter-spacing: -.2px;
}

/* زیرتیترهای کوچک */
.phonotp-small { font-size: 12.5px; color: var(--otp-muted); }

/* ---------- Inputs ---------- */
.phonotp-input {
  width: 100%;
  background: #f9fafb;
  border: 1px solid var(--otp-border);
  color: var(--otp-fg);
  padding: 11px 12px;
  border-radius: 12px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.phonotp-input::placeholder { color: #9ca3af; }

.phonotp-input:focus {
  border-color: var(--otp-primary);
  box-shadow: var(--otp-focus);
  background: #fff;
}

/* برای ورودی کد */
#phonotp-code {
  letter-spacing: 6px;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
}

/* ---------- Buttons ---------- */
.phonotp-row { display: flex; gap: 10px; align-items: center; }

.phonotp-btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
  margin-top: 15px;
}

.phonotp-btn:active { transform: translateY(1px); }

.phonotp-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

/* اصلی (Primary) */
.phonotp-btn-primary {
  background: linear-gradient(180deg, var(--otp-primary), var(--otp-primary-hover));
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}
.phonotp-btn-primary:hover { filter: brightness(1.03); }

/* ثانویه/معمولی */
.phonotp-btn:not(.phonotp-btn-primary) {
  background: #f3f4f6;
  color: #111827;
}
.phonotp-btn:not(.phonotp-btn-primary):hover { background: #e5e7eb; }

/* دکمه باز کردن پاپ‌آپ */
.phonotp-open-btn {
  padding: 12px 5px;
  border-radius: 14px;
  border: 1px solid var(--otp-border);
  background: #ffffff;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease;
  font-size:14px !important;
}

.phonotp-open-btn-login {
  padding: 12px 4px;
  border-radius: 14px;
  border: 1px solid var(--otp-border);
  background: #ffffff;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease;
  font-size:14px !important;
}

.phonotp-open-btn:hover {
  transform: translateY(-1px);
  border-color: #d1d5db;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

/* ---------- Messages ---------- */
.phonotp-error {
  color: var(--otp-danger);
  font-size: 13px;
  margin-top: 6px;
}
.phonotp-success {
  color: var(--otp-success);
  font-size: 13px;
  margin-top: 6px;
}

/* ---------- Resend chip ---------- */
#phonotp-resend-row {
  margin-top: 6px;
}
#phonotp-resend {
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: none;
}
#phonotp-resend[disabled] {
  background: #f3f4f6;
  color: #6b7280;
}

/* تایمر داخل دکمه */
#phonotp-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* ---------- Small screens ---------- */
@media (max-width: 420px) {
  .phonotp-modal { padding: 18px 16px; border-radius: 14px; }
  .phonotp-modal h3 { font-size: 17px; }
  .phonotp-input { padding: 10px 11px; }
}


/* در حالت موبایل: فقط آیکون آدمک نمایش داده شود */
@media (max-width: 640px) {
  .phonotp-account-text {
    display: none !important;
  }
  .phonotp-open-btn,.phonotp-open-btn-login
  .phonotp-account-link {
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    justify-content: center;
  }
  .phonotp-account-icon {
    width: 24px;
    height: 24px;
    color: var(--otp-primary);
  }
}

