:root {
  --accent: #7F50FF;
  --accent-dark: #6636e0;
  --accent-light: #f1ebff;
  --accent-2: #00d4ff;
  --gradient: linear-gradient(135deg, #7f50ff 0%, #4f7bff 55%, #00d4ff 100%);
  --error: #e5484d;
  --error-light: #fdeceb;
  --text: #14121f;
  --text-muted: #6b6b78;
  --bg: #ffffff;
  --border: #ececf3;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(31, 15, 82, 0.08);
  --font: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

button {
  font-family: inherit;
}

/* ---------- Landing ---------- */
.landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, var(--accent-light) 0%, #ffffff 55%);
  overflow: hidden;
}

.landing__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(127, 80, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(127, 80, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 30%, black 0%, transparent 70%);
  pointer-events: none;
  animation: gridDrift 16s linear infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 42px 42px, 42px 42px; }
}

.landing__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  animation: float 9s ease-in-out infinite;
}

.landing__blob--1 {
  width: 360px;
  height: 360px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(127, 80, 255, 0.4), transparent 70%);
}

.landing__blob--2 {
  width: 420px;
  height: 420px;
  bottom: -160px;
  right: -140px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.3), transparent 70%);
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

.landing__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.landing__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(127, 80, 255, 0.2);
  font-family: var(--font-mono);
}

.landing__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(127, 80, 255, 0.25);
  animation: blink 1.6s infinite ease-in-out;
}

.landing__title {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.landing__title-accent {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.landing__subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 28px;
}

.landing__features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.landing__feature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.landing__feature-icon {
  font-size: 15px;
}

.landing__cta {
  font-size: 18px;
  padding: 16px 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.landing__cta-arrow {
  transition: transform 0.2s ease;
}

.landing__cta:hover .landing__cta-arrow {
  transform: translateX(4px);
}

.landing__note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- SEO spoiler (нативный <details>/<summary>, без JS) ---------- */
.seo-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 20px auto 0;
  padding: 0 24px;
}

.seo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  color: #b8b8c2;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  opacity: 0.7;
  list-style: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.seo-toggle::-webkit-details-marker {
  display: none;
}

.seo-toggle:hover {
  color: var(--text-muted);
  opacity: 1;
}

.seo-toggle::after {
  content: '⌄';
  display: inline-block;
  transition: transform 0.25s ease;
}

.seo-content[open] .seo-toggle::after {
  transform: rotate(180deg);
}

.seo-content__inner {
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-top: 16px;
  animation: slideUp 0.25s ease;
}

.seo-content__inner h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--text);
}

.seo-content__inner h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text);
}

.seo-content__inner p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.seo-content__inner ul {
  margin: 0 0 12px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seo-content__inner li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.seo-content__inner strong {
  color: var(--text);
}

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

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

.btn--primary {
  position: relative;
  background: var(--gradient);
  background-size: 200% auto;
  background-position: 0% 50%;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(127, 80, 255, 0.4);
  overflow: hidden;
}

.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn--primary:hover:not(:disabled) {
  background-position: 100% 50%;
  box-shadow: 0 10px 28px rgba(127, 80, 255, 0.5);
  transform: translateY(-1px);
}

.btn--primary:hover:not(:disabled)::before {
  transform: translateX(100%);
}

/* ---------- Chat overlay ---------- */
.chat-overlay {
  position: fixed;
  inset: 0;
  height: 100%;
  height: 100dvh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: fadeIn 0.25s ease;
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-header__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.chat-header__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-light); }
  50% { box-shadow: 0 0 0 7px var(--accent-light); }
}

.chat-header__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent-dark);
  text-transform: uppercase;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.chat-body__inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius);
  line-height: 1.5;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  animation: slideUp 0.2s ease;
}

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

.msg--bot {
  align-self: flex-start;
  background: #f5f3fb;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.msg--error {
  align-self: center;
  background: var(--error-light);
  color: var(--error);
  font-size: 13px;
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: #f5f3fb;
  border-bottom-left-radius: 4px;
}

.typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
  animation: blink 1.2s infinite ease-in-out;
}

