/* پاپ‌آپ OTP */

.otp-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  place-items:center;
  padding:18px;
  background: rgba(7,17,31,0.62);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  animation: otpOverlayIn .35s ease;
}
.otp-overlay.is-open{
  display:grid;
}
@keyframes otpOverlayIn{
  from{ opacity:0; }
  to{ opacity:1; }
}
@keyframes otpCardIn{
  from{ opacity:0; transform: translateY(18px) scale(.96); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}

.otp-card{
  width:min(420px, 100%);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border:1px solid rgba(255,255,255,0.55);
  border-radius:28px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.35) inset;
  padding:28px;
  animation: otpCardIn .45s cubic-bezier(.16,1,.3,1);
  position:relative;
  overflow:hidden;
}
body.dark .otp-card{
  background: rgba(16,28,46,0.88);
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
}

.otp-card:before{
  content:'';
  position:absolute;
  top:-40%;
  right:-30%;
  width:70%;
  height:70%;
  background: radial-gradient(circle, rgba(14,165,233,0.18), transparent 60%);
  pointer-events:none;
}

.otp-card-head{
  text-align:center;
  position:relative;
  z-index:1;
}
.otp-logo{
  width:64px;
  height:64px;
  border-radius:18px;
  margin:0 auto 14px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  box-shadow: 0 0.5rem 1.2rem rgba(14,165,233,.28);
  overflow:hidden;
}
.otp-logo img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:18px;
}
.otp-title{
  font-size:1.25rem;
  font-weight:1000;
  color:var(--txt, #0f172a);
  margin:0;
  letter-spacing:-.02rem;
}
body.dark .otp-title{ color:#edf5ff; }
.otp-subtitle{
  margin:8px 0 0;
  font-size:.86rem;
  color:var(--mut, #64748b);
  line-height:1.8;
}
.otp-phone-row{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
  padding:6px 12px;
  background: rgba(14,165,233,0.10);
  border:1px solid rgba(14,165,233,0.18);
  border-radius:999px;
  font-size:.84rem;
  font-weight:800;
  color:#0284c7;
  direction:ltr;
}
body.dark .otp-phone-row{
  background: rgba(14,165,233,0.14);
  color:#7dd3fc;
}
.otp-phone-row button{
  background:none;
  border:none;
  color:#0ea5e9;
  font-family:inherit;
  font-weight:900;
  font-size:.78rem;
  cursor:pointer;
  text-decoration:underline;
  padding:0 4px;
}

.otp-inputs{
  display:grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap:8px;
  margin:22px 0 16px;
  direction:ltr;
  position:relative;
  z-index:1;
}
.otp-input{
  width:100%;
  aspect-ratio: 1 / 1.15;
  min-height:54px;
  border:1.5px solid var(--line, #e2e8f0);
  border-radius:14px;
  background: rgba(255,255,255,0.9);
  text-align:center;
  font-size:1.35rem;
  font-weight:1000;
  font-family:'Estedad', monospace;
  color:var(--txt, #0f172a);
  outline:none;
  transition:.18s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}
body.dark .otp-input{
  background: #0d1728;
  border-color:#2b3b52;
  color:#edf5ff;
}
.otp-input:focus{
  border-color:#0ea5e9;
  box-shadow: 0 0 0 .22rem rgba(14,165,233,.18);
  transform: translateY(-1px);
}
.otp-input.is-filled{
  border-color:#10b981;
  background: rgba(16,185,129,0.08);
}
.otp-input.is-error{
  border-color:#ef4444;
  background: rgba(239,68,68,0.08);
  animation: otpShake .35s ease;
}
@keyframes otpShake{
  0%,100%{ transform: translateX(0); }
  20%,60%{ transform: translateX(-4px); }
  40%,80%{ transform: translateX(4px); }
}

.otp-timer-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:16px 0 14px;
  padding:10px 12px;
  background: var(--panel2, #f8fafc);
  border:1px solid var(--line, #e2e8f0);
  border-radius:14px;
  position:relative;
  overflow:hidden;
  z-index:1;
}
body.dark .otp-timer-wrap{
  background: rgba(255,255,255,0.04);
}

.otp-timer-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  flex:1;
}

.otp-circle{
  width:36px;
  height:36px;
  min-width:36px;
  position:relative;
  display:grid;
  place-items:center;
}
.otp-circle svg{
  width:36px;
  height:36px;
  transform: rotate(-90deg);
}
.otp-circle-bg{
  fill:none;
  stroke: rgba(148,163,184,0.18);
  stroke-width:3;
}
.otp-circle-fg{
  fill:none;
  stroke: #0ea5e9;
  stroke-width:3;
  stroke-linecap:round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.otp-circle-text{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-size:.72rem;
  font-weight:900;
  color:var(--txt, #0f172a);
  font-family:'Estedad', monospace;
  direction:ltr;
}

.otp-timer-info{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
  flex:1;
}
.otp-timer-info b{
  font-size:.82rem;
  font-weight:800;
  color:var(--txt, #0f172a);
  line-height:1.4;
}
.otp-timer-info small{
  font-size:.72rem;
  color:var(--mut, #64748b);
  line-height:1.5;
}

.otp-timer-bar{
  position:absolute;
  bottom:0;
  right:0;
  left:0;
  height:3px;
  background: rgba(148,163,184,0.18);
  overflow:hidden;
}
.otp-timer-bar-fill{
  height:100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  width:100%;
  transition: width 1s linear;
  border-radius:999px;
}

.otp-resend{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top:14px;
  font-size:.84rem;
  color:var(--mut, #64748b);
}
.otp-resend button{
  background:none;
  border:none;
  color:#0ea5e9;
  font-family:inherit;
  font-weight:900;
  font-size:.84rem;
  cursor:pointer;
  text-decoration:underline;
  padding:2px 6px;
  border-radius:6px;
  transition:.18s;
}
.otp-resend button:disabled{
  color:var(--mut, #94a3b8);
  cursor:not-allowed;
  text-decoration:none;
  opacity:.6;
}
.otp-resend button:not(:disabled):hover{
  background: rgba(14,165,233,0.10);
}

.otp-actions{
  display:grid;
  gap:10px;
  margin-top:18px;
  position:relative;
  z-index:1;
}
.otp-btn{
  width:100%;
  min-height:52px;
  border:none;
  border-radius:16px;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color:#001018;
  font-family:inherit;
  font-weight:900;
  font-size:1rem;
  cursor:pointer;
  box-shadow: 0 .6rem 1.4rem rgba(14,165,233,.24);
  transition:.22s ease;
}
.otp-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 .8rem 1.8rem rgba(14,165,233,.32);
}
.otp-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}
.otp-btn-ghost{
  width:100%;
  min-height:48px;
  border:1.5px solid var(--line, #e2e8f0);
  border-radius:14px;
  background: var(--panel, #fff);
  color:var(--mut, #64748b);
  font-family:inherit;
  font-weight:800;
  cursor:pointer;
  transition:.18s;
}
.otp-btn-ghost:hover{
  border-color:#cbd5e1;
  color:var(--txt, #0f172a);
}

.otp-success{
  display:none;
  text-align:center;
  padding:18px 0 6px;
}
.otp-success.is-show{
  display:grid;
  gap:12px;
  animation: otpCardIn .4s ease;
}
.otp-success-icon{
  width:64px;
  height:64px;
  border-radius:50%;
  background: linear-gradient(135deg, #10b981, #34d399);
  color:white;
  display:grid;
  place-items:center;
  font-size:1.8rem;
  margin:0 auto;
  box-shadow: 0 0.6rem 1.4rem rgba(16,185,129,.28);
  animation: otpSuccessPop .6s cubic-bezier(.16,1,.3,1);
}
@keyframes otpSuccessPop{
  0%{ transform: scale(0.5); opacity:0; }
  60%{ transform: scale(1.15); }
  100%{ transform: scale(1); opacity:1; }
}
.otp-success b{
  font-size:1.05rem;
  font-weight:900;
  color:var(--txt, #0f172a);
}
.otp-success small{
  font-size:.84rem;
  color:var(--mut, #64748b);
  line-height:1.7;
}

.otp-close{
  position:absolute;
  top:12px;
  left:12px;
  z-index:2;
  width:32px;
  height:32px;
  border-radius:50%;
  border:1px solid var(--line, #e2e8f0);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(6px);
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size:1rem;
  color:var(--mut, #64748b);
  transition:.18s;
}
.otp-close:hover{
  background:#fff;
  color:#0f172a;
  transform: rotate(90deg);
}
body.dark .otp-close{
  background: rgba(15,23,42,0.6);
  border-color: rgba(255,255,255,0.12);
  color:#94a3b8;
}

/* موبایل - فول اسکرین */
@media (max-width: 640px){
  .otp-overlay{
    padding:0;
    align-items:stretch;
    background: rgba(7,17,31,0.78);
  }
  .otp-card{
    width:100%;
    max-width:100%;
    min-height:100dvh;
    border-radius:0;
    padding:22px 18px 24px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    box-shadow:none;
    border:none;
    background: rgba(255,255,255,0.96);
  }
  body.dark .otp-card{
    background: rgba(7,17,31,0.96);
  }
  .otp-card:before{
    display:none;
  }
  .otp-inputs{
    gap:6px;
  }
  .otp-input{
    min-height:52px;
    font-size:1.2rem;
    border-radius:12px;
  }
  .otp-close{
    top:16px;
    left:16px;
  }
}

/* AutoFill هایلایت */
.otp-input:-webkit-autofill,
.otp-input:autofill{
  border-color:#10b981 !important;
  box-shadow: 0 0 0 1000px rgba(16,185,129,0.08) inset !important;
}
