/* Companion PWA — same warm ADHD-friendly design as landing */
:root {
  --bg: #0f0f1a;
  --bg-soft: #1a1a2e;
  --card: #1f1f35;
  --text: #e8e8f0;
  --text-soft: #a0a0b8;
  --accent: #b8a4ff;
  --accent-soft: #d4c5ff;
  --warm: #ffd4a3;
  --border: #2a2a45;
  --user-bubble: #2a2345;
  --bot-bubble: #1f1f35;
  --radius: 16px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

#app { min-height: 100%; display: flex; flex-direction: column; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: fadein 0.4s ease;
}

.hidden { display: none !important; }

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

.mascot {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 16px;
}

h1 {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.lead {
  text-align: center;
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 40px;
}

.lead-small {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.reassure {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.85rem;
  margin-top: 16px;
}

button {
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button.primary {
  width: 100%;
  padding: 18px;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.05rem;
  transition: background 0.2s, transform 0.1s;
}

button.primary:hover { background: var(--accent-soft); }
button.primary:active { transform: scale(0.98); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

button.ghost {
  width: 100%;
  padding: 14px;
  color: var(--text-soft);
  background: none;
  margin-top: 12px;
}

button.back {
  font-size: 1.5rem;
  color: var(--text-soft);
  align-self: flex-start;
  padding: 8px 0;
  margin-bottom: 16px;
}

input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  padding: 16px 18px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

input:focus { outline: none; border-color: var(--accent); }

.option {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
}

.option:hover { border-color: var(--accent); }
.option:active { transform: scale(0.99); }

.option-icon { font-size: 1.5rem; }
.option-body h3 { font-size: 1rem; margin-bottom: 4px; }
.option-body p { font-size: 0.85rem; color: var(--text-soft); }

.form-status {
  color: var(--warm);
  font-size: 0.9rem;
  margin-top: 8px;
  min-height: 1.2em;
}
.form-status.error { color: #ff8a8a; }

.how-to {
  margin-top: 24px;
  color: var(--text-soft);
  font-size: 0.85rem;
}
.how-to summary { cursor: pointer; padding: 8px 0; }
.how-to p { padding: 4px 0; }

/* Check-in */
.greeting { margin-bottom: 24px; }
.time-greeting {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.energy-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.energy-picker button {
  flex: 1;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}

.energy-picker button.selected {
  border-color: var(--accent);
  background: var(--bg-soft);
}

/* Chat */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 16px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 1rem;
  word-wrap: break-word;
  animation: msgIn 0.3s ease;
}

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

.msg.user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.msg.bot {
  align-self: flex-start;
  background: var(--bot-bubble);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg.bot.typing {
  color: var(--text-soft);
}

.composer {
  display: flex;
  gap: 8px;
  padding: 12px 0 24px;
  align-items: center;
}

.composer input {
  flex: 1;
  margin: 0;
  border-radius: 24px;
  padding: 12px 18px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.2s;
}

.icon-btn:hover { background: var(--bg-soft); }
.icon-btn.recording { background: var(--accent); animation: pulse 1.5s infinite; }
.icon-btn.primary { background: var(--accent); color: var(--bg); }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
