/* ============================================
   My Family Checkup — Styles
   Wellness aesthetic: sage green, warm neutrals
   ============================================ */

:root {
  --sage: #7C9A82;
  --sage-light: #E8F0E9;
  --sage-dark: #5A7D61;
  --warm-bg: #FAFAF7;
  --warm-card: #FFFFFF;
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --text-light: #B2BEC3;
  --border: #E8E8E4;
  --user-bubble: #7C9A82;
  --user-text: #FFFFFF;
  --ai-bubble: #F0F0EC;
  --ai-text: #2D3436;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--warm-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ============================================
   Screens
   ============================================ */

.screen {
  display: none;
  height: 100%;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ============================================
   Landing Screen
   ============================================ */

.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.logo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sage);
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

.landing-content h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  max-width: 320px;
  margin-bottom: 2rem;
}

.btn-primary {
  background: var(--sage);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--sage-dark);
}

.btn-primary:active {
  transform: scale(0.97);
}

.landing-sub {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.trust-signals {
  padding: 1rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
}

/* ============================================
   Chat Screen
   ============================================ */

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--warm-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sage);
}

.progress-indicator {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Messages */

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.message {
  max-width: 85%;
  margin-bottom: 12px;
  animation: messageIn 0.3s ease-out;
}

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

.message.ai {
  align-self: flex-start;
}

.message.user {
  margin-left: auto;
}

.bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.message.ai .bubble {
  background: var(--ai-bubble);
  color: var(--ai-text);
  border-bottom-left-radius: 4px;
}

.message.user .bubble {
  background: var(--user-bubble);
  color: var(--user-text);
  border-bottom-right-radius: 4px;
}

/* Typing indicator */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--ai-bubble);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  width: fit-content;
  margin-bottom: 12px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typingBounce 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 typingBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Options */

.options-container {
  padding: 0 16px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.option-btn {
  background: var(--warm-card);
  color: var(--sage-dark);
  border: 1.5px solid var(--sage);
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.option-btn:hover {
  background: var(--sage-light);
}

.option-btn:active {
  background: var(--sage);
  color: white;
  transform: scale(0.96);
}

/* Input */

.input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--warm-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#user-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
  background: var(--warm-bg);
}

#user-input:focus {
  border-color: var(--sage);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sage);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  flex-shrink: 0;
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.send-btn:not(:disabled):hover {
  background: var(--sage-dark);
}

/* ============================================
   Completion Screen
   ============================================ */

.complete-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.checkmark {
  width: 64px;
  height: 64px;
  background: var(--sage);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  animation: checkPop 0.4s ease-out;
}

@keyframes checkPop {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.complete-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.complete-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 0.75rem;
}

.complete-sub {
  font-size: 0.9rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.footer a {
  color: var(--text-light);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ============================================
   Responsive
   ============================================ */

@media (min-width: 600px) {
  body {
    display: flex;
    justify-content: center;
    background: #F0F0EC;
  }

  .screen {
    max-width: 420px;
    width: 100%;
    background: var(--warm-bg);
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
    border-radius: 0;
  }

  .landing-content h1 {
    font-size: 2rem;
  }
}
