/* Éclore App — uses same design tokens as landing page */

:root {
  --cream: #F9F4EE;
  --warm-white: #FFFDF9;
  --terracotta: #C4704A;
  --dusty-rose: #C98B8B;
  --sage: #8A9E8A;
  --deep-plum: #5C3A6B;
  --warm-brown: #6B4F3A;
  --ink: #1E1612;
  --muted: #7A6F67;
  --border: #E5DDD4;
  --danger: #B85C4A;
  --success: #6B8F6B;
}

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

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

/* ─── Auth Screen ─── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: var(--cream);
}

.auth-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.07);
}

.auth-card__logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}

.auth-card__tagline {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.auth-card h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

.form-group input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--terracotta);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
}

.btn:hover { opacity: 0.88; }
.btn:active { opacity: 0.7; }

.btn-primary {
  background: var(--ink);
  color: var(--cream);
  width: 100%;
}

.btn-secondary {
  background: var(--border);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.btn-ghost:hover { color: var(--ink); }

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-switch button {
  background: none;
  border: none;
  color: var(--terracotta);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}

.error-msg {
  background: #FDF0EE;
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: var(--danger);
  margin-bottom: 1rem;
  display: none;
}

/* ─── App Shell ─── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top bar */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
}

.app-topbar__logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.app-topbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-topbar__pseudo {
  font-size: 0.875rem;
  color: var(--muted);
}

.app-topbar__subbadge {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  background: var(--sage);
  color: white;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.app-topbar__subbadge--locked {
  background: var(--dusty-rose);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'DM Sans', sans-serif;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}

.logout-btn:hover {
  background: var(--border);
  color: var(--ink);
}

/* Main layout */
.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--warm-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar__section {
  padding: 1rem 1rem 0.5rem;
}

.sidebar__title {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.room-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.room-item:hover {
  background: var(--border);
  color: var(--ink);
}

.room-item.active {
  background: var(--ink);
  color: var(--cream);
}

.room-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.room-item__label {
  flex: 1;
}

.room-item__count {
  font-size: 0.7rem;
  opacity: 0.6;
}

.persona-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--deep-plum);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.12s;
  font-family: 'DM Sans', sans-serif;
}

.persona-btn:hover {
  background: var(--border);
}

.persona-btn__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--deep-plum);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Content area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Paywall / Subscription Banner */
.paywall-banner {
  background: var(--ink);
  color: var(--cream);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.paywall-banner__text {
  font-size: 0.85rem;
  color: var(--dusty-rose);
}

.paywall-banner__cta {
  padding: 0.5rem 1rem;
  background: var(--terracotta);
  color: white;
  border-radius: 8px;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Chat container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
}

.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--warm-white);
  flex-shrink: 0;
}

.chat-header__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.15rem;
}

.chat-header__desc {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.message--mine {
  align-self: flex-end;
  align-items: flex-end;
}

.message--theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.message__pseudo {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
  letter-spacing: 0.04em;
  padding: 0 0.3rem;
}

.message__bubble {
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.message--mine .message__bubble {
  background: var(--ink);
  color: var(--cream);
  border-bottom-right-radius: 4px;
}

.message--theirs .message__bubble {
  background: var(--warm-white);
  color: var(--ink);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message--lea .message__bubble {
  background: var(--deep-plum);
  color: white;
  border-bottom-left-radius: 4px;
}

.message__time {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.2rem;
  padding: 0 0.3rem;
}

/* Chat input */
.chat-input-bar {
  padding: 0.75rem 1rem;
  background: var(--warm-white);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.chat-input-bar textarea {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  resize: none;
  min-height: 42px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
}

.chat-input-bar textarea:focus {
  outline: none;
  border-color: var(--terracotta);
}

.chat-input-bar textarea::placeholder {
  color: var(--muted);
  font-size: 0.85rem;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.send-btn:hover { background: var(--warm-brown); }
.send-btn:disabled { background: var(--border); cursor: default; }

/* Léa typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: typingBounce 1.2s infinite;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Welcome state */
.chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--muted);
  padding: 2rem;
  text-align: center;
}

.chat-welcome__icon {
  font-size: 2.5rem;
}

.chat-welcome__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--ink);
  font-weight: 400;
}

.chat-welcome__desc {
  font-size: 0.875rem;
  max-width: 300px;
  line-height: 1.6;
}

/* Private message list */
.pm-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.pm-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}

.pm-item:hover { background: var(--border); }

.pm-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dusty-rose);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 500;
  flex-shrink: 0;
}

.pm-item__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}

.pm-item__preview {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

/* Subscription page */
.subscribe-page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.subscribe-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 4px 32px rgba(0,0,0,0.07);
}

.subscribe-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--deep-plum);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.5rem;
}

.subscribe-card__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.subscribe-card__price {
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.subscribe-card__price span {
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
}

.subscribe-card__features {
  list-style: none;
  text-align: left;
  margin: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.subscribe-card__features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.subscribe-card__features li::before {
  content: '✓';
  color: var(--sage);
  font-weight: 500;
}

.subscribe-card .btn-primary {
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Back button */
.back-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'DM Sans', sans-serif;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
}

.back-btn:hover { background: var(--border); color: var(--ink); }

/* Responsive */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .messages { padding: 0.75rem; }
  .message { max-width: 90%; }
  .app-topbar { padding: 0.6rem 1rem; }
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--warm-white);
  border-top: 1px solid var(--border);
  padding: 0.5rem 1rem;
  gap: 0.5rem;
  z-index: 100;
}

@media (max-width: 640px) {
  .mobile-nav { display: flex; }
  .app-main { padding-bottom: 60px; }
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}

.mobile-nav-btn.active {
  background: var(--border);
  color: var(--ink);
}

.mobile-nav-btn__icon {
  font-size: 1.1rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 200;
  animation: toastIn 0.2s ease;
  pointer-events: none;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Lea profile card */
.lea-card {
  background: var(--deep-plum);
  color: white;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 1.25rem 0.75rem;
}

.lea-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.lea-card__name {
  font-size: 0.875rem;
  font-weight: 500;
}

.lea-card__desc {
  font-size: 0.75rem;
  opacity: 0.8;
}