:root {
  --green: #087b3f;
  --green-dark: #056231;
  --green-soft: #eaf8ef;
  --green-pale: #f5fbf7;
  --orange: #ff5a1f;
  --orange-dark: #e94c16;
  --blue: #3b82f6;
  --text: #1f2937;
  --muted: #667085;
  --border: #e4e7ec;
  --white: #ffffff;
  --page: #fbfdfc;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-small: 0 10px 26px rgba(15, 23, 42, 0.06);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 19%, rgba(8, 123, 63, 0.05), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(255, 90, 31, 0.045), transparent 19%),
    var(--page);
  font-family: Inter, Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(228, 231, 236, 0.92);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.navbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-mark {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border-radius: 16px 16px 24px 24px;
  color: white;
  background: linear-gradient(145deg, #10aa60, var(--green));
  box-shadow: 0 10px 24px rgba(8, 123, 63, 0.23);
  font-size: 29px;
  font-weight: 800;
}

.logo-copy {
  line-height: 1.2;
}

.logo-copy strong {
  display: block;
  color: var(--green);
  font-size: 24px;
}

.logo-copy strong span {
  color: var(--orange);
}

.logo-copy small {
  color: var(--muted);
  font-size: 12px;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 29px;
  font-weight: 650;
}

.nav-links > a,
.dropdown-trigger {
  position: relative;
  padding: 28px 0 25px;
  color: #2b3443;
  border: 0;
  background: transparent;
  white-space: nowrap;
}

.nav-links > a:hover,
.dropdown-trigger:hover {
  color: var(--green);
}

.nav-links > a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--green);
}

.dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
}

.dropdown-menu {
  position: absolute;
  top: 72px;
  left: 50%;
  width: 294px;
  max-height: 425px;
  overflow-y: auto;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px);
  transition: 0.2s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #344054;
  text-align: left;
}

.dropdown-menu button span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--green-soft);
}

.dropdown-menu button:hover {
  color: var(--green);
  background: var(--green-pale);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 750;
  transition: 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-outline {
  color: var(--green);
  border: 1px solid #b8c2cc;
  background: white;
}

.btn-orange {
  color: white;
  background: var(--orange);
  box-shadow: 0 10px 26px rgba(255, 90, 31, 0.22);
}

.mobile-menu-btn {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 27px;
}

.hero {
  padding: 58px 0 45px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.25fr;
  align-items: center;
  gap: 52px;
}

.eyebrow {
  width: max-content;
  margin-bottom: 22px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(45px, 5vw, 72px);
  line-height: 1.03;
  letter-spacing: -2.4px;
}

h1 span {
  display: block;
}

.orange {
  color: var(--orange);
}

.green {
  color: var(--green);
}

.hero-description {
  max-width: 590px;
  margin-bottom: 28px;
  color: #4c5768;
  font-size: 18px;
}

.benefit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 29px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 11px;
}

.benefit-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 20px;
}

.benefit-item strong,
.benefit-item span {
  display: block;
}

.benefit-item span {
  color: var(--muted);
  font-size: 13px;
}

.medical-notice {
  max-width: 585px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 18px;
  border: 1px solid #d7efdf;
  border-radius: 18px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.notice-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 13px;
  color: white;
  background: var(--green);
  font-size: 22px;
}

.medical-notice p {
  margin-top: 2px;
  font-size: 14px;
}

.chat-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow);
}

.chat-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--border);
}

.assistant-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar,
.small-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: white;
  background: var(--green);
}

.bot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 21px;
}

.small-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
}

.assistant-profile strong,
.assistant-profile small {
  display: block;
}

.assistant-profile small {
  color: var(--muted);
  font-size: 12px;
}

.verified {
  color: var(--green);
}

.online-status {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 750;
}

.chat-body {
  height: 465px;
  overflow-y: auto;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff, #fcfefd);
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.message-row.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(78%, 510px);
  padding: 13px 15px;
  border-radius: 16px;
  color: #2d3748;
  background: white;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.user .message-bubble {
  color: #146a3e;
  border-color: #d9efdf;
  background: #e7f7ed;
}

.message-bubble time {
  display: block;
  margin-top: 6px;
  color: #8a94a4;
  font-size: 11px;
  text-align: right;
}

.typing-bubble {
  display: inline-flex;
  gap: 5px;
}

.typing-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #98a2b3;
  animation: typing 1.1s infinite;
}

@keyframes typing {
  0%, 100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.suggested-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 19px 13px;
}

