:root {
  --color-bg: #0f1117;
  --color-panel: rgba(24, 26, 33, 0.7);
  --color-glass: rgba(32, 34, 42, 0.6);
  --color-primary: #ff6b00;
  --color-text: #f0f0f0;
  --color-muted: #aaa;
  --radius: 14px;
  --shadow-elevated: 0 4px 30px rgba(0, 0, 0, 0.6);
  --font-ui: 'Inter', 'Segoe UI', 'Helvetica Neue', sans-serif;
  --transition: all 0.25s ease;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

#logo-container {
  position: absolute;
  top: 20px;
  left: 30px;
  z-index: 100;
}

#logo {
  height: 36px;
  opacity: 0.9;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.05));
}

#chat-container {
  margin-top: 5vh;
  background: var(--color-glass);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  width: 90%;
  max-width: 900px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#chat-box {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.message {
  max-width: 75%;
  margin-bottom: 1.2rem;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius);
  font-size: 1.05rem;
  line-height: 1.6;
  word-break: break-word;
}

.user {
  background: var(--color-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.bot {
  background: #1a1c24;
  color: var(--color-text);
  align-self: flex-start;
  border-bottom-left-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

#user-input {
  display: flex;
  padding: 1rem;
  background: var(--color-panel);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#prompt {
  flex: 1;
  background: #1a1c24;
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  color: var(--color-text);
  font-size: 1rem;
  resize: none;
  transition: var(--transition);
}

#prompt:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary);
}

#send-btn {
  margin-left: 1rem;
  background: var(--color-primary);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#send-btn:hover {
  transform: scale(1.05);
}

#send-btn img {
  width: 22px;
  height: 22px;
  filter: invert(100%);
}

#controls {
  position: absolute;
  top: 100px;
  right: 30px;
  display: flex;
  gap: 1rem;
}

.form-select {
  background-color: #1a1c24;
  color: var(--color-text);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  float: right;
}

.thinking {
  height: 28px;
  animation: blink 1.2s step-start infinite;
  margin-right: 0.5rem;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Scrollbar */
#chat-box::-webkit-scrollbar {
  width: 6px;
}
#chat-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.form-select {
  background-color: #1e1e24;
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
  transition: var(--transition);
}

.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary);
}

#topbar {
  width: 100%;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: transparent;
  flex-wrap: nowrap; /* important */
  gap: 2rem;
}

.branding {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.brand-title span {
  color: var(--color-primary);
}

.brand-subtitle {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.selectors {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.selectors select.form-select {
  background-color: #1a1c24;
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  min-width: 150px;
}

.selectors select.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary);
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  #topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .selectors {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
  }
}


#chat-container {
  max-width: 960px;
  margin: 0 auto 0 auto;

}
#topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  max-width: 960px;
  margin: 0 auto; /* centrage horizontal */
  flex-wrap: wrap;
  gap: 2rem;
}


/* LOGIN */
body {
      justify-content: center;
    }

    .login-wrapper {
      margin-top: 10vh;
      background: var(--color-glass);
      backdrop-filter: blur(20px);
      border-radius: var(--radius);
      box-shadow: var(--shadow-elevated);
      width: 90%;
      max-width: 400px;
      padding: 2rem;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .login-wrapper h2 {
      text-align: center;
      margin-bottom: 1.5rem;
      color: var(--color-text);
    }

    .login-wrapper .form-control {
      background-color: #1a1c24;
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: var(--color-text);
      border-radius: var(--radius);
      padding: 0.8rem 1rem;
      font-size: 1rem;
    }

    .login-wrapper .form-control:focus {
      outline: none;
      border-color: var(--color-primary);
      box-shadow: 0 0 0 2px var(--color-primary);
    }

    .login-wrapper .btn-login {
      background-color: var(--color-primary);
      color: white;
      border: none;
      width: 100%;
      padding: 0.75rem;
      border-radius: var(--radius);
      font-size: 1rem;
      margin-top: 1rem;
      transition: var(--transition);
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .login-wrapper .btn-login:hover {
      transform: scale(1.03);
    }

    .login-wrapper .brand-subtitle {
      text-align: center;
      margin-top: 0.5rem;
      color: var(--color-muted);
      font-size: 0.85rem;
    }

    .me {
        background: rgba(255, 255, 255, 0.1);
        padding: 10px;
        color: #eee;
        margin-bottom: 1em;
        text-align: right;
    }
#bt-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 17, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.bt-popup {
  background: var(--color-glass);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text);
  max-width: 400px;
  text-align: center;
  backdrop-filter: blur(20px);
}

.bt-popup button {
  margin-top: 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.bt-popup button:hover {
  transform: scale(1.05);
}

.logout-button {
  background-color: transparent;
  border: none;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.logout-button:hover {
  background-color: rgba(255, 107, 0, 0.1);
}

.logout-button img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  background: transparent !important;
  border: none;
}
#mfa-step .form-label {
  font-size: 0.95rem;
  color: var(--color-text);
}

#mfa-step #mfa-message {
  text-align: center;
  color: #4caf50;
}

