/* —— basic reset —— */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  color: #111111;
  background:
    radial-gradient(
      circle at top left,
      rgba(179, 0, 59, 0.12) 0%,
      transparent 28%
    ),
    linear-gradient(135deg, #fffdf8 0%, #fff6e2 100%);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.page-wrapper {
  width: min(92%, 980px);
  padding: 26px 0 40px;
}

.site-header {
  text-align: center;
  padding: 30px 24px 24px;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 45%, #b3003b 100%);
  color: #ffffff;
  border-radius: 30px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
  border: 2px solid #d4a73a;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(
    circle,
    rgba(212, 167, 58, 0.24) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
  pointer-events: none;
}

.brand-logo {
  width: 150px;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
}

.site-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.site-subtitle {
  font-size: 15px;
  color: #f4d57a;
}

.chatbox {
  margin: 24px 0 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.12);
  border: 2px solid rgba(212, 167, 58, 0.4);
  backdrop-filter: blur(8px);
}

.chat-window {
  height: 430px;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff4dc 100%);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(212, 167, 58, 0.25);
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 88%;
}

.msg.user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg.ai {
  align-self: flex-start;
  align-items: flex-start;
}

.question-preview {
  font-size: 12px;
  font-weight: 700;
  color: #b3861c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msg-bubble {
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.55;
  white-space: pre-line;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.msg.user .msg-bubble {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  color: #ffffff;
  border-bottom-right-radius: 6px;
}

.msg.ai .msg-bubble {
  background: linear-gradient(135deg, #fff7df 0%, #f3cf76 100%);
  color: #3d2d00;
  border-bottom-left-radius: 6px;
}

.chat-form {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.chat-form input {
  flex: 1;
  padding: 13px 15px;
  border: 1px solid rgba(212, 167, 58, 0.4);
  border-radius: 999px;
  font-size: 16px;
  outline: none;
  background: #fffdf9;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-form input:focus {
  border-color: #b3003b;
  box-shadow: 0 0 0 3px rgba(179, 0, 59, 0.16);
}

.chat-form button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #b3003b 0%, #7a0024 100%);
  color: #ffffff;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(179, 0, 59, 0.25);
}

.chat-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(179, 0, 59, 0.32);
}

.chat-form button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.chat-form button .material-icons {
  font-size: 22px;
}

.site-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: #6b6b6b;
}

.site-footer nav {
  margin-top: 8px;
}

.site-footer a {
  margin: 0 8px;
  color: #111111;
  text-decoration: none;
}

.site-footer a:hover {
  color: #b3003b;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .page-wrapper {
    width: 96%;
  }

  .chatbox {
    padding: 12px;
  }

  .chat-window {
    height: 360px;
  }
}
