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

html, body {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0a1628;
  color: #e0e6f0;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* PIN screen */
.pin-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 20px;
}

.pin-screen h1 {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #7aa2d4;
}

.pin-screen p {
  color: #4a6080;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.pin-screen form {
  display: flex;
  gap: 10px;
}

.pin-input {
  width: 140px;
  padding: 14px 20px;
  border: 1px solid #1e3258;
  border-radius: 24px;
  background: #101e36;
  color: #e0e6f0;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.pin-input:focus {
  border-color: #3a6aaa;
}

.pin-submit {
  padding: 14px 24px;
  border: none;
  border-radius: 24px;
  background: #1b3a6b;
  color: #a0c0e8;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.pin-submit:hover {
  background: #244d8a;
}

.pin-error {
  color: #c44;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 800px;
  margin: 0 auto;
}

/* Header */
.chat-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid #1a2a4a;
}

.chat-header h1 {
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #7aa2d4;
}

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 0.95rem;
  word-wrap: break-word;
}

.bot-message {
  align-self: flex-start;
  background: #152240;
  border: 1px solid #1e3258;
  border-bottom-left-radius: 4px;
}

.user-message {
  align-self: flex-end;
  background: #1b3a6b;
  border-bottom-right-radius: 4px;
}

.message-text {
  display: block;
}

/* Typing indicator */
.typing-indicator .message-text::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: #7aa2d4;
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Input area */
.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid #1a2a4a;
  background: #0d1b30;
}

.chat-input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid #1e3258;
  border-radius: 24px;
  background: #101e36;
  color: #e0e6f0;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #3a6aaa;
}

.chat-input::placeholder {
  color: #4a6080;
}

.chat-submit {
  padding: 14px 28px;
  border: none;
  border-radius: 24px;
  background: #1b3a6b;
  color: #a0c0e8;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 1px;
}

.chat-submit:hover {
  background: #244d8a;
}

.chat-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #1e3258;
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 600px) {
  .chat-header {
    padding: 14px;
  }

  .chat-header h1 {
    font-size: 1.1rem;
  }

  .message {
    max-width: 90%;
    font-size: 0.9rem;
  }

  .chat-input {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .chat-submit {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}
