/* ==========================================================================
   TRADOPIAX — EMAIL VERIFICATION SYSTEM
   Styles for Identity Hub Email Badge, Action Button, and OTP Verification Modal
   ========================================================================== */

/* ── Inline Email Verification Component inside Identity Hub ── */
.ih-email-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.ih-email-verify-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Status Badge */
.ih-email-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

.ih-email-badge.unverified {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.ih-email-badge.verified {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.ih-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ih-email-badge.unverified .ih-badge-dot {
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
  animation: ihDotPulse 2s infinite ease-in-out;
}

.ih-email-badge.verified svg {
  stroke: #34d399;
}

@keyframes ihDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Verify Email Button */
.ih-verify-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(99, 102, 241, 0.25) 100%);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}

.ih-verify-email-btn:hover {
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.ih-verify-email-btn:active {
  transform: translateY(0);
}

/* ── Email Verification Modal ── */
.ev-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ev-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.ev-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #0e1726 0%, #070c14 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 40px rgba(56, 189, 248, 0.1);
  overflow: hidden;
  transform: translateY(18px) scale(0.96);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.ev-modal-overlay.show .ev-modal-card {
  transform: translateY(0) scale(1);
}

/* Top Glow */
.ev-modal-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, transparent);
}

/* Close Button */
.ev-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.ev-modal-close:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}

/* Header */
.ev-modal-header {
  padding: 26px 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ev-modal-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15);
}

.ev-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ev-modal-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.3px;
}

.ev-modal-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #94a3b8;
  max-width: 320px;
}

.ev-target-email {
  color: #38bdf8;
  font-weight: 700;
  word-break: break-all;
}

/* Body */
.ev-modal-body {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Info Box */
.ev-info-notice {
  background: rgba(56, 189, 248, 0.05);
  border: 1px dashed rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

.ev-info-notice-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* Code Input Box */
.ev-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.ev-code-input {
  width: 100%;
  max-width: 300px;
  height: 52px;
  background: rgba(2, 6, 14, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.ev-code-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.4);
  background: rgba(2, 6, 14, 0.9);
}

.ev-code-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
  animation: evShake 0.4s ease;
}

@keyframes evShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.ev-code-hint {
  font-size: 11px;
  color: #64748b;
}

/* Action Buttons */
.ev-verify-btn {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
}

.ev-verify-btn:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.45);
  filter: brightness(1.1);
}

.ev-verify-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Resend Row */
.ev-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.ev-resend-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.ev-resend-btn:hover:not(:disabled) {
  color: #7dd3fc;
  text-decoration: underline;
}

.ev-resend-btn:disabled {
  color: #64748b;
  cursor: not-allowed;
  text-decoration: none;
}

/* Success View */
.ev-success-view {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 8px 8px;
  animation: evFadeIn 0.4s ease;
}

.ev-success-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.14);
  border: 2px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
  animation: evPop 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes evPop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes evFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Spinner */
.ev-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: evSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes evSpin {
  to { transform: rotate(360deg); }
}

/* Responsive adjustment */
@media (max-width: 480px) {
  .ev-modal-card {
    max-width: 94vw;
    border-radius: 18px;
  }
  .ev-modal-header {
    padding: 22px 18px 12px;
  }
  .ev-modal-body {
    padding: 0 18px 20px;
  }
  .ev-code-input {
    letter-spacing: 5px;
    font-size: 20px;
    height: 48px;
  }
}
