/* Sammy member app stylesheet
 * Brand: gold #C08000, off-white #FDFBF9, black #000000
 */

:root {
  --gold: #C08000;
  --gold-soft: #D4900A;
  --gold-pale: #FAF3E2;
  --cream: #FDFBF9;
  --ink: #1B1207;
  --muted: #6B5E4A;
  --line: #E9E2D5;
  --shadow: 0 1px 2px rgba(27, 18, 7, 0.06), 0 8px 24px rgba(27, 18, 7, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --max: 880px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 0.6rem; font-weight: 700; }
h3 { font-size: 1.15rem; color: var(--gold); margin: 1.2rem 0 0.4rem; font-weight: 700; }
p { margin: 0 0 0.9rem; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold) url('/static/img/Sammy_Neutral_1800px.png') center/cover no-repeat;
  flex-shrink: 0;
}
.site-nav { display: flex; gap: 1.4rem; }
.site-nav a { color: var(--ink); }

main {
  max-width: var(--max);
  margin: 2rem auto 4rem;
  padding: 0 1.4rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
}
.btn-primary { background: var(--gold); color: white; }
.btn-primary:hover { background: var(--gold-soft); }
.btn-secondary { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); }
.btn-secondary:hover { background: var(--gold-pale); }
.btn:active { transform: translateY(1px); }

/* Sammy stage */
.sammy-stage {
  width: 280px;
  height: 280px;
  background: transparent;
}
.sammy-stage-small {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: center;
  padding: 1rem 0 3rem;
}
.hero-sammy { display: flex; justify-content: center; }
.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.4rem; }
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .cta-row { justify-content: center; }
}

/* Conversations list */
.conversations-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.conversations-header > div { flex: 1; min-width: 200px; }
.convo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.convo-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.convo-list a:hover { border-color: var(--gold); background: var(--gold-pale); text-decoration: none; }
.convo-title { font-weight: 600; }
.convo-meta { color: var(--muted); font-size: 0.9rem; }

.empty-state {
  background: white;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

/* Chat */
.chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 500px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--gold-pale);
}
.chat-header h1 { font-size: 1.1rem; margin: 0; }
.chat-sub { margin: 0; color: var(--muted); font-size: 0.9rem; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--cream);
}
.message {
  max-width: 78%;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  line-height: 1.5;
}
.message p { margin: 0; }
.message-user {
  background: var(--gold);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.message-assistant {
  background: white;
  color: var(--ink);
  align-self: flex-start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.message-greeting {
  background: var(--gold-pale);
  border-color: transparent;
}

/* Soft cap message (returned when daily limit is reached) */
.message-cap {
  background: var(--gold-pale);
  border: 1px solid var(--gold);
  color: var(--ink);
  max-width: 90%;
}

/* Empty state with suggested prompts */
.empty-chat {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.5rem 0;
}
.empty-chat-greeting {
  background: var(--gold-pale);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  color: var(--ink);
}
.empty-chat-greeting p { margin: 0; }
.suggested-prompts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
}
.suggested-prompt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.suggested-prompt:hover {
  border-color: var(--gold);
  background: var(--gold-pale);
}
.suggested-prompt:active { transform: translateY(1px); }
.prompt-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.prompt-text {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.4;
}

/* Typing dots */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
  animation: dotPulse 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); }
  30% { opacity: 1; transform: scale(1); }
}

/* Composer */
.composer {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--line);
  background: white;
}
.composer textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--cream);
  color: var(--ink);
}
.composer textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

/* Auth */
.auth {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}
.auth .sammy-stage { margin: 0 auto 1rem; }
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 1.4rem 0;
  text-align: left;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.auth-form input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  background: white;
}
.auth-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

/* Flash messages */
.flash-stack { max-width: var(--max); margin: 1rem auto 0; padding: 0 1.4rem; }
.flash {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.flash-error { background: #FBE9E7; color: #8B2C19; }
.flash-success { background: var(--gold-pale); color: var(--ink); }

/* Footer */
.site-footer {
  max-width: var(--max);
  margin: 3rem auto 2rem;
  padding: 1.5rem 1.4rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}
.site-footer p { margin: 0 0 0.4rem; }
