@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ─── Reset & base ───────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --surface2:  #22263a;
  --border:    #2a2d3a;
  --accent:    #fe9b58;
  --accent-dim: #f9e5d8;
  --text:      #e8e8f0;
  --text-muted:#6b7280;
  --error:     #f87171;
  --radius:    10px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Utilidad ───────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Navbar ─────────────────────────────────────── */
#navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar-brand {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.navbar-brand::after {
  content: '●';
  color: var(--accent);
  margin-left: 6px;
  font-size: 0.5rem;
  vertical-align: middle;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

#welcome-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#logout-btn {
  width: auto;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-family: inherit;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  margin-top: 0;
}

#logout-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ─── Auth view ──────────────────────────────────── */
#auth-view {
  max-width: 380px;
  margin: 80px auto 0;
  padding: 0 24px;
}

#auth-view h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 28px;
  color: var(--text);
}

#auth-form input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  margin-top: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

#auth-form input::placeholder {
  color: var(--text-muted);
}

#auth-form input:focus {
  border-color: var(--accent);
}

#auth-submit-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 11px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .2s;
}

#auth-submit-btn:hover { opacity: 0.88; }

#auth-error {
  font-size: 0.85rem;
  color: var(--error);
  min-height: 1.4em;
  margin-top: 12px;
}

#auth-view > p:last-child {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

#auth-toggle-link {
  color: var(--accent);
  text-decoration: none;
  margin-left: 4px;
}

#auth-toggle-link:hover { text-decoration: underline; }

/* ─── Chat view ──────────────────────────────────── */
#chat-view {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);  /* ocupa el espacio bajo la navbar */
}

/* ─── Mensajes ───────────────────────────────────── */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* animación de entrada */
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg {
  animation: msg-in .18s ease-out both;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 88%;
}

/* Mensaje del usuario */
.msg.user {
  flex-direction: row-reverse;
  margin-left: auto;
}

.msg.user .msg-bubble {
  background: var(--accent);
  color: #0f1117;
  border-radius: var(--radius) var(--radius) 2px var(--radius);
}

/* Mensaje del bot */
.msg.bot {
  margin-right: auto;
}

.msg.bot .msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  border-radius: var(--radius) var(--radius) var(--radius) 2px;
}

.msg-bubble {
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Avatar del bot */
.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

/* ─── Input de chat ──────────────────────────────── */
#chat-form {
  display: flex;
  gap: 10px;
  padding: 16px 0 24px;
  border-top: 1px solid var(--border);
}

#chat-input {
  flex: 1;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

#chat-input::placeholder { color: var(--text-muted); }
#chat-input:focus { border-color: var(--accent); }

#chat-form button {
  padding: 11px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  background: var(--accent);
  color: #0f1117;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .2s;
  flex-shrink: 0;
  width: auto;
  margin-top: 0;
}

#chat-form button:hover { opacity: 0.88; }

.container-nota{
  padding: 0.2rem;
}
.nota-info{
  color:var(--text);
  font-size: smaller;
}

.nota-info a {
  color:var(--accent-dim);
  font-size: smaller;
}
/* ─── Reduced motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; }
}