/* Lotly · Access Gate styles
 * ---------------------------------------------------------------
 * Full-screen overlay. Uses the site's design tokens so it feels
 * native, not a bolt-on. Contained under .lotly-gate to prevent
 * bleeding into the rest of the app.
 * --------------------------------------------------------------- */

.lotly-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--color-bg, #07090b);
  color: var(--color-text-strong, #ffffff);
  animation: lotlyGateIn 0.5s var(--ease-out, cubic-bezier(0.2, 0.7, 0.2, 1));
}

.lotly-gate.is-unlocking {
  animation: lotlyGateOut 0.7s var(--ease-out, cubic-bezier(0.2, 0.7, 0.2, 1)) forwards;
}

@keyframes lotlyGateIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lotlyGateOut {
  0%   { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.03); filter: blur(6px); pointer-events: none; }
}

/* ---- ambient background ---- */
.lotly-gate__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.lotly-gate__orbA,
.lotly-gate__orbB {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  will-change: transform;
}
.lotly-gate__orbA {
  width: 560px; height: 560px;
  background: radial-gradient(circle, #4bffb0 0%, transparent 65%);
  top: -180px; left: -120px;
  animation: orbFloatA 14s ease-in-out infinite;
}
.lotly-gate__orbB {
  width: 720px; height: 720px;
  background: radial-gradient(circle, #7bffd0 0%, transparent 70%);
  bottom: -220px; right: -160px;
  animation: orbFloatB 18s ease-in-out infinite;
}
@keyframes orbFloatA {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(40px, 20px) scale(1.08); }
}
@keyframes orbFloatB {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-30px, -40px) scale(1.05); }
}
.lotly-gate__grain {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 80%);
}

/* ---- card ---- */
.lotly-gate__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 40px 36px 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    rgba(11, 15, 20, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(75, 255, 176, 0.05) inset;
  transform: translateY(0);
  animation: cardIn 0.6s var(--ease-out, cubic-bezier(0.2, 0.7, 0.2, 1)) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- brand ---- */
.lotly-gate__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-weight: 700;
  font-size: 20px;
  color: #4bffb0;
  margin-bottom: 20px;
}

/* ---- badge ---- */
.lotly-gate__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  background: rgba(75, 255, 176, 0.1);
  border: 1px solid rgba(75, 255, 176, 0.25);
  border-radius: 999px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4bffb0;
  margin-bottom: 20px;
}
.lotly-gate__pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4bffb0;
  box-shadow: 0 0 0 0 rgba(75,255,176,0.6);
  animation: gatePulse 1.6s infinite;
}
@keyframes gatePulse {
  0%   { box-shadow: 0 0 0 0 rgba(75,255,176,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(75,255,176,0); }
  100% { box-shadow: 0 0 0 0 rgba(75,255,176,0); }
}

/* ---- typography ---- */
.lotly-gate__card h1 {
  margin: 0 0 12px 0;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #ffffff;
}
.lotly-gate__card h1 em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: #4bffb0;
  letter-spacing: -0.01em;
}
.lotly-gate__sub {
  margin: 0 0 28px 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  line-height: 1.55;
  max-width: 40ch;
}

/* ---- form ---- */
.lotly-gate__form { margin: 0 0 24px 0; }
.lotly-gate__label {
  display: block;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}
.lotly-gate__input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 4px 4px 4px 16px;
  transition: border-color 200ms ease, background 200ms ease;
}
.lotly-gate__input-wrap:focus-within {
  border-color: rgba(75, 255, 176, 0.5);
  background: rgba(75, 255, 176, 0.03);
  box-shadow: 0 0 0 4px rgba(75, 255, 176, 0.08);
}
.lotly-gate__input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 16px;
  padding: 12px 0;
  min-width: 0;
}
.lotly-gate__input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.28);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}
.lotly-gate__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4bffb0, #7bffd0);
  color: #062015;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 200ms ease, filter 150ms ease;
}
.lotly-gate__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(75, 255, 176, 0.35);
  filter: brightness(1.05);
}
.lotly-gate__submit:active { transform: translateY(0); }

/* ---- error state ---- */
.lotly-gate__error {
  margin-top: 12px;
  min-height: 20px;
  font-size: 13px;
  color: #ff8a8a;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
}
.lotly-gate.is-invalid .lotly-gate__input-wrap {
  border-color: rgba(255, 90, 90, 0.6);
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* ---- footer ---- */
.lotly-gate__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}
.lotly-gate__foot a {
  color: #4bffb0;
  text-decoration: none;
  border-bottom: 1px solid rgba(75, 255, 176, 0.3);
  transition: border-color 150ms ease;
}
.lotly-gate__foot a:hover { border-color: rgba(75, 255, 176, 0.8); }
.lotly-gate__foot-sep { color: rgba(255, 255, 255, 0.2); }

@media (max-width: 480px) {
  .lotly-gate__card { padding: 32px 24px 24px; border-radius: 20px; }
  .lotly-gate__card h1 { font-size: 26px; }
  .lotly-gate__sub { font-size: 14px; }
}

/* Reduced-motion: no orbs, no shake, no gradient */
@media (prefers-reduced-motion: reduce) {
  .lotly-gate__orbA,
  .lotly-gate__orbB { animation: none; }
  .lotly-gate,
  .lotly-gate__card { animation: none; }
  .lotly-gate.is-invalid .lotly-gate__input-wrap { animation: none; }
}
