/* ════════════════════════════════════════
   TII OTP — Modal Overlay + Digit Inputs
   v2.0 · Email only, triggered on submit
════════════════════════════════════════ */

/* ── Overlay backdrop ── */
#tii-otp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}

body.tii-otp-open {
  overflow: hidden;
}

/* ── Modal box ── */
#tii-otp-box {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 420px;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: tii-slide-up 0.25s ease;
}

@keyframes tii-slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Close button ── */
#tii-otp-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
#tii-otp-close:hover {
  color: #333;
  background: #f0f0f0;
}

/* ── Email icon ── */
.tii-otp-icon {
  font-size: 36px;
  margin-bottom: 10px;
  display: block;
}

/* ── Title & description ── */
#tii-otp-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
}
#tii-otp-desc {
  font-size: 14px;
  color: #666;
  margin: 0 0 24px;
  line-height: 1.5;
}
#tii-otp-desc strong {
  color: #333;
}

/* ── 6-digit boxes ── */
#tii-otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 60px;
  align-items: center;
}

.tii-otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #ddd;
  border-radius: 10px;
  color: #1a1a1a;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
}
.tii-otp-digit:focus {
  outline: none;
  border-color: #2ab391;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200,169,110,0.2);
}
.tii-otp-digit:not(:placeholder-shown) {
  border-color: #2ab391;
  background: #fffdf7;
}

/* ── Shake animation ── */
#tii-otp-inputs.tii-shake {
  animation: tii-shake 0.4s ease;
}
@keyframes tii-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

/* ── Success animation ── */
.tii-otp-success-anim {
  font-size: 52px;
  color: #22a06b;
  animation: tii-pop 0.3s ease;
}
@keyframes tii-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Message ── */
.tii-otp-msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 7px;
  margin-bottom: 14px;
  display: none;
}
.tii-otp-msg--error {
  background: #fff0f0;
  color: #c53030;
  border-left: 3px solid #e53e3e;
  display: block;
}
.tii-otp-msg--success {
  background: #e6f9f0;
  color: #1e7e50;
  border-left: 3px solid #22a06b;
  display: block;
}

/* ── Verify button ── */
#tii-otp-verify-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: #2ab391;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}
#tii-otp-verify-btn:hover:not(:disabled) {
  background: #2ab391;
  transform: translateY(-1px);
}
#tii-otp-verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Resend row ── */
#tii-otp-resend-wrap {
  font-size: 13px;
  color: #888;
}
#tii-otp-resend-btn {
  background: none;
  border: none;
  color: #2ab391;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
}
#tii-otp-resend-btn:disabled {
  color: #bbb;
  cursor: not-allowed;
  text-decoration: none;
}
#tii-otp-timer {
  color: #aaa;
  font-size: 12px;
}

/* ── Inline error above submit ── */
#tii-otp-inline-err {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 7px;
  background: #fff0f0;
  color: #c53030;
  border-left: 3px solid #e53e3e;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  #tii-otp-box {
    padding: 28px 18px 22px;
  }
  .tii-otp-digit {
    width: 40px;
    height: 48px;
    font-size: 20px;
    border-radius: 8px;
  }
  #tii-otp-inputs {
    gap: 7px;
  }
}
