:root {
  color-scheme: light;
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f8;
  --bg-tertiary: #ececf1;
  --text-primary: #353740;
  --text-secondary: #6e6e80;
  --border-color: #d1d5db;
  --border-hover: #8e8ea0;
  --primary-color: #10a37f;
  --primary-hover: #0d8c6f;
  --error-color: #ef4444;
  --success-color: #10b981;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.card {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 40px;
  box-shadow: var(--shadow-md);
  width: 100%;
  border: 1px solid var(--border-color);
}

.logo-section {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  font-family: Arial, sans-serif;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-stretch: extra-expanded;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0 0 8px 0;
  font-weight: 500;
}

.description {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
  font-weight: 400;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

input::placeholder {
  color: var(--text-secondary);
}

input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

input:hover:not(:focus) {
  border-color: var(--border-hover);
}

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  border-radius: 6px;
  border: none;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

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

.btn-primary:active {
  transform: scale(0.98);
}

.message {
  text-align: center;
  margin-top: 16px;
  min-height: 20px;
  font-size: 13px;
  font-weight: 400;
  padding: 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.message:not(:empty) {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Chat Page Styles */
.chat-layout {
  background: var(--bg-primary);
  width: min(1000px, 95%);
  height: min(700px, 90vh);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  margin: 20px auto;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
}

.chat-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  background: var(--bg-primary);
}

.chat-history::-webkit-scrollbar {
  width: 8px;
}

.chat-history::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.chat-history::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.chat-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 14px;
  word-wrap: break-word;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble.user {
  margin-left: auto;
  background: var(--primary-color);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  margin-right: auto;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-input {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  background: var(--bg-primary);
}

.chat-input textarea {
  flex: 1;
  resize: none;
  min-height: 80px;
  max-height: 200px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  transition: all 0.2s ease;
  outline: none;
}

.chat-input textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.chat-input button {
  width: 120px;
  padding: 12px 16px;
  border-radius: 6px;
  border: none;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-end;
}

.chat-input button:hover:not(:disabled) {
  background: var(--primary-hover);
}

.chat-input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tag {
  background: var(--bg-secondary);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.priority-pill {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-weight: 500;
}

.hidden {
  display: none !important;
}

.btn-end-conversation {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-end-conversation:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
}

.btn-end-conversation:active {
  transform: scale(0.98);
}

/* Responsive Design */
@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .card {
    padding: 32px 24px;
  }

  .logo {
    font-size: 28px;
  }

  .chat-layout {
    border-radius: 0;
    height: 100vh;
    margin: 0;
  }

  .chat-header {
    padding: 12px 16px;
  }

  .chat-header h2 {
    font-size: 16px;
  }

  .chat-history {
    padding: 16px;
  }

  .chat-input {
    flex-direction: column;
    padding: 12px;
  }

  .chat-input button {
    width: 100%;
  }

  .chat-bubble {
    max-width: 85%;
  }
}