.suggested-questions button {
  padding: 8px 11px;
  border: 1px solid #cfe8d8;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-pale);
}

.image-preview-panel {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 17px 10px;
  padding: 10px;
  border: 1px solid #cfe8d8;
  border-radius: 14px;
  background: var(--green-pale);
}

.image-preview-panel img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
}

.image-preview-info {
  flex: 1;
  min-width: 0;
}

.image-preview-info strong,
.image-preview-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-panel > button {
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 50%;
  background: white;
}

.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 17px 9px;
  border-top: 1px solid var(--border);
}

.chat-input-area textarea {
  min-height: 48px;
  max-height: 130px;
  flex: 1;
  resize: none;
  padding: 12px 14px;
  border: 1px solid #d7dce3;
  border-radius: 14px;
  outline: none;
}

.attach-button,
.send-button {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
}

.attach-button {
  border: 1px solid #d7dce3;
  color: var(--green);
  background: #f7faf8;
}

.send-button {
  border: 0;
  color: white;
  background: var(--green);
}

.message-image {
  display: block;
  max-width: 240px;
  max-height: 210px;
  margin-bottom: 8px;
  border-radius: 12px;
}

.chat-disclaimer {
  padding: 0 18px 13px;
  color: #8a94a4;
  font-size: 11px;
  text-align: center;
}

.features-section {
  padding: 52px 0 80px;
}

.section-heading {
  text-align: center;
  margin-bottom: 30px;
}

.section-heading h2 {
  color: var(--green);
  font-size: 34px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.feature-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow-small);
}

.feature-icon {
  width: 53px;
  height: 53px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 16px;
  color: white;
  background: var(--green);
}

.orange-bg {
  background: var(--orange);
}

.blue-bg {
  background: var(--blue);
}

.light-green-bg {
  background: #6fb64d;
}

.contact-section {
  padding-bottom: 75px;
}

.contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 32px;
  border-radius: 24px;
  color: white;
  background: linear-gradient(130deg, var(--green-dark), var(--green));
}

.zalo-contact-btn {
  color: #0068ff;
  background: white;
}

footer {
  padding: 26px 0;
  border-top: 1px solid var(--border);
  background: white;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 25px;
}

.zalo-floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px 11px 10px;
  border-radius: 999px;
  color: white;
  background: #0068ff;
}

.zalo-circle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0068ff;
  background: white;
  font-size: 11px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.modal-overlay.show {
  display: flex;
}

.login-modal {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 29px;
  border-radius: 23px;
  background: white;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 50%;
}

.login-icon {
  width: 51px;
  height: 51px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 16px 16px 24px 24px;
  color: white;
  background: var(--green);
  font-size: 29px;
}

.login-modal h2 {
  color: var(--green);
}

.login-modal form > label {
  display: block;
  margin: 13px 0 6px;
  font-weight: 750;
}

.login-modal input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #d7dce3;
  border-radius: 12px;
}

.login-submit {
  width: 100%;
}

.register-text {
  margin-top: 15px;
  text-align: center;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-weight: 750;
}

.form-message {
  min-height: 22px;
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
}

.form-message.error {
  color: #dc2626;
}

.form-message.success {
  color: var(--green);
}

