/* SecureOTP - modern polished UI (front-end) */

:root{
  --sotp-primary: #1e88e5;
  --sotp-primary2:#1565c0;
  --sotp-success:#2e7d32;
  --sotp-warn:   #f59e0b;

  --sotp-bg:     #ffffff;
  --sotp-surface:#ffffff;

  --sotp-text:   #111827;
  --sotp-muted:  #6b7280;

  --sotp-border: #e6eef7;
  --sotp-shadow: 0 18px 60px rgba(17,24,39,.10);

  --sotp-radius: 22px;
}

.secureotp-header-user{
  position: relative;
  display: inline-block;
  direction: rtl;
  vertical-align: middle;
  font-family: Vazirmatn, IRANSans, tahoma, Arial, sans-serif;
}

.secureotp-head-btn{
  appearance:none;
  border:0;
  cursor:pointer;
  border-radius: 14px;
  padding: 10px 16px;
  color:#fff;
  background: linear-gradient(135deg, var(--sotp-primary), var(--sotp-primary2));
  box-shadow: 0 10px 26px rgba(30,136,229,.25);
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.secureotp-head-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(30,136,229,.28);
  filter: saturate(1.05);
}
.secureotp-head-btn:active{ transform: translateY(0); }

.secureotp-dropdown{
  display:none;
  position:absolute;
  top: 112%;
  left: 0;
  min-width: 190px;
  background:#fff;
  border:1px solid var(--sotp-border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
  overflow:hidden;
  z-index: 99999;
}
.secureotp-header-user:hover .secureotp-dropdown{ display:block; }
.secureotp-dropdown a{
  display:block;
  padding: 12px 14px;
  font-size:13px;
  color:#374151;
  text-decoration:none;
  border-bottom:1px solid rgba(230,238,247,.8);
  transition: background .15s ease;
  text-align:right;
}
.secureotp-dropdown a:hover{ background:#f8fafc; }
.secureotp-dropdown a.secureotp-logout{
  border-bottom:0;
  color:#b42318;
}

/* Modal overlay */
.secureotp-modal-wrap{
  display:none;
  position: fixed;
  inset:0;
  z-index: 2147483647;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  justify-content:center;
  align-items:center;
  direction: rtl;
  padding: 18px;
}
.secureotp-modal-wrap.is-open{ display:flex; }

.secureotp-m-content{
  width: 100%;
  max-width: 390px;
  background: var(--sotp-surface);
  border: 1px solid var(--sotp-border);
  border-radius: var(--sotp-radius);
  box-shadow: var(--sotp-shadow);
  padding: 28px;
  position:relative;
  font-family: Vazirmatn, IRANSans, tahoma, Arial, sans-serif;
  animation: sotpPop .14s ease-out;
}
@keyframes sotpPop{
  from{ transform: translateY(8px); opacity:.0; }
  to  { transform: translateY(0);   opacity:1; }
}

.secureotp-close{
  position:absolute;
  left: 14px;
  top: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(230,238,247,.9);
  background:#fff;
  cursor:pointer;
  color:#9ca3af;
  font-size: 26px;
  line-height: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.secureotp-close:hover{
  background:#f8fafc;
  color:#6b7280;
  transform: translateY(-1px);
}

/* Static form box */
.secureotp-box{
  background: var(--sotp-bg);
  border: 1px solid var(--sotp-border);
  border-radius: var(--sotp-radius);
  box-shadow: var(--sotp-shadow);
  padding: 30px;
  direction: rtl;
  font-family: Vazirmatn, IRANSans, tahoma, Arial, sans-serif;
}

/* Headings / text */
.secureotp-title{
  text-align:center;
  color: var(--sotp-text);
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.secureotp-desc{
  text-align:center;
  color: var(--sotp-muted);
  margin: 0 0 18px;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.9;
}
.secureotp-sub{
  text-align:center;
  color: var(--sotp-muted);
  margin: -4px 0 14px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.8;
}

/* Inputs */
.secureotp-input{
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(230,238,247,.95);
  background: #fff;
  padding: 14px 14px;
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.secureotp-input::placeholder{ color:#9aa3b2; }
.secureotp-input:focus{
  border-color: rgba(30,136,229,.65);
  box-shadow: 0 0 0 4px rgba(30,136,229,.12);
  transform: translateY(-1px);
}

/* Buttons */
.secureotp-btn{
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 14px 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, opacity .2s ease;
}
.secureotp-btn:disabled{
  opacity: .65;
  cursor: not-allowed;
  transform:none !important;
  box-shadow:none !important;
}

.secureotp-btn-primary{
  color:#fff;
  background: linear-gradient(135deg, var(--sotp-primary), var(--sotp-primary2));
  box-shadow: 0 12px 28px rgba(30,136,229,.22);
}
.secureotp-btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(30,136,229,.26);
  filter: saturate(1.05);
}

.secureotp-btn-success{
  color:#fff;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  box-shadow: 0 12px 28px rgba(46,125,50,.18);
  margin-top: 6px;
}
.secureotp-btn-success:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(46,125,50,.22);
}

.secureotp-btn-warn{
  color:#111827;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 12px 28px rgba(245,158,11,.18);
  margin-top: 12px;
}
.secureotp-btn-warn:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(245,158,11,.22);
}

.secureotp-btn-ghost{
  background: #fff;
  border: 1px solid rgba(230,238,247,.95);
  color: #374151;
  margin-top: 10px;
}
.secureotp-btn-ghost:hover{
  background: #f8fafc;
  transform: translateY(-1px);
}

/* Back link */
.secureotp-back{
  appearance:none;
  border:0;
  background: transparent;
  color: #0b5cab;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin: 0 0 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: .9;
}
.secureotp-back:hover{ opacity: 1; }

/* Messages */
.secureotp-msg{
  display:none;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.9;
  text-align: right;
  box-sizing: border-box;
}
.secureotp-msg::before{
  display:inline-block;
  margin-left: 8px;
  font-weight: 900;
}
.secureotp-msg.is-error{
  background: #fff5f5;
  border: 1px solid #ffd5d5;
  color: #b42318;
}
.secureotp-msg.is-error::before{ content: "⛔"; }
.secureotp-msg.is-info{
  background: #f0f7ff;
  border: 1px solid #cfe6ff;
  color: #0b5cab;
}
.secureotp-msg.is-info::before{ content: "ℹ️"; }
.secureotp-msg.is-success{
  background: #f0fff4;
  border: 1px solid #b7ebc0;
  color: #1e7e34;
}
.secureotp-msg.is-success::before{ content: "✅"; }

/* Timer row */
.secureotp-timer-wrap{
  margin-top: 14px;
  text-align: center;
  color: var(--sotp-muted);
  font-size: 13.5px;
  line-height: 1.8;
}
.secureotp-timer-text{
  display:inline-block;
  padding: 8px 12px;
  border: 1px dashed rgba(230,238,247,.95);
  border-radius: 14px;
  background:#fbfdff;
}
.secureotp-timer-num{
  display:inline-block;
  direction:ltr;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

/* Step 3 actions */
.secureotp-actions{ margin-top: 8px; }

/* Small screens */
@media (max-width: 420px){
  .secureotp-box{ padding: 22px; }
  .secureotp-m-content{ padding: 22px; }
  .secureotp-title{ font-size: 17px; }
}