:root {
  --red: #d71920;
  --red-dark: #b70f16;
  --red-soft: #fff0f1;
  --ink: #111827;
  --navy: #071b3a;
  --muted: #6b7280;
  --line: #e7e9ee;
  --paper: #ffffff;
  --soft: #f6f7f9;
  --shadow: 0 22px 70px rgba(7, 27, 58, .13);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background: #eef1f5;
}

body { min-height: 100vh; }

button, textarea { font: inherit; }

button { cursor: pointer; }

.site {
  min-height: 100vh;
  max-width: 1180px;
  margin: auto;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.topbar {
  height: 70px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark { width: 43px; height: 43px; display: block; }
.brand-mark svg { width: 100%; height: 100%; }

.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: .95rem; letter-spacing: -.02em; }
.brand-text small { margin-top: 2px; color: var(--muted); font-size: .68rem; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #596273;
  font-size: .72rem;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28a745;
  box-shadow: 0 0 0 4px #e8f7ec;
}

.hero {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(90deg, rgba(5,20,45,.93) 0%, rgba(5,20,45,.72) 45%, rgba(5,20,45,.2) 100%),
    url("https://images.unsplash.com/photo-1436491865332-7a61a109cc05?auto=format&fit=crop&w=1800&q=85") center/cover;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
  padding: 48px 22px 42px;
}

.hero-kicker {
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 4px;
  font-size: .65rem;
  letter-spacing: .15em;
  font-weight: 800;
}

.hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero h1 em {
  color: #ff5a60;
  font-style: normal;
}

.hero p {
  max-width: 520px;
  margin: 0;
  color: rgba(255,255,255,.78);
  line-height: 1.55;
  font-size: .9rem;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.hero-pills span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.16);
  font-size: .7rem;
  backdrop-filter: blur(8px);
}

.hero-plane {
  position: absolute;
  right: 7%;
  bottom: 13%;
  z-index: 1;
  font-size: clamp(5rem, 17vw, 10rem);
  opacity: .12;
  transform: rotate(-18deg);
}

.main {
  padding: 22px 16px 28px;
  background: #fff;
}

.assistant-intro {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 17px;
}

.assistant-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.assistant-avatar svg { width: 100%; height: 100%; }

.assistant-label {
  margin: 1px 0 4px;
  color: var(--red);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.assistant-intro h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -.03em;
}

.assistant-copy {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.quick-card {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr 16px;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.quick-card:hover,
.quick-card:focus-visible {
  transform: translateY(-2px);
  border-color: #f1a0a4;
  box-shadow: 0 8px 24px rgba(215,25,32,.09);
  outline: none;
}

.quick-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 1.1rem;
}

.quick-card strong, .quick-card small {
  display: block;
}

.quick-card strong {
  font-size: .78rem;
  margin-bottom: 3px;
}

.quick-card small {
  color: var(--muted);
  font-size: .68rem;
}

.quick-card b {
  color: #a4a9b2;
  font-size: 1.25rem;
}

.chat-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 35px rgba(15,23,42,.06);
}

.chat-title {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.live-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #239447;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.live-line i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #27ae60;
}

.chat-title h3 {
  margin: 4px 0 0;
  font-size: .95rem;
}

.secure {
  color: #9aa1ad;
  font-size: .61rem;
}

.messages {
  height: 360px;
  overflow-y: auto;
  padding: 8px 13px 14px;
  background: #fbfbfc;
}

.message-row {
  display: flex;
  margin: 12px 0;
}

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

.message {
  max-width: 87%;
  padding: 10px 12px;
  border-radius: 13px;
  font-size: .78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.user {
  color: #fff;
  background: var(--red);
  border-bottom-right-radius: 3px;
}

.message.assistant {
  color: #252b35;
  background: #f1f3f6;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 3px;
}

.message.error {
  color: #8e151b;
  background: #fff1f2;
  border-color: #f4b4b8;
}

.typing {
  display: inline-flex;
  align-items: center;
  color: #858d9a !important;
  font-style: italic;
}

.typing::after {
  content: "";
  width: 18px;
  height: 5px;
  margin-left: 7px;
  background: radial-gradient(circle, #858d9a 1.5px, transparent 2px) 0 50% / 6px 6px repeat-x;
  animation: dots 1s infinite linear;
}

@keyframes dots { to { transform: translateX(6px); } }

.composer {
  display: flex;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid var(--line);
  background: #fff;
}

#message-input {
  flex: 1;
  min-width: 0;
  resize: none;
  max-height: 120px;
  padding: 11px 12px;
  border: 1px solid #dfe2e7;
  border-radius: 10px;
  background: #f8f9fa;
  color: var(--ink);
  outline: none;
  font-size: .8rem;
}

#message-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215,25,32,.08);
}

.send-btn {
  min-width: 78px;
  border: 0;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
  transition: background .18s ease, transform .18s ease;
}

