@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&display=swap');

/* ── Logic Lovers signup modal ─────────────────────────────────────
   Soft-gate modal that auto-injects on every page that includes
   signup-modal.js. Matches the dark/violet aesthetic of the site. */

:root {
  --slm-surface:    #110f1c;
  --slm-border:     rgba(196, 161, 255, 0.22);
  --slm-border-h:   rgba(196, 161, 255, 0.45);
  --slm-text:       #f0ecf7;
  --slm-text-mid:   rgba(230, 220, 245, 0.72);
  --slm-text-dim:   rgba(200, 190, 220, 0.45);
  --slm-accent:     #c4a1ff;
  --slm-accent-bg:  rgba(196, 161, 255, 0.12);
}

/* ── Overlay (dim + blur backdrop) ── */
.slm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 5, 13, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.slm-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal card ── */
.slm-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--slm-surface);
  border-radius: 18px;
  padding: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 36px);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--slm-text);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px var(--slm-border),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

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

/* ── Close X ── */
.slm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--slm-text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.slm-close:hover {
  color: var(--slm-text);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Headline + body ── */
.slm-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-align: center;
  background: linear-gradient(135deg, #fde68a, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.slm-body {
  font-size: clamp(0.9rem, 1.6vw, 1rem);
  line-height: 1.5;
  color: var(--slm-text-mid);
  margin-bottom: 22px;
  text-align: center;
}

/* ── Form ── */
.slm-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.slm-input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--slm-text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.slm-input::placeholder {
  color: var(--slm-text-dim);
}

.slm-input:focus {
  outline: none;
  border-color: var(--slm-border-h);
  background: rgba(255, 255, 255, 0.06);
}

.slm-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Honeypot (bot trap; invisible to humans, present in DOM for bots) ── */
.slm-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ── Submit button ── */
.slm-submit {
  width: 100%;
  padding: 13px 20px;
  margin-top: 4px;
  background: linear-gradient(135deg, #c4a1ff, #a785ff);
  color: #1a0f33;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 16px rgba(196, 161, 255, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.slm-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(196, 161, 255, 0.4);
}

.slm-submit:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.slm-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Dismiss link ── */
.slm-dismiss {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--slm-text-dim);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.slm-dismiss:hover {
  color: var(--slm-text-mid);
  text-decoration: underline;
}

/* ── Fineprint ── */
.slm-fineprint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--slm-text-dim);
  text-align: center;
}

.slm-fineprint a {
  color: var(--slm-text-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.slm-fineprint a:hover {
  color: var(--slm-accent);
}

/* ── Error message ── */
.slm-error {
  display: none;
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(255, 100, 120, 0.1);
  border: 1px solid rgba(255, 100, 120, 0.3);
  border-radius: 8px;
  color: #ff8094;
  font-size: 0.85rem;
}

.slm-error.is-visible {
  display: block;
}

/* ── Success state ── */
.slm-success {
  display: none;
  text-align: center;
  padding: 18px 0 10px;
}

.slm-success.is-visible {
  display: block;
}

.slm-success-icon {
  font-size: 3.2rem;
  margin-bottom: 14px;
  animation: slm-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 18px rgba(245, 185, 66, 0.5));
}

.slm-success-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(1.4rem, 3.4vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--slm-text);
  line-height: 1.3;
  animation: slm-fade-in 0.5s ease 0.15s both;
}

.slm-success-brand {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.15em;
  background: linear-gradient(135deg, #e6d3ff, #f5b942, #c4a1ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes slm-pop {
  0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes slm-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Persistent header CTA button ── */
.slm-cta-btn {
  position: fixed;
  top: clamp(14px, 2.2vw, 22px);
  right: calc(clamp(14px, 2.2vw, 22px) + clamp(36px, 4vw, 44px) + 10px);
  z-index: 30;
  padding: 8px 16px;
  background: rgba(30, 24, 46, 0.55);
  border: 1px solid var(--slm-border);
  border-radius: 999px;
  color: var(--slm-text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.slm-cta-btn:hover {
  color: var(--slm-accent);
  border-color: var(--slm-border-h);
  background: rgba(40, 32, 62, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(196, 161, 255, 0.18);
}

.slm-cta-btn:active {
  transform: translateY(0) scale(0.97);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .slm-modal {
    padding: 24px 20px;
  }
  .slm-cta-btn {
    font-size: 0.78rem;
    padding: 7px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slm-overlay,
  .slm-modal,
  .slm-cta-btn,
  .slm-submit {
    transition: none;
  }
  .slm-success-icon {
    animation: none;
  }
}
