/* ===== VerbalSage — base ===== */
:root {
  --bg: #000;
  --ink: #fff;
  --wm-size: 75%;
  --wm-opacity: .07;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(circle at top, #3b1d63 0%, #050008 55%, #000 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}


/* transcript (flat text; no bubbles) */
.messages {
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at top, #3b1d63 0%, #050008 55%, #000 100%);
  color: #fff;
  font-size: 17px;
  line-height: 1.55;
  padding: 20px 12px 28px;
  min-height: calc(100svh - 150px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.msg-row {
  margin: 14px 0;
}

.msg-row.you {
  background: transparent;
  color: #a974ff;
  /* user = purple text */
  margin-left: 8px;
  margin-right: 0;
  padding: 6px 0;
}

.msg-row.eva {
  background: transparent;
  color: #fff;
  /* Eva = white text */
  margin-left: 8px;
  margin-right: 0;
  padding: 6px 0;
}

/* composer */
.composer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #000;
  border-top: 1px solid #222;
  padding: 4px 0 var(--safe) 0;
}

.composer .inner {
  max-width: 100%;
}

.text-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 12px;
  gap: .5rem;
}

/* chat input */
#msg {
  flex: 1;
  width: 100%;
  min-height: 56px;
  max-height: 220px;
  resize: none;
  overflow-y: auto;
  font-size: 18px;
  line-height: 1.5;
  color: #fff;
  caret-color: #7c3aed;
  background: #1a1b1e;
  border: 2px solid #7c3aed;
  border-radius: 14px;
  outline: none;
  padding: 14px 56px 14px 18px;
  /* leave space for in-field icon on the right */
}

#msg::placeholder {
  color: #a38adf;
}

#msg:focus {
  box-shadow: 0 0 0 2px #a78bfa40;
}

#msg::selection {
  background: rgba(124, 58, 237, .35);
}

/* in-field send button (inside the input) */
.vsSend {
  position: absolute;
  right: 15px;
  bottom: 5px;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vsSend img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.vsSend:active {
  transform: scale(.95);
}

.vsSend.sending {
  opacity: .5;
  pointer-events: none;
  filter: grayscale(100%);
}

/* big VERBALSAGE wordmark Settings button */
.settingsBtn {
  display: block;
  margin: 8px auto 0;
  /* small gap above; centered */
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* size & display the logo cleanly */
.settingsBtn img {
  height: 30px;
  /* tweak 24–32px to taste */
  width: auto;
  display: block;
  background: transparent;
}

/* ---------- Auth gate / landing screen ---------- */
.authGate {
  position: fixed;
  inset: 0;
  display: none;
  /* hidden by default; auth.js sets to flex when logged out */
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #3b1d63 0%, #050008 55%, #000 100%);
  z-index: 9999;
}

.authGatePanel {
  max-width: 480px;
  width: 90%;
  padding: 28px 32px 30px;
  background: #050010;
  border-radius: 24px;
  border: 1px solid rgba(140, 82, 255, 0.6);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9);
  text-align: center;
  margin-top: -40px;
}

/* Logo + wordmark */
.authGateLogo {
  display: block;
  width: 160px;
  height: auto;
  margin: 0 auto 1.8rem;
}

.authGateWordmark {
  font-size: 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e5d0ff;
  margin-top: 0;
  margin-bottom: 1.2rem;
}

/* Tagline / note text */
.authGateTagline {
  font-size: 0.95rem;
  color: #d8a0ff;
  margin-bottom: 0.75rem;
}

.authGateNote {
  font-size: 0.85rem;
  color: #b579ff;
  margin-bottom: 1.5rem;
}

/* Auth form layout */
.authForm {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.authForm input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #3a3058;
  background: #0f0a18;
  color: #fdfbff;
  font-size: 0.9rem;
}

.authForm input::placeholder {
  color: #8874b2;
}

.authPasswordRow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.authPasswordRow input {
  flex: 1;
}

.authTogglePassword {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #3a3058;
  background: #1b132a;
  color: #d8a0ff;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Primary / secondary buttons */
.authActions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.authActions button {
  flex: 1;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #a372ff;
  background: #a372ff;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s ease, transform 0.2s ease;
}

.authActions button.secondary {
  background: transparent;
  color: #a372ff;
}

.authActions button:hover {
  background: #bf8fff;
  transform: translateY(-1px);
}

.authActions button.secondary:hover {
  background: rgba(163, 114, 255, 0.12);
}

/* Status line */
.authMessage {
  min-height: 1.2rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #f4b0ff;
}

/* ===== Settings overlay ===== */

#settingsOverlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: radial-gradient(circle at top, #3b1d63 0%, #050008 55%, #000 100%);
  display: none;
  /* hidden by default */
  align-items: center;
  /* center vertically */
  justify-content: center;
  /* center horizontally */
  padding: 32px 16px;
  /* some breathing room */
}

/* When visible, chat.js adds .is-visible */
#settingsOverlay.is-visible {
  display: flex;
}

.settingsPanel {
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: #000;
  border: 1px solid #262626;
  border-radius: 18px;
  padding: 20px 24px 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.settingsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.settingsHeader h1 {
  margin: 0;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #f5f3ff;
}

.settingsClose {
  background: transparent;
  border: none;
  color: #b3a5ff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.settingsSection {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #222;
}

.settingsSection h2 {
  margin: 0 0 4px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c9b8ff;
}

.settingsSection p {
  margin: 0;
  font-size: 13px;
  color: #9a94ad;
}

/* Mobile adjustments for landing */
@media (max-width: 600px) {
  .authGatePanel {
    margin: 0 16px;
    padding: 24px 20px 24px;
  }

  .authGateLogo {
    width: 140px;
    margin-bottom: 1.8rem;
  }

  .authGateWordmark {
    margin-bottom: 1.1rem;
  }

  .authGateTagline,
  .authGateNote {
    font-size: 0.85rem;
  }

  .authForm input {
    font-size: 0.85rem;
  }

  .authActions button {
    font-size: 0.8rem;
  }
}
