/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #2563eb;
  --primary-d: #1d4ed8;
  --bg:        #f8fafc;
  --surface:   #ffffff;
  --text:      #1e293b;
  --muted:     #64748b;
  --border:    #e2e8f0;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.logo  { height: 36px; width: auto; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1.1rem; color: var(--text); }

.nav { display: flex; gap: 1.6rem; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .95rem;
  transition: color .2s;
}
.nav a:hover { color: var(--primary); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  color: #fff;
  padding: 100px 0 80px;
  text-align: center;
}
.hero-title { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; margin-bottom: 1rem; }
.hero-sub   { font-size: 1.15rem; opacity: .88; max-width: 600px; margin: 0 auto 2rem; }

.btn {
  display: inline-block; padding: .75rem 2rem; border-radius: 8px;
  font-weight: 600; text-decoration: none; transition: background .2s, transform .1s;
  cursor: pointer; border: none; font-size: 1rem;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: #fff; color: var(--primary); }
.btn-primary:hover { background: #e0e7ff; }

/* ── Section shared ── */
.section-title {
  font-size: 1.75rem; font-weight: 700;
  margin-bottom: 1rem; color: var(--text);
}

/* ── Features ── */
.features { padding: 80px 0; background: var(--bg); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem; margin-top: 2.5rem;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem 1.5rem;
  box-shadow: var(--shadow); transition: transform .2s;
}
.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.feature-card p  { color: var(--muted); font-size: .92rem; }

/* ── About ── */
.about { padding: 80px 0; background: var(--surface); }
.about-inner {
  display: flex; gap: 4rem; align-items: center;
  flex-wrap: wrap;
}
.about-text { flex: 1 1 320px; }
.about-text p { color: var(--muted); margin-bottom: 1rem; }
.about-stats { display: flex; gap: 2rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num   { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .85rem; color: var(--muted); }

/* ── Contact ── */
.contact {
  padding: 80px 0; text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, #dbeafe 100%);
}
.contact p { color: var(--muted); margin-top: .75rem; }

/* ── Footer ── */
.footer {
  background: var(--text); color: #94a3b8;
  padding: 1.25rem 0; text-align: center; font-size: .85rem;
}
.footer-sep { margin: 0 .5rem; }

/* ── Chat FAB ── */
.chat-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 6px 20px rgba(37,99,235,.45);
  transition: transform .2s, background .2s;
}
.chat-fab:hover { background: var(--primary-d); transform: scale(1.08); }
.chat-fab svg { width: 26px; height: 26px; }

.chat-badge {
  position: absolute; top: 2px; right: 2px;
  background: #ef4444; color: #fff;
  font-size: .65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.chat-badge.hidden { display: none; }

/* ── Chat Window ── */
.chat-window {
  position: fixed; bottom: 100px; right: 28px; z-index: 199;
  width: 370px; max-height: 560px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  transition: opacity .25s, transform .25s;
}
.chat-window.hidden { opacity: 0; pointer-events: none; transform: translateY(16px); }

.chat-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--primary); border-radius: var(--radius) var(--radius) 0 0;
  color: #fff;
}
.chat-logo { height: 30px; width: auto; object-fit: contain; border-radius: 6px; }
.chat-header-text { flex: 1; display: flex; flex-direction: column; }
.chat-title  { font-weight: 700; font-size: .95rem; }
.chat-status { font-size: .72rem; opacity: .8; }
.chat-close  {
  background: none; border: none; color: #fff;
  font-size: 1.1rem; cursor: pointer; padding: .2rem .4rem;
  border-radius: 4px; opacity: .8;
}
.chat-close:hover { opacity: 1; background: rgba(255,255,255,.15); }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: .65rem;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.msg {
  max-width: 82%; padding: .6rem .9rem;
  border-radius: 16px; font-size: .9rem; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.msg-bot  {
  background: #f1f5f9; color: var(--text);
  border-bottom-left-radius: 4px; align-self: flex-start;
}
.msg-user {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end;
}
.msg-error { background: #fee2e2; color: #b91c1c; align-self: flex-start; }

.typing-dots { display: flex; gap: 4px; padding: .4rem .2rem; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); animation: blink 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .2; transform: scale(.8); }
  40%           { opacity: 1;  transform: scale(1); }
}

.chat-input-row {
  display: flex; gap: .5rem; padding: .75rem;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1; resize: none; border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem .75rem;
  font-size: .9rem; font-family: inherit;
  max-height: 100px; outline: none;
  transition: border-color .2s;
}
.chat-input:focus { border-color: var(--primary); }
.chat-send {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--primary); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s;
  align-self: flex-end;
}
.chat-send:hover { background: var(--primary-d); }
.chat-send:disabled { background: var(--border); cursor: not-allowed; }
.chat-send svg { width: 18px; height: 18px; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .chat-window { width: calc(100vw - 24px); right: 12px; bottom: 90px; }
  .chat-fab    { right: 16px; bottom: 16px; }
}
