/* EcomSpy — reusable inline auth modal (no redirect to /login) */

.eam-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 10, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
}

.eam-overlay.eam-open {
  display: flex;
}

.eam-card {
  width: 100%;
  max-width: 440px;
  background: #111827;
  border: 1px solid #1E293B;
  border-radius: 22px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: eamIn 0.24s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes eamIn {
  from { transform: scale(0.9) translateY(18px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* Header */
.eam-header {
  position: relative;
  padding: 30px 28px 24px;
  text-align: center;
  background: linear-gradient(145deg, #050a14 0%, #091a12 45%, #060c10 100%);
  border-bottom: 1px solid #1E293B;
  overflow: hidden;
}

.eam-header::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.eam-header::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 204, 110, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.eam-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.eam-close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.eam-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #00ff88 0%, #10b981 100%);
  box-shadow: 0 10px 28px rgba(0, 255, 136, 0.35);
  position: relative;
}

.eam-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.eam-subtitle {
  margin: 0;
  color: rgba(203, 213, 225, 0.7);
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 320px;
  margin-inline: auto;
}

/* Body */
.eam-body {
  padding: 24px 28px 28px;
  background: #111827;
}

/* Perks */
.eam-perks {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: rgba(255,255,255,.04);
  border: 1px solid #1E293B;
  border-radius: 14px;
  overflow: hidden;
}

.eam-perk {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
}

.eam-perk + .eam-perk {
  border-left: 1px solid #1E293B;
}

.eam-perk-val {
  font-size: 11px;
  font-weight: 800;
  color: #00FF88;
  margin-bottom: 2px;
}

.eam-perk-lbl {
  font-size: 10px;
  color: rgba(241,245,249,.4);
  font-weight: 500;
}

/* Tabs */
.eam-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid #1E293B;
  border-radius: 12px;
}

.eam-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(241,245,249,.45);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.eam-tab.eam-active {
  background: #1E293B;
  color: #F1F5F9;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* Error */
.eam-error {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(248,113,113,.08);
  border: 1.5px solid rgba(248,113,113,.25);
  color: #F87171;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.eam-error.eam-visible {
  display: flex;
}

.eam-error svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Panels */
.eam-panel {
  display: none;
}

.eam-panel.eam-active {
  display: block;
}

/* Fields */
.eam-field {
  margin-bottom: 14px;
}

.eam-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #CBD5E1;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.eam-input-wrap {
  position: relative;
}

.eam-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #475569;
  pointer-events: none;
  display: flex;
}

.eam-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #1E293B;
  border-radius: 12px;
  background: #0D1520;
  color: #F1F5F9;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.eam-input::placeholder {
  color: #475569;
}

.eam-input:focus {
  outline: none;
  border-color: rgba(0,255,136,.5);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.08);
  background: #0D1520;
}

.eam-input:-webkit-autofill,
.eam-input:-webkit-autofill:hover,
.eam-input:-webkit-autofill:focus,
.eam-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0D1520 inset !important;
  box-shadow: 0 0 0 1000px #0D1520 inset !important;
  -webkit-text-fill-color: #F1F5F9 !important;
  caret-color: #F1F5F9;
  border-color: #1E293B !important;
}

.eam-input.eam-no-icon {
  padding-left: 14px;
}

.eam-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  padding: 4px;
  cursor: pointer;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s;
}

.eam-pw-toggle:hover {
  color: #94a3b8;
}

/* Submit */
.eam-submit {
  width: 100%;
  margin-top: 4px;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: #00FF88;
  color: #050a14;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.eam-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 255, 136, 0.42);
}

.eam-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.eam-submit svg {
  flex-shrink: 0;
}

/* Footer switch */
.eam-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(241,245,249,.4);
}

.eam-switch-btn {
  border: none;
  background: none;
  padding: 0;
  color: #00FF88;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.eam-switch-btn:hover {
  color: #4ADE80;
  text-decoration: underline;
}

.eam-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: rgba(241,245,249,.25);
  line-height: 1.5;
}

/* Forgot password */
.eam-forgot-desc {
  font-size: 13px;
  color: rgba(241,245,249,.5);
  line-height: 1.55;
  margin-bottom: 18px;
}

.eam-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 0;
  color: #00FF88;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.eam-back-btn:hover { color: #4ADE80; text-decoration: underline; }

.eam-forgot-success {
  text-align: center;
  padding: 8px 0 12px;
}

.eam-forgot-success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.eam-forgot-success-title {
  font-size: 17px;
  font-weight: 800;
  color: #F1F5F9;
  margin-bottom: 10px;
}

.eam-forgot-success-msg {
  font-size: 13px;
  color: rgba(241,245,249,.45);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Resend button */
.eam-resend-btn {
  border: none;
  background: none;
  padding: 0;
  color: #00FF88;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.eam-resend-btn:hover { color: #4ADE80; text-decoration: underline; }

.eam-resend-btn:disabled {
  color: rgba(241,245,249,.3);
  cursor: default;
  text-decoration: none;
}

/* OTP input */
.eam-otp-input {
  letter-spacing: 0.25em;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding-left: 14px;
}

/* Password rules list */
.eam-pw-rules {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.eam-pw-rule {
  font-size: 11px;
  color: rgba(241,245,249,.35);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.eam-pw-rule::before {
  content: '○';
  position: absolute;
  left: 0;
  font-size: 10px;
}

.eam-pw-rule.eam-pw-rule-ok {
  color: #00FF88;
}

.eam-pw-rule.eam-pw-rule-ok::before {
  content: '✓';
  font-size: 10px;
}

.eam-pw-rule.eam-pw-rule-fail {
  color: #F87171;
}

.eam-pw-rule.eam-pw-rule-fail::before {
  content: '✗';
  font-size: 10px;
}

/* Divider dot */

.eam-switch .eam-dot {
  color: rgba(241,245,249,.2);
  margin: 0 2px;
}

@media (max-width: 480px) {
  .eam-header { padding: 26px 20px 20px; }
  .eam-body { padding: 20px; }
  .eam-title { font-size: 19px; }
  .eam-perk-val { font-size: 10px; }
}
