:root {
  --bg: #f3f8f3;
  --bg-soft: #e7f2e6;
  --ink: #13221a;
  --muted: #516557;
  --accent: #3d7a4b;
  --accent-dark: #285334;
  --card: #ffffff;
  --line: #cfe0d2;
  --shadow: 0 16px 42px rgba(17, 34, 25, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  background: radial-gradient(circle at 20% 0%, #f9fff7, #eef6ee 55%, #e8f1e6);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(240, 249, 240, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand-title {
  margin: 0;
  font-family: "Prata", serif;
  font-size: 1.1rem;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero {
  padding: 72px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 28px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1 {
  margin: 10px 0 14px;
  font-family: "Prata", serif;
  font-size: clamp(2rem, 5vw, 3rem);
}

.lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.05rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-accent {
  color: #fff;
  background: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-ghost {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
}

.phone-preview {
  background: #d7ebd2;
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.bubble {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.status {
  padding: 8px 0 44px;
}

ul {
  margin: 0;
  padding-left: 20px;
}

li {
  margin-bottom: 8px;
}

.chat-section {
  padding: 0 0 60px;
}

.chat-note {
  margin-top: 0;
  color: var(--muted);
}

.chat-intro {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(46, 113, 77, 0.18);
  border-radius: 16px;
  background: rgba(233, 255, 244, 0.55);
}

.chat-avatar {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(46, 113, 77, 0.22);
  box-shadow: 0 14px 28px rgba(17, 34, 25, 0.12);
}

.chat-intro-text p {
  margin: 0 0 10px;
  color: rgba(19, 34, 26, 0.92);
  line-height: 1.35;
}

.chat-intro-text p:last-child {
  margin-bottom: 0;
}

.chat-intro-title {
  font-weight: 700;
}

.chat-intro-text br {
  display: none;
}

.chat-window {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  background-color: #f6fbf5;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(233, 255, 244, 0.85), rgba(246, 251, 245, 0) 45%),
    radial-gradient(circle at 80% 0%, rgba(223, 240, 218, 0.75), rgba(246, 251, 245, 0) 40%),
    url("/static/chat-bg.svg");
  background-size: auto, auto, 360px 360px;
  background-position: left top, right top, center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.chat-msg {
  display: inline-block;
  max-width: 80%;
  border-radius: 14px;
  padding: 9px 12px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.chat-msg.user {
  margin-left: auto;
  display: block;
  background: #dff0da;
}

.chat-msg.assistant {
  background: #fff;
  border: 1px solid var(--line);
}

.chat-form {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  scroll-margin-bottom: 24px;
}

.chat-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.chat-input-wrap.pulse input {
  border-color: rgba(61, 122, 75, 0.55);
  box-shadow: 0 0 0 4px rgba(61, 122, 75, 0.12);
}

.chat-input-wrap.pulse .emoji-btn {
  border-color: rgba(61, 122, 75, 0.4);
}

.chat-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.chat-form input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px 44px 12px 12px;
  font: inherit;
}

.emoji-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(61, 122, 75, 0.18);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Manrope", system-ui, sans-serif;
}

.emoji-glyph {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.emoji-btn:hover {
  border-color: rgba(61, 122, 75, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

.emoji-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.emoji-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(320px, 84vw);
  max-height: 260px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(46, 113, 77, 0.22);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 55px rgba(17, 34, 25, 0.22);
  backdrop-filter: blur(8px);
  z-index: 50;
}

.emoji-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(46, 113, 77, 0.16);
  color: rgba(19, 34, 26, 0.92);
  font-weight: 700;
}

.emoji-close {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(61, 122, 75, 0.18);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 10px 12px 12px;
  max-height: 210px;
  overflow: auto;
}

.emoji-grid button {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.emoji-grid button:hover {
  background: rgba(223, 240, 218, 0.7);
  border-color: rgba(61, 122, 75, 0.18);
}

.modal[hidden],
.toast[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 12, 0.55);
}

.modal-card {
  position: relative;
  width: min(560px, 92vw);
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-counter {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal-question {
  display: block;
  margin: 10px 0;
  font-weight: 600;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}

.modal-body textarea {
  min-height: 120px;
  resize: vertical;
}

.recaptcha-wrap {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.option-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.option-line input {
  width: auto;
}

.modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.toast {
  padding: 0 0 60px;
}

@media (max-width: 740px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-intro {
    grid-template-columns: 72px 1fr;
    border-radius: 14px;
    padding: 12px;
  }

  .chat-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .chat-intro-text br {
    display: inline;
  }

  .chat-form {
    flex-direction: column;
  }

  .chat-window {
    max-height: 240px;
  }

  .emoji-grid {
    grid-template-columns: repeat(9, 1fr);
  }
}
