/* ==========================================================
   Zelfron AI Tool Finder page
   ========================================================== */
.tf {
  position: relative;
  min-height: 100vh;
  padding: 120px var(--gutter) 40px;
  overflow: hidden;
}
.tf__glow {
  position: absolute; inset: -20% -10% auto; height: 720px; pointer-events: none;
  background:
    radial-gradient(40% 50% at 30% 30%, rgba(41,151,255,.22), transparent 70%),
    radial-gradient(35% 45% at 70% 25%, rgba(168,85,247,.22), transparent 70%),
    radial-gradient(30% 40% at 55% 55%, rgba(255,61,139,.14), transparent 70%);
  filter: blur(20px);
}
.tf__intro, .tf__chat, .tf__cta { position: relative; max-width: 760px; margin: 0 auto; }
.tf__intro { text-align: center; margin-bottom: 36px; transition: opacity .4s, margin .4s; }
.tf__badge {
  display: inline-block; margin-left: 8px; padding: 3px 10px; border-radius: 99px; vertical-align: 3px;
  font-size: 12px; font-weight: 600; color: #fff; letter-spacing: .02em;
  background: linear-gradient(90deg, #2997ff, #a855f7);
}
.tf__title { margin: 0 0 16px; font-size: clamp(38px, 6.4vw, 64px); line-height: 1.06; font-weight: 700; letter-spacing: -.035em; }
.tf__sub { margin: 0 auto; max-width: 600px; color: #a1a1a6; font-size: clamp(17px, 2vw, 20px); }

/* Once a chat starts, shrink the intro so the conversation has room */
.tf.is-chatting .tf__intro { margin-bottom: 20px; }
.tf.is-chatting .tf__title { font-size: clamp(26px, 4vw, 34px); }
.tf.is-chatting .tf__sub { display: none; }

/* ---------- Chat ---------- */
.tf__chat {
  background: rgba(20,20,22,.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.tf__log { display: flex; flex-direction: column; gap: 14px; }
.tf__log:empty { display: none; }
.tf.is-chatting .tf__log { padding: 6px 4px 18px; max-height: min(62vh, 640px); overflow-y: auto; overscroll-behavior: contain; }

.tf__msg { max-width: 88%; padding: 12px 16px; border-radius: 20px; font-size: 16px; line-height: 1.5; word-wrap: break-word; animation: tfIn .35s var(--ease) both; }
.tf__msg p { margin: 0 0 8px; }
.tf__msg p:last-child, .tf__msg ul:last-child { margin-bottom: 0; }
.tf__msg ul { margin: 0 0 8px; padding-left: 20px; }
.tf__msg li { margin: 4px 0; }
.tf__msg strong { color: #fff; font-weight: 600; }
.tf__msg a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.tf__msg--user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.tf__msg--bot { align-self: flex-start; background: var(--card-2); color: #e8e8ed; border-bottom-left-radius: 6px; }
.tf__msg--error { align-self: flex-start; background: rgba(255,61,139,.12); color: #ffb3cf; border: 1px solid rgba(255,61,139,.3); }
.tf__msg a.tf__book { display: inline-block; margin-top: 10px; color: #fff; text-decoration: none; }

.tf__typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.tf__typing span { width: 7px; height: 7px; border-radius: 50%; background: #86868b; animation: tfDot 1.2s infinite ease-in-out; }
.tf__typing span:nth-child(2) { animation-delay: .15s; }
.tf__typing span:nth-child(3) { animation-delay: .3s; }

@keyframes tfIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tfDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ---------- Chips (starters + suggested answers) ---------- */
.tf__starters, .tf__options { display: flex; flex-wrap: wrap; gap: 8px; }
.tf__starters { margin-bottom: 14px; }
.tf__starters[hidden] { display: none; }
.tf__options { align-self: flex-start; max-width: 100%; animation: tfIn .35s var(--ease) both; }
.tf__chip {
  padding: 9px 15px; border-radius: 99px; cursor: pointer;
  font: inherit; font-size: 14px; color: #e8e8ed;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  transition: background .2s, border-color .2s, transform .15s;
}
.tf__chip:hover { background: rgba(41,151,255,.16); border-color: rgba(41,151,255,.6); }
.tf__chip:active { transform: scale(.97); }
.tf__chip:disabled { opacity: .4; cursor: default; }

/* ---------- Composer ---------- */
.tf__form {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 8px 8px 8px 18px; border-radius: 26px;
  background: #0b0b0d; border: 1px solid rgba(255,255,255,.14);
  transition: border-color .2s, box-shadow .2s;
}
.tf__form:focus-within { border-color: rgba(41,151,255,.7); box-shadow: 0 0 0 4px rgba(41,151,255,.15); }
.tf__form textarea {
  flex: 1; min-height: 24px; max-height: 160px; padding: 8px 0; resize: none;
  background: none; border: 0; outline: none; color: var(--text);
  font: inherit; font-size: 16px; line-height: 1.5;
}
.tf__form textarea::placeholder { color: #6e6e73; }
.tf__send {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #2997ff, #a855f7);
  transition: opacity .2s, transform .15s;
}
.tf__send:active { transform: scale(.94); }
.tf__send:disabled { opacity: .35; cursor: default; }

.tf__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 12px; padding: 0 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.tf__reset { flex-shrink: 0; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--blue); }
.tf__reset:hover { text-decoration: underline; }

/* ---------- Bottom CTA ---------- */
.tf__cta { text-align: center; padding: 80px 0 40px; }
.tf__cta h2 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; }
.tf__cta p { margin: 0 0 22px; }

@media (max-width: 600px) {
  .tf { padding-top: 96px; }
  .tf__chat { padding: 12px; border-radius: 22px; }
  .tf__msg { max-width: 94%; font-size: 15px; }
  .tf__meta { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tf__msg, .tf__options { animation: none; }
  .tf__typing span { animation: none; opacity: .6; }
}

/* ---------- Optional quick picks ---------- */
.tf__prefs { display: grid; gap: 8px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.tf__prefs[hidden] { display: none; }
.tf__pref { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tf__pref > span { width: 92px; font-size: 13px; color: var(--muted); }
.tf__seg {
  padding: 6px 12px; border-radius: 99px; cursor: pointer;
  font: inherit; font-size: 13px; color: #d2d2d7;
  background: transparent; border: 1px solid rgba(255,255,255,.16);
  transition: background .2s, border-color .2s, color .2s;
}
.tf__seg:hover { border-color: rgba(41,151,255,.6); }
.tf__seg.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.tf__meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.tf__meta strong { color: #d2d2d7; font-weight: 600; }
@media (max-width: 600px) { .tf__pref > span { width: 100%; } }
.tf__msg--user { white-space: pre-wrap; }

/* Newsletter block under the chat */
.tf__nl { position: relative; max-width: 760px; margin: 80px auto 0; text-align: center; }
.tf__nl h2 { margin: 0 0 8px; font-size: clamp(26px, 3.6vw, 34px); letter-spacing: -.03em; }
.tf__nl > p { margin: 0 0 22px; }
.tf__cta { padding-top: 60px; }

/* Cross-sell after recommendations */
.tf__upsell {
  align-self: flex-start; max-width: 88%; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 18px; text-decoration: none; color: #e8e8ed;
  background: linear-gradient(135deg, rgba(41,151,255,.16), rgba(168,85,247,.18));
  border: 1px solid rgba(168,85,247,.4); animation: tfIn .35s var(--ease) both;
  transition: border-color .2s, transform .15s;
}
.tf__upsell:hover { border-color: rgba(168,85,247,.8); transform: translateY(-1px); }
.tf__upsell-tag { flex-shrink: 0; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(90deg, #2997ff, #a855f7); }
.tf__upsell-text { font-size: 14px; line-height: 1.4; }
.tf__upsell-text strong { color: #fff; }
.tf__upsell-price { flex-shrink: 0; font-weight: 700; color: #fff; }
@media (max-width: 600px) { .tf__upsell { max-width: 100%; flex-wrap: wrap; } }
