/**
 * Athena Lead CRM — SMS OTP verification modal styles.
 * Load alongside otp.js on the landing page hosting the lead form.
 */

.alc-otp-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.alc-otp-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

body.alc-otp-lock-scroll {
  overflow: hidden;
}

.alc-otp-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  padding: 32px 28px 28px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transform: scale(0.94) translateY(12px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.alc-otp-overlay.is-open .alc-otp-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.alc-otp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  color: #475569;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.alc-otp-close:hover {
  background: #e2e8f0;
}

.alc-otp-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alc-otp-icon svg {
  width: 26px;
  height: 26px;
}

.alc-otp-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.alc-otp-subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.alc-otp-subtitle strong {
  color: #0f172a;
  font-weight: 600;
}

.alc-otp-digits {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.alc-otp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -moz-appearance: textfield;
}

.alc-otp-digit:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.alc-otp-digit:disabled {
  background: #f8fafc;
  color: #94a3b8;
}

.alc-otp-error {
  min-height: 20px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.alc-otp-error.is-visible {
  opacity: 1;
}

.alc-otp-verify-btn {
  position: relative;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.alc-otp-verify-btn:hover:not(:disabled) {
  background: #4338ca;
}

.alc-otp-verify-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.alc-otp-verify-btn:disabled {
  opacity: 0.85;
  cursor: default;
}

.alc-otp-btn-label {
  display: inline-block;
}

.alc-otp-spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  vertical-align: middle;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: alc-otp-spin 0.7s linear infinite;
}

.alc-otp-verify-btn.is-loading .alc-otp-btn-label {
  opacity: 0.6;
}

.alc-otp-verify-btn.is-loading .alc-otp-spinner {
  display: inline-block;
}

@keyframes alc-otp-spin {
  to { transform: rotate(360deg); }
}

.alc-otp-expiry {
  margin: 14px 0 0;
  font-size: 12px;
  color: #94a3b8;
  min-height: 16px;
}

.alc-otp-resend-row {
  margin: 8px 0 0;
  font-size: 13px;
}

.alc-otp-resend-btn {
  border: none;
  background: none;
  color: #4f46e5;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

.alc-otp-resend-btn:disabled {
  color: #94a3b8;
  cursor: default;
}

.alc-otp-cooldown {
  color: #94a3b8;
  margin-left: 6px;
}

@media (max-width: 420px) {
  .alc-otp-modal {
    padding: 26px 18px 22px;
    border-radius: 16px;
  }

  .alc-otp-digit {
    width: 38px;
    height: 46px;
    font-size: 19px;
  }

  .alc-otp-digits {
    gap: 7px;
  }
}

@media (prefers-color-scheme: dark) {
  .alc-otp-modal {
    background: #1e293b;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }

  .alc-otp-title {
    color: #f1f5f9;
  }

  .alc-otp-subtitle {
    color: #94a3b8;
  }

  .alc-otp-subtitle strong {
    color: #f1f5f9;
  }

  .alc-otp-close {
    background: #334155;
    color: #cbd5e1;
  }

  .alc-otp-close:hover {
    background: #475569;
  }

  .alc-otp-icon {
    background: rgba(79, 70, 229, 0.2);
    color: #a5b4fc;
  }

  .alc-otp-digit {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
  }

  .alc-otp-digit:disabled {
    background: #1e293b;
    color: #64748b;
  }

  .alc-otp-expiry {
    color: #64748b;
  }

  .alc-otp-cooldown {
    color: #64748b;
  }
}
