/* ─────────────────────────────────────────────────────────────
   Early Access modal — reuses Wivvy design tokens from styles.css
   (--ink, --accent, --surface, --line, --r-md, --shadow-lg, --ease)
   ───────────────────────────────────────────────────────────── */

.ea-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.ea-overlay.ea-open {
  opacity: 1;
  pointer-events: auto;
}

.ea-modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface, #fff);
  color: var(--ink, #0F172A);
  border-radius: var(--r-lg, 24px);
  box-shadow: var(--shadow-lg, 0 32px 60px -20px rgba(15, 23, 42, 0.25));
  padding: 32px 28px 28px;
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition:
    transform .32s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    opacity .24s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
  font-family: var(--font, "Inter", -apple-system, BlinkMacSystemFont, sans-serif);
}
.ea-overlay.ea-open .ea-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ea-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #64748B);
  transition: background .2s, color .2s;
}
.ea-close:hover {
  background: var(--surface-2, #f8fafc);
  color: var(--ink, #0F172A);
}
.ea-close svg { width: 18px; height: 18px; }

.ea-header { margin-bottom: 20px; padding-right: 32px; }
.ea-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #EAB308);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.ea-eyebrow .ea-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent, #EAB308);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.18);
}
.ea-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink, #0F172A);
}
.ea-subtitle {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted, #64748B);
  margin: 0;
}

.ea-form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }

.ea-field { display: flex; flex-direction: column; gap: 6px; }
.ea-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2, #1f2a44);
}
.ea-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #E5E7EB);
  border-radius: var(--r-sm, 10px);
  color: var(--ink, #0F172A);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
  appearance: none;
}
.ea-input::placeholder { color: var(--muted-2, #94a3b8); }
.ea-input:focus {
  border-color: var(--accent, #EAB308);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.18);
}
.ea-input.ea-invalid {
  border-color: #e11d48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}
.ea-field-error {
  font-size: 12.5px;
  color: #e11d48;
  min-height: 16px;
}

.ea-submit {
  margin-top: 6px;
  width: 100%;
  background: var(--ink, #0F172A);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
              box-shadow .2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
              opacity .2s;
}
.ea-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 8px 24px -8px rgba(15, 23, 42, 0.16));
}
.ea-submit:disabled { opacity: 0.7; cursor: default; }

.ea-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ea-spin .7s linear infinite;
  display: none;
}
.ea-submit.ea-loading .ea-spinner { display: inline-block; }
.ea-submit.ea-loading .ea-submit-label { opacity: 0.85; }
@keyframes ea-spin { to { transform: rotate(360deg); } }

.ea-form-error {
  font-size: 13px;
  color: #e11d48;
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: var(--r-sm, 10px);
  padding: 10px 12px;
  margin-top: 4px;
  display: none;
}
.ea-form-error.ea-show { display: block; }

.ea-foot {
  font-size: 12px;
  color: var(--muted-2, #94a3b8);
  text-align: center;
  margin-top: 14px;
}

/* Success state */
.ea-success {
  display: none;
  text-align: center;
  padding: 8px 4px 4px;
}
.ea-modal.ea-state-success .ea-form,
.ea-modal.ea-state-success .ea-header,
.ea-modal.ea-state-success .ea-foot { display: none; }
.ea-modal.ea-state-success .ea-success { display: block; }

.ea-check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-soft, rgba(234, 179, 8, 0.12));
  color: var(--accent, #EAB308);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.ea-check svg { width: 28px; height: 28px; }
.ea-success-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink, #0F172A);
}
.ea-success-msg {
  font-size: 14.5px;
  color: var(--muted, #64748B);
  margin: 0;
}

/* Already-signed-up state (shown when localStorage flag set) */
.ea-modal.ea-state-already .ea-form,
.ea-modal.ea-state-already .ea-foot { display: none; }
.ea-modal.ea-state-already .ea-already { display: block; }
.ea-already {
  display: none;
  text-align: center;
  padding: 8px 4px 4px;
}
.ea-already-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink, #0F172A);
}
.ea-already-msg {
  font-size: 14.5px;
  color: var(--muted, #64748B);
  margin: 0 0 18px;
}
.ea-already-close {
  background: var(--ink, #0F172A);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: 999px;
}

/* Mobile: bottom sheet */
@media (max-width: 640px) {
  .ea-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .ea-modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 28px 22px calc(28px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
  }
  .ea-overlay.ea-open .ea-modal { transform: translateY(0); }
  .ea-title { font-size: 22px; }
}

/* Lock body scroll when open */
body.ea-locked { overflow: hidden; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ea-overlay, .ea-modal { transition: none; }
  .ea-spinner { animation: none; }
}
