/* auth-gate.css — Echovestia auth gate widget.
 *
 * Deliberately minimal: every colour/font comes from the host site's CSS
 * variables (--bg, --bg2, --text, --muted, --accent, --font-*) with neutral
 * fallbacks, so the form inherits the site's theme — light or dark —
 * without any per-site styling. Host pages may still override .ea-* rules.
 */

[data-auth-gate] {
  position: relative;
  /* Height is animated by the widget on open/close; the transition only
     bites while an explicit px height is set (auto height = instant). */
  transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Only clip while animating, so a normal open state never hides focus rings. */
[data-auth-gate].ea-animating { overflow: hidden; }

.ea-hidden { display: none !important; }

/* Crossfade for the three top-level pieces that swap in/out (login form,
   status bar, revealed content) — synced with the container's own height
   transition (auth-gate.js). ea-entering starts an element at opacity 0
   right before a forced reflow, so removing the class next frame animates
   0→1; ea-leaving fades an element to 0 AND takes it out of flow
   (position: absolute) so it doesn't hold the container's height open
   while it fades — auth-gate.js removes it for real (display: none /
   [hidden]) once the fade finishes. */
.ea-panel, [data-auth-content], .ea-status, .ea-error, .ea-hint {
  transition: opacity 0.3s ease;
}
.ea-entering { opacity: 0; }
.ea-leaving {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
}
/* .ea-error/.ea-hint carry their own baseline opacity below (0.9, or 0.9 on
   the "warn" hint colour) — two classes beats their one-class rule
   regardless of source order, so the fade genuinely reaches 0 instead of
   settling at that baseline. */
.ea-error.ea-entering, .ea-error.ea-leaving,
.ea-hint.ea-entering, .ea-hint.ea-leaving { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  [data-auth-gate] { transition: none; }
  .ea-panel, [data-auth-content], .ea-status, .ea-error, .ea-hint { transition: none; }
  .ea-brand-dot { animation: none; opacity: 0.6; }
}

.ea-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

/* Decorative flourish above the fields: 3 flowers, each fading to near-
   transparent and back in turn — a slow left-to-right ripple, not a blink. */
.ea-brand {
  display: flex;
  gap: 6px;
  color: var(--muted, #999);
  padding: 12px;
}
.ea-brand-dot {
  width: 10px;
  height: 10px;
  animation: eaBrandRipple 3.6s ease-in-out infinite;
}
.ea-brand-dot svg { width: 100%; height: 100%; display: block; }
@keyframes eaBrandRipple {
  0%, 55%, 100% { opacity: 0.8; }
  27.5% { opacity: 0.12; }
}

.ea-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: none;
  margin: 0;
  padding: 0;
}

.ea-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg, #f8f9fa);
  color: var(--text, #333);
  border: none;
  padding: 10px 16px;
  font-family: var(--font-main, Arial, sans-serif);
  font-size: var(--font-base, 14px);
  transition: background 0.2s;
}

.ea-input:focus {
  outline: none;
  background: var(--bg, #f8f9fa);
  box-shadow: inset 0 -1px 0 var(--accent, #2d5280);
}

.ea-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-main, Arial, sans-serif);
  font-size: var(--font-small, 13px);
  letter-spacing: 1px;
  padding: 8px 24px;
  align-self: flex-end;
  transition: opacity 0.2s;
}

.ea-btn:not(:disabled):hover { opacity: 0.6; }
.ea-btn:disabled { opacity: 0.35; cursor: default; }

.ea-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  align-self: center;
}

.ea-link {
  color: var(--muted, #999);
  font-family: var(--font-main, Arial, sans-serif);
  font-size: var(--font-mini, 11px);
  /* Fixed line-height (not the font's natural metrics) so a link whose text
     ends in a pictograph (guest_link's scale glyph, etc.) doesn't get a taller
     line box than its sibling — without this the two footer links can sit at
     visibly different heights on mobile, where emoji-capable fonts render
     those trailing glyphs larger than the surrounding text. */
  line-height: 1.45;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.ea-link:hover { color: var(--accent, #2d5280); }

.ea-error {
  color: var(--muted, #b3554d);
  font-family: var(--font-main, Arial, sans-serif);
  font-size: var(--font-mini, 11px);
  opacity: 0.9;
  padding: 0 24px;
}

/* Live username-availability hint (signup only), shown under the field. */
.ea-hint {
  font-family: var(--font-main, Arial, sans-serif);
  font-size: var(--font-mini, 11px);
  padding: 0 24px;
  margin-top: -4px;
}
.ea-hint-muted { color: var(--muted, #999); }
.ea-hint-ok { color: var(--accent, #2d5280); }
.ea-hint-warn { color: var(--accent, #b3554d); opacity: 0.9; }

.ea-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 8px 24px;
  font-family: var(--font-main, Arial, sans-serif);
  font-size: var(--font-small, 13px);
  color: var(--text, #333);
}

.ea-status-id {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ea-status-name {
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted, #999);
}

/* The @login sits under the display name (or stands alone if no name). */
.ea-status-login {
  font-size: var(--font-mini, 11px);
  color: var(--muted, #999);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