.typing__dot:nth-child(2) { animation-delay: 0.15s; }
.typing__dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* ---------- Options card (инлайн-выбор типа помощи) ---------- */
.options-card {
  align-self: flex-start;
  max-width: 90%;
  width: 100%;
  background: #ffffff;
  border: 1.5px solid rgba(127, 80, 255, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(127, 80, 255, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slideUp 0.25s ease;
}

.options-card__title {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.35;
  color: var(--text);
}

.options-card__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.options-card__btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(127, 80, 255, 0.25);
  background: #f8f6ff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.options-card__btn:hover:not(:disabled) {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(127, 80, 255, 0.25);
}

.options-card__btn:active:not(:disabled) {
  transform: translateY(0);
}

.options-card__btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.options-card__btn--selected {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
  opacity: 1 !important;
  font-weight: 600;
}

.options-card__btn--other {
  border-style: dashed;
}

/* ---------- Email card (CTA-плашка) ---------- */
.email-card {
  align-self: flex-start;
  max-width: 90%;
  width: 100%;
  background: linear-gradient(155deg, #f6f1ff 0%, #ffffff 55%);
  border: 1.5px solid rgba(127, 80, 255, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(127, 80, 255, 0.18);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.25s ease;
}

.email-card__badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #16a34a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.email-card__badge-icon {
  flex-shrink: 0;
}

.email-card__title {
  font-weight: 800;
  font-size: 19px;
  line-height: 1.35;
  margin: 4px 0 0;
  color: var(--text);
}

.email-card__link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.email-card__link:hover {
  color: var(--accent-hover);
}

.email-card__benefits-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}

.email-card__benefits-heading {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  margin: 0;
}

.email-card__benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.email-card__benefit-item {
  background: #ffffff;
  border: 1px solid rgba(127, 80, 255, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(127, 80, 255, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.email-card__benefit-item:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 80, 255, 0.4);
  box-shadow: 0 6px 18px rgba(127, 80, 255, 0.12);
}

.email-card__benefit-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(127, 80, 255, 0.12) 0%, rgba(127, 80, 255, 0.04) 100%);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.email-card__benefit-text {
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text);
}

.email-card__subtitle {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin: 4px 0 2px;
}

.email-card__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.email-card__input {
  flex: 1;
  min-width: 200px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(127, 80, 255, 0.45);
  font-size: 15px;
  outline: none;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(127, 80, 255, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.email-card__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.email-card__input--invalid {
  border-color: var(--error);
}

.email-card__submit {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.email-card__submit-arrow {
  transition: transform 0.2s ease;
}

.email-card__submit:hover:not(:disabled) .email-card__submit-arrow {
  transform: translateX(4px);
}

.email-card__error {
  font-size: 13px;
  color: var(--error);
  margin: 0;
}

/* ---------- Chat footer / input ---------- */
.chat-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-footer__inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f7f7;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chat-footer__inner:focus-within {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-light);
}

.chat-footer__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 11px 0;
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  outline: none;
  resize: none;
  font-family: inherit;
  min-height: 22px;
  max-height: 120px;
  overflow-y: auto;
  display: block;
}

.chat-footer__input::placeholder {
  color: #a3a3a3;
}

.chat-footer__send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  background-size: 200% auto;
  background-position: 0% 50%;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(127, 80, 255, 0.4);
  transition: background-position 0.3s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-footer__send:hover:not(:disabled) {
  background-position: 100% 50%;
  box-shadow: 0 6px 18px rgba(127, 80, 255, 0.5);
  transform: scale(1.05);
}

.chat-footer__send:disabled {
  background: #d8d8d8;
  box-shadow: none;
  cursor: not-allowed;
}

.chat-footer__send-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transform: translateX(-1px);
}

.chat-footer__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 560px) {
  .chat-header, .chat-body, .chat-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .email-card__row {
    flex-direction: column;
  }

  .email-card__submit {
    width: 100%;
  }

  .seo-content {
    padding: 0 8px;
  }

  .seo-content__inner {
    padding: 20px;
  }
}

/* ---------- Redirect loader ---------- */
.redirect-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #ffffff;
  animation: fadeIn 0.2s ease;
}

.redirect-loader__spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid var(--accent-light);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.redirect-loader__text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

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