.send-btn:hover:not(:disabled),
.send-btn:focus-visible:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-1px);
  outline: none;
}

.send-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.send-icon { margin-left: 5px; }

.hint {
  margin: -5px 12px 10px;
  color: #a0a6af;
  font-size: .58rem;
  text-align: right;
}

.footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 14px 16px;
  color: #7d8490;
  background: #f7f8fa;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .62rem;
  line-height: 1.45;
}

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

@media (min-width: 620px) {
  .topbar { padding: 0 28px; }
  .hero-content { padding: 58px 40px; }
  .main { padding: 30px 30px 38px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .messages { height: 400px; }
}

@media (min-width: 900px) {
  body { padding: 25px; }
  .site { border-radius: 18px; overflow: hidden; }
  .hero { min-height: 330px; }
  .hero-content { padding: 72px 58px; }
  .main { padding: 34px 50px 45px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-card { grid-template-columns: 34px 1fr; }
  .quick-card .quick-icon { width: 34px; height: 34px; font-size: .95rem; }
  .quick-card b { display: none; }
  .messages { height: 420px; }
}


/* ---------- MOTION LAYER ---------- */

@media (prefers-reduced-motion: no-preference) {
  .site {
    animation: siteReveal .65s cubic-bezier(.2,.75,.25,1) both;
  }

  .topbar {
    animation: headerDrop .7s .08s cubic-bezier(.2,.75,.25,1) both;
  }

  .hero-content {
    animation: heroIn .9s .18s cubic-bezier(.2,.75,.25,1) both;
  }

  .hero-plane {
    animation: planeFloat 5s ease-in-out infinite;
  }

  .hero::after {
    content: "";
    position: absolute;
    inset: -20%;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
      110deg,
      transparent 38%,
      rgba(255,255,255,.10) 47%,
      transparent 56%
    );
    transform: translateX(-70%);
    animation: lightSweep 7s 1.2s ease-in-out infinite;
  }

  .assistant-intro {
    animation: fadeUp .7s .35s both;
  }

  .quick-card {
    opacity: 0;
    animation: cardIn .55s cubic-bezier(.2,.75,.25,1) forwards;
  }

  .quick-card:nth-child(1) { animation-delay: .42s; }
  .quick-card:nth-child(2) { animation-delay: .50s; }
  .quick-card:nth-child(3) { animation-delay: .58s; }
  .quick-card:nth-child(4) { animation-delay: .66s; }

  .quick-icon {
    transition: transform .25s ease, background .25s ease;
  }

  .quick-card:hover .quick-icon {
    transform: rotate(-8deg) scale(1.08);
    background: #ffe2e4;
  }

  .chat-panel {
    animation: panelIn .7s .72s both;
  }

  .send-btn {
    position: relative;
    overflow: hidden;
  }

  .send-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      115deg,
      transparent 25%,
      rgba(255,255,255,.25) 45%,
      transparent 65%
    );
    transform: translateX(-130%);
    transition: transform .55s ease;
  }

  .send-btn:hover::before {
    transform: translateX(130%);
  }

  .send-icon {
    display: inline-block;
    transition: transform .25s ease;
  }

  .send-btn:hover .send-icon {
    transform: translateX(3px) translateY(-2px);
  }

  .message-row {
    animation: messageIn .35s cubic-bezier(.2,.75,.25,1) both;
  }

  .message.user {
    animation-name: messageUserIn;
  }

  .message.assistant {
    animation-name: messageAssistantIn;
  }

  .typing {
    animation: typingPulse 1.3s ease-in-out infinite;
  }

  .live-line i {
    animation: livePulse 1.7s ease-out infinite;
  }

  .status-dot {
    animation: statusPulse 2s ease-in-out infinite;
  }
}

@keyframes siteReveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes headerDrop {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(7px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes messageUserIn {
  from { opacity: 0; transform: translateX(10px) scale(.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes messageAssistantIn {
  from { opacity: 0; transform: translateX(-10px) scale(.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes planeFloat {
  0%, 100% { transform: translateY(0) rotate(-18deg); }
  50% { transform: translateY(-12px) rotate(-14deg); }
}

@keyframes lightSweep {
  0%, 55%, 100% { transform: translateX(-70%) rotate(0deg); }
  75% { transform: translateX(70%) rotate(0deg); }
}

@keyframes typingPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(39,174,96,.45); }
  70% { box-shadow: 0 0 0 7px rgba(39,174,96,0); }
  100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 4px #e8f7ec; }
  50% { box-shadow: 0 0 0 7px rgba(40,167,69,.08); }
}

/* Small interaction feedback */
.quick-card:active {
  transform: translateY(0) scale(.985);
}

.send-btn:active:not(:disabled) {
  transform: scale(.97);
}

#message-input {
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

#message-input:focus {
  background: #fff;
}

.send-btn.is-loading .send-icon {
  animation: sendSpin .75s linear infinite;
}

@keyframes sendSpin {
  to { transform: rotate(360deg); }
}