.user-name {
  color: var(--green);
  font-weight: 750;
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    position: fixed;
    top: 82px;
    left: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    padding: 13px;
    border-radius: 18px;
    background: white;
  }

  .nav-links.show {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 720px) {
  .container {
    width: calc(100% - 26px);
  }

  .desktop-consult,
  .user-name {
    display: none;
  }

  h1 {
    font-size: 43px;
  }

  .chat-body {
    height: 420px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .contact-box,
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== Header đăng nhập: giữ màu và nằm cùng một dòng ===== */

.navbar {
  gap: 18px;
}

.nav-links {
  gap: 22px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tên người dùng vẫn giữ màu xanh */
.user-name {
  display: inline-flex;
  align-items: center;
  color: var(--green);
  font-weight: 750;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Nút đăng xuất vẫn viền xanh, nền trắng */
#logoutBtn {
  min-width: 116px;
  padding: 12px 20px;
  color: var(--green);
  border: 1px solid #b8c2cc;
  background: var(--white);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Nút bắt đầu tư vấn vẫn giữ màu cam */
.desktop-consult {
  min-width: 180px;
  padding: 13px 22px;
  color: var(--white);
  background: var(--orange);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Giữ hiệu ứng khi rê chuột */
#logoutBtn:hover {
  color: var(--green-dark);
  border-color: var(--green);
  background: var(--green-pale);
}

.desktop-consult:hover {
  color: var(--white);
  background: var(--orange-dark);
}

/* Màn hình vừa: thu gọn để không bị xuống dòng */
@media (max-width: 1250px) and (min-width: 1081px) {
  .container {
    width: min(1260px, calc(100% - 24px));
  }

  .navbar {
    gap: 12px;
  }

  .nav-links {
    gap: 15px;
    font-size: 14px;
  }

  .header-actions {
    gap: 7px;
  }

  .user-name {
    font-size: 14px;
  }

  #logoutBtn {
    min-width: 102px;
    padding: 11px 15px;
  }

  .desktop-consult {
    min-width: 158px;
    padding: 12px 16px;
  }
}



/* ===== FIX CHATBOT TEXT ALIGNMENT ===== */

.message-bubble {
  max-width: min(78%, 510px);
  padding: 16px 18px;
  border-radius: 16px;
  color: #2d3748;
  background: white;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  text-align: left;
  line-height: 1.7;
}

.message-row.assistant .message-bubble {
  text-align: left;
}

.message-bubble p,
.message-bubble div {
  margin: 0;
  text-align: left;
}

.message-bubble time {
  display: block;
  margin-top: 8px;
  color: #8a94a4;
  font-size: 11px;
  text-align: right;
}
/* =========================
   CHAT TOOL BUTTONS
========================= */

.chat-tools {
    display: flex;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
}


.chat-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 15px;

    border-radius: 999px;

    border: 1px solid #d7dce3;

    background: white;

    color: var(--green);

    font-size: 13px;

    font-weight: 700;

    transition: .2s;

}


.chat-tool-btn:hover {

    background: var(--green-soft);

}


.stop-btn {

    color: #dc2626;

    border-color: #fecaca;

}


.hidden {

    display: none !important;

}



/* =========================
   COPY BUTTON AI
========================= */


.copy-btn {

    margin-top: 10px;

    padding: 6px 12px;

    border-radius: 999px;

    border: 1px solid #cfe8d8;

    background: var(--green-pale);

    color: var(--green);

    font-size: 12px;

    font-weight: 700;

    cursor: pointer;

}


.copy-btn:hover {

    background: var(--green-soft);

}



/* =========================
   AI MARKDOWN
========================= */


.ai-content h1,
.ai-content h2,
.ai-content h3 {

    color: var(--green);

    margin: 10px 0;

}


.ai-content ul {

    padding-left: 20px;

}


.ai-content ol {

    padding-left: 20px;

}


.ai-content code {

    padding: 3px 7px;

    border-radius: 6px;

    background: #f2f4f7;

    color: #d63384;

}


.ai-content pre {

    padding: 14px;

    margin-top: 10px;

    overflow-x: auto;

    border-radius: 12px;

    background: #111827;

    color: white;

}



/* =========================
   DARK MODE
========================= */


body.dark-mode {

    --text: #f1f5f9;

    --muted: #cbd5e1;

    --page: #111827;

    --white: #1f2937;

    --border: #374151;

    background: #111827;

    color: #f1f5f9;

}



body.dark-mode .site-header {

    background: rgba(17,24,39,.95);

}


body.dark-mode .chat-card,

body.dark-mode .feature-card,

body.dark-mode .login-modal {

    background:#1f2937;

    color:white;

}


body.dark-mode .chat-body {

    background:#111827;

}


body.dark-mode .message-bubble {

    background:#1f2937;

    color:#f1f5f9;

}


body.dark-mode textarea {

    background:#111827;

    color:white;

}


body.dark-mode .btn-outline {

    background:#1f2937;

    color:white;

}



/* =========================
   THEME BUTTON
========================= */


.theme-btn {

    width:42px;

    height:42px;

    border-radius:50%;

    border:1px solid var(--border);

    background:white;

    cursor:pointer;

    font-size:18px;

}



/* =========================
   MOBILE CHAT
========================= */


@media(max-width:720px){


.chat-tools {

    flex-direction:column;

}


.chat-tool-btn {

    width:100%;

}


.message-bubble {

    max-width:90%;

    font-size:14px;

}


}
.chat-history{

padding:12px;

border-bottom:1px solid #ddd;

}


.history-title{

font-weight:700;

margin-bottom:10px;

}


.history-item{

width:100%;

padding:8px;

margin-bottom:6px;

border-radius:8px;

border:1px solid #ddd;

background:white;

cursor:pointer;

text-align:left;

}


.history-item:hover{

background:#eaf8ef;

}