@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Figtree:wght@400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  --bg:           #FFFFFF;
  --surface:      #E6F0FA;
  --primary:      #1863DC;
  --primary-dark: #0A5888;
  --border:       #9DBCCF;
  --text:         #0A5888;
  --text-muted:   #606266;
  --radius:       8px;
  --shadow:       0 2px 12px rgba(10, 88, 136, 0.10);
  --shadow-lg:    0 8px 32px rgba(10, 88, 136, 0.16);
  --font-body:    'Lato', Arial, sans-serif;
  --font-heading: Georgia, serif;
  --font-ui:      'Figtree', Arial, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(10, 88, 136, 0.07);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.01em;
}

.nav-byline {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.nav-cta {
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 9px 20px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}
.nav-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg) 60%);
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 24px 80px;
}

.hero__content {
  max-width: 660px;
}

.hero__label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
  background: rgba(24, 99, 220, 0.08);
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(24, 99, 220, 0.2);
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero__sub {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 14px 32px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(24, 99, 220, 0.30);
  letter-spacing: 0.01em;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(24, 99, 220, 0.40);
}
.btn-primary:active { transform: translateY(0); }

/* ── Services ───────────────────────────────────────────────────────────────── */
.services {
  padding: 72px 24px 80px;
  background: var(--bg);
}

.services__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.services__title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 28px);
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 44px;
  letter-spacing: -0.01em;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
}
.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(24, 99, 220, 0.35);
}

.service-card__icon {
  width: 48px;
  height: 48px;
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary);
}
.service-card__icon svg {
  width: 22px;
  height: 22px;
}

.service-card h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.service-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── CTA band ───────────────────────────────────────────────────────────────── */
.cta-band {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 24px;
}

.cta-band__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cta-band__text {
  font-size: 18px;
  color: var(--text);
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 11px 28px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--bg);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 24px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
  font-family: var(--font-ui);
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--primary); }

/* ══════════════════════════════════════════════════════════════════════════════
   CHAT WIDGET
══════════════════════════════════════════════════════════════════════════════ */

#chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(24, 99, 220, 0.40);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: hidden;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  animation: pulse-fab 2.5s ease-in-out 1s 3;
}
#chat-fab:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(24, 99, 220, 0.55);
}
#chat-fab:active { transform: scale(0.93); }
#chat-fab svg { width: 26px; height: 26px; position: relative; z-index: 1; }

.fab-ripple {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: fab-ripple 0.55s ease-out forwards;
  pointer-events: none;
}
@keyframes fab-ripple {
  to { transform: scale(3.2); opacity: 0; }
}

@keyframes pulse-fab {
  0%   { box-shadow: 0 4px 16px rgba(24, 99, 220, 0.40); }
  50%  { box-shadow: 0 4px 28px rgba(24, 99, 220, 0.70), 0 0 0 10px rgba(24, 99, 220, 0.10); }
  100% { box-shadow: 0 4px 16px rgba(24, 99, 220, 0.40); }
}

#chat-panel {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 380px;
  height: 540px;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
  transform: scale(0.6) translateY(60px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.22s ease;
  border: 1px solid var(--border);
}
#chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

#chat-header {
  background: var(--primary-dark);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#chat-title {
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
}

#reset-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  transition: background 0.2s;
}
#reset-btn:hover { background: rgba(255, 255, 255, 0.22); }
#reset-btn svg { width: 14px; height: 14px; }

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  scroll-behavior: smooth;
}

.chat-welcome {
  background: var(--surface);
  border-radius: 12px 12px 12px 4px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  max-width: 90%;
  box-shadow: var(--shadow);
  animation: welcome-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
  border: 1px solid var(--border);
}

@keyframes welcome-in {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip {
  background: var(--bg);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: background 0.15s, color 0.15s;
  line-height: 1.3;
}
.chip:hover {
  background: var(--primary);
  color: var(--bg);
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  animation: msg-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes msg-pop {
  from { transform: scale(0.82) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0);        opacity: 1; }
}
.msg--user {
  background: var(--primary);
  color: var(--bg);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  font-weight: 500;
}
.msg--assistant {
  background: var(--surface);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.msg--error {
  background: #fff0f0;
  color: #c0392b;
  border: 1px solid #f5c6cb;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg--assistant strong { font-weight: bold; color: var(--primary-dark); }
.msg--assistant em { font-style: italic; }
.msg--assistant ul { padding-left: 18px; margin: 6px 0; }
.msg--assistant li { margin: 2px 0; }
.msg--assistant a { color: var(--primary); }
.msg--assistant p + p { margin-top: 6px; }

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  animation: bounce 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); background: var(--border); }
  30%            { transform: translateY(-6px); background: var(--primary); }
}

#chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}
#chat-input:focus { border-color: var(--primary); }
#chat-input::placeholder { color: var(--text-muted); }

#send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
#send-btn:hover { background: var(--primary-dark); }
#send-btn:disabled { background: var(--border); cursor: default; }
#send-btn svg { width: 18px; height: 18px; }

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .cta-band__inner {
    flex-direction: column;
    text-align: center;
  }
  #chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    border-radius: 20px 20px 0 0;
    transform-origin: bottom center;
  }
  #chat-fab {
    bottom: 20px;
    right: 20px;
  }
}
