/* Login + chat pages. Builds on the tokens in styles.css. */

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 36px 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.login-card h1 { font-size: 24px; font-weight: 700; }
.logo.big svg { width: 56px; height: 56px; }
.muted-lg { color: var(--ink-2); margin: 0 0 10px; }
.btn.wide { width: 100%; }
.btn.small { padding: 6px 12px; font-size: 13px; }

/* ---------- top nav ---------- */
.topnav { display: flex; align-items: center; gap: 10px; }
.nav-seg { padding: 3px; }
.nav-seg a { padding: 5px 14px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.nav-seg a.on { background: var(--surface); color: var(--brand-deep); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .brand p { display: none; }
  #modePill { display: none; }
}

/* ---------- chat layout ---------- */
.chat-page { min-height: 100vh; display: flex; flex-direction: column; }
.chat-wrap { flex: 1; width: min(780px, 100%); margin: 0 auto; padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.thread { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }

.welcome { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.welcome h2 { font-size: 20px; }
.welcome p { margin: 0; color: var(--ink-2); }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.starters button {
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 7px 13px; cursor: pointer;
  font-size: 13.5px; color: var(--ink); transition: border-color .15s, background .15s;
}
.starters button:hover { border-color: var(--brand); background: var(--brand-soft); }

.msg { display: flex; flex-direction: column; gap: 8px; max-width: 88%; }
.msg.user { align-self: flex-end; }
.msg.assistant { align-self: flex-start; }
.bubble { padding: 10px 14px; border-radius: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg.assistant .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child, .bubble ul:last-child { margin-bottom: 0; }
.bubble ul { margin: 0 0 8px; padding-left: 20px; }
.bubble li { margin: 2px 0; }
.msg.error .bubble { border-color: color-mix(in srgb, var(--err) 40%, var(--line)); color: var(--err); }

.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: .6; } }

/* slot cards inside the thread */
.slotcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; width: min(640px, 88vw); }
.slotcard {
  border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; display: flex; flex-direction: column;
  gap: 3px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; box-shadow: var(--shadow);
}
.slotcard:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.slotcard:disabled { cursor: default; opacity: .6; }
.slotcard.best { border-color: var(--brand); }
.slotcard .tag { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-deep); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; margin-bottom: 3px; }
.slotcard .tag.late { color: var(--warn); background: var(--warn-soft); }
.slotcard .d { font-weight: 700; font-size: 15px; }
.slotcard .t { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--brand-deep); }
.slotcard .p, .slotcard .l { font-size: 12.5px; color: var(--ink-2); }
.slotcard .go { margin-top: 6px; font-size: 12.5px; font-weight: 650; color: var(--brand); }

/* booking confirmation */
.booked { border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); background: var(--ok-soft); border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; width: min(520px, 88vw); }
.booked .check-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); color: var(--ok); display: grid; place-items: center; flex: none; }
.booked b { display: block; }
.booked .small { font-size: 13px; color: var(--ink-2); }
.booked .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* composer */
.composer {
  position: sticky; bottom: 10px; display: flex; gap: 8px; align-items: flex-end; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; padding: 8px; box-shadow: 0 6px 24px rgb(20 30 28 / 10%);
}
.composer textarea { border: 0; resize: none; max-height: 160px; padding: 9px 10px; background: transparent; box-shadow: none; }
.composer textarea:focus { box-shadow: none; }
.composer .btn { border-radius: 12px; padding: 10px 12px; display: grid; place-items: center; }
.fineprint { text-align: center; font-size: 12px; color: var(--muted); margin: 0; }
