/* RC2 Assistant — tema claro corporativo */
:root {
  --rc2-blue:       #0B5FFF;
  --rc2-blue-dark:  #0847bf;
  --rc2-blue-soft:  #E8F0FE;
  --bg:             #F5F7FB;
  --surface:        #FFFFFF;
  --text:           #0F1B2D;
  --text-soft:      #5A6A85;
  --border:         #E3E8F0;
  --shadow:         0 2px 12px rgba(15, 27, 45, 0.06);
  --radius:         12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* ============ LOGIN ============ */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(11, 95, 255, 0.08), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(11, 95, 255, 0.06), transparent 40%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.brand { text-align: center; margin-bottom: 24px; }
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  background: var(--rc2-blue);
  color: #fff;
  font-weight: 800;
  border-radius: 14px;
  letter-spacing: 0.5px;
  font-size: 18px;
  margin-bottom: 12px;
}
.brand-logo.small { width: 36px; height: 36px; font-size: 13px; border-radius: 10px; margin: 0; }
.brand h1 { margin: 0; font-size: 22px; }
.brand-sub { margin: 4px 0 0; color: var(--text-soft); font-size: 14px; }

#login-form label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-soft);
}
#login-form span { display: block; margin-bottom: 6px; }
#login-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#login-form input:focus {
  outline: none;
  border-color: var(--rc2-blue);
  box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.15);
}
#login-form button {
  width: 100%;
  padding: 11px;
  background: var(--rc2-blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
#login-form button:hover:not(:disabled) { background: var(--rc2-blue-dark); }
#login-form button:disabled { opacity: 0.6; cursor: not-allowed; }

.error {
  margin-top: 12px;
  padding: 8px 12px;
  background: #FEE;
  color: #A11;
  border-radius: 8px;
  font-size: 13px;
}
.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}

/* ============ CHAT ============ */
.chat-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-weight: 700; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.model-select {
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.model-select select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.ghost-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ghost-btn:hover {
  background: var(--rc2-blue-soft);
  border-color: var(--rc2-blue);
  color: var(--rc2-blue-dark);
}

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

.empty-state {
  margin: auto;
  text-align: center;
  color: var(--text-soft);
}
.empty-state h2 { color: var(--text); margin: 0 0 6px; }

.msg {
  display: flex;
  max-width: 100%;
}
.msg-user { justify-content: flex-end; }
.msg-assistant { justify-content: flex-start; }

.bubble {
  max-width: min(720px, 85%);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: normal;
  box-shadow: var(--shadow);
}
.msg-user .bubble {
  background: var(--rc2-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-assistant .bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg.typing .bubble {
  color: var(--text-soft);
  font-style: italic;
}

.composer {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.composer textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 42px;
  max-height: 200px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer textarea:focus {
  border-color: var(--rc2-blue);
  box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.15);
}
.composer button {
  padding: 0 22px;
  background: var(--rc2-blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.composer button:hover:not(:disabled) { background: var(--rc2-blue-dark); }
.composer button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Mobile */
@media (max-width: 640px) {
  .topbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .topbar-title { font-size: 14px; }
  .ghost-btn, .model-select select { font-size: 12px; padding: 5px 8px; }
  .messages { padding: 16px 12px; }
  .bubble { max-width: 90%; font-size: 14px; }
  .composer { padding: 10px 12px; }
}
