/* === Self-hosted Fonts (GDPR compliant, no external requests) === */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* === Reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Accessibility === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--glow-1, #7c3aed);
  outline-offset: 2px;
}

/* Remove redundant focus ring from inputs that have custom focus styles */
#signup-input:focus-visible,
#signup-btn:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:root {
  --white: #ffffff;
  --off-white: #fafafa;
  --text: #111111;
  --text-light: #888888;
  --text-muted: #bbbbbb;
  --border: #e8e8e8;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --glow-1: #7c3aed;
  --glow-2: #06b6d4;
  --glow-3: #f43f5e;
  --glow-4: #f59e0b;
  --glow-5: #10b981;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--white);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Top Bar === */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: var(--white);
}

.logo {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  user-select: none;
}

.topbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* === Tagline (positioned like debug panel) === */
#tagline {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  text-align: center;
}

#tagline span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

/* === Main === */
#main {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 48px;
}

/* === Chat Container (matches product landing) === */
#chat-container {
  width: 100%;
  max-width: 560px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

/* === Chat Messages === */
#chat-messages {
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
  scrollbar-width: none;
  flex-shrink: 1;
  min-height: 0;
}

#chat-messages::-webkit-scrollbar {
  display: none;
}

#chat-messages:empty {
  display: none;
}

/* === Messages (from product landing) === */
.message {
  opacity: 0;
  transform: translateY(8px);
  animation: messageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.message-nix {
  align-self: flex-start;
  max-width: 85%;
}

.message-bubble {
  font-size: 14px;
  line-height: 1.6;
  padding: 10px 16px;
  border-radius: 18px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--off-white);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  padding-left: 4px;
}

@keyframes messageIn {
  to { opacity: 1; transform: translateY(0); }
}

/* === Typing Indicator === */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* === Signup Container === */
#signup-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === Signup Input === */
#signup-input-wrapper {
  width: 100%;
  position: relative;
  margin-top: 15px;
}

#input-glow {
  position: absolute;
  inset: -4px;
  border-radius: 28px;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: conic-gradient(
    from 0deg,
    var(--glow-1),
    var(--glow-2),
    var(--glow-3),
    var(--glow-4),
    var(--glow-5),
    var(--glow-1)
  );
  filter: blur(12px);
  z-index: -1;
}

#input-glow.active {
  opacity: 0.5;
  animation: glowSpin 4s linear infinite;
}

@keyframes glowSpin {
  to { filter: blur(12px) hue-rotate(360deg); }
}

#signup-form {
  width: 100%;
}

#signup-input-box {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4px 4px 4px 20px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
  min-height: 48px;
}

#signup-input-box.focused {
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.3), 0 8px 40px -12px rgba(124, 58, 237, 0.15);
}

#signup-input {
  flex: 1;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 0;
  letter-spacing: -0.01em;
}

#signup-input::placeholder {
  color: var(--text-muted);
}

#signup-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
  background: var(--text);
  color: var(--white);
}

#signup-btn:hover {
  transform: scale(1.05);
}

#signup-btn:active {
  transform: scale(0.95);
}

#signup-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* === Signup Message === */
#signup-msg {
  font-size: 13px;
  font-weight: 300;
  min-height: 20px;
  margin-top: 12px;
  letter-spacing: -0.01em;
  color: var(--text-light);
}

#signup-msg.success {
  color: var(--glow-5);
}

#signup-msg.error {
  color: var(--glow-3);
}

/* === Footer === */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

#footer a {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

#footer a:hover {
  color: var(--text-light);
}

#footer .dot {
  font-size: 11px;
  color: var(--text-muted);
}

/* === Mobile === */
@media (max-width: 600px) {
  #topbar {
    padding: 16px 20px;
  }

  #chat-container {
    padding: 0 16px;
  }

  #main {
    padding-top: 52px;
  }

  #tagline {
    top: 14px;
  }

  .message-bubble {
    font-size: 14px;
  }
}
