.tfl-ai-card {
  position: relative;
  display: grid;
  container-type: inline-size;
  gap: 1rem;
  min-height: clamp(390px, 54vh, 520px);
  padding: clamp(1.2rem, 2.2vw, 2rem);
  overflow: hidden;
  border: 1px solid rgba(220, 229, 238, 0.92);
  border-radius: 26px;
  background:
    radial-gradient(circle at 88% 8%, rgba(200, 155, 60, 0.2), transparent 8rem),
    linear-gradient(145deg, rgba(231, 241, 248, 0.92), rgba(255, 255, 255, 0.9) 58%, rgba(255, 248, 228, 0.58));
  box-shadow: 0 28px 74px rgba(16, 38, 63, 0.14);
  isolation: isolate;
}

.hero-ai.hero-visual {
  min-height: auto;
}

.tfl-ai-card::before {
  content: "";
  position: absolute;
  inset: auto -6% -18% 44%;
  z-index: -2;
  height: 62%;
  border-radius: 999px;
  background: rgba(95, 134, 169, 0.12);
  transform: rotate(-18deg);
}

.tfl-ai-card::after {
  content: "";
  position: absolute;
  right: 7%;
  top: 12%;
  z-index: -1;
  width: 150px;
  height: 150px;
  opacity: 0.3;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%235f86a9' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M38 88 90 46l52 42'/%3E%3Cpath d='M54 86v54h72V86'/%3E%3Cpath d='M78 140v-32h24v32'/%3E%3Ccircle cx='140' cy='48' r='18' stroke='%23c89b3c'/%3E%3Cpath d='M134 48h12M140 42v12' stroke='%23c89b3c'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  animation: tfl-ai-float 8s ease-in-out infinite;
}

.tfl-ai-orb {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  width: 54px;
  height: 54px;
  border: 5px solid rgba(95, 134, 169, 0.58);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 38, 63, 0.82) 0 21%, rgba(255, 255, 255, 0.88) 22% 45%, transparent 46%);
  box-shadow: 0 0 0 9px rgba(95, 134, 169, 0.08);
  animation: tfl-ai-pulse 2.8s ease-in-out infinite;
}

.tfl-ai-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tfl-ai-badges span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  width: fit-content;
  padding: 0.38rem 0.7rem;
  border: 1px solid rgba(200, 155, 60, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #365675;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tfl-ai-badges i {
  display: inline-block;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #2fae77;
  box-shadow: 0 0 0 0 rgba(47, 174, 119, 0.45);
  animation: tfl-ai-live 1.8s infinite;
}

.tfl-ai-card h2 {
  max-width: 13ch;
  margin: 0;
  color: var(--ink, #10263f);
  font-size: clamp(2.3rem, 4vw, 4.1rem);
  line-height: 0.98;
}

.tfl-ai-sub,
.tfl-ai-note {
  max-width: 560px;
  margin: 0;
  color: var(--ink-soft, #405b78);
  font-size: clamp(0.95rem, 1.08vw, 1.05rem);
  line-height: 1.55;
}

.tfl-ai-sub {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.tfl-ai-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: stretch;
  padding: 0.55rem;
  border: 1px solid rgba(95, 134, 169, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 38px rgba(16, 38, 63, 0.09);
  backdrop-filter: blur(12px);
}

.tfl-ai-form textarea {
  min-height: 76px;
  max-height: 150px;
  padding: 0.9rem 1rem;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--ink, #10263f);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.45;
}

.tfl-ai-form button {
  align-self: stretch;
  min-width: 0;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--navy, #06172b);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

@container (min-width: 540px) {
  .tfl-ai-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .tfl-ai-form button {
    min-width: 118px;
  }
}

.tfl-ai-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(16, 38, 63, 0.18);
}

.tfl-ai-form button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.tfl-ai-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tfl-ai-prompts button,
.tfl-ai-link {
  min-height: 40px;
  padding: 0.62rem 0.86rem;
  border: 1px solid rgba(200, 155, 60, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink, #10263f);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.tfl-ai-prompts button:hover,
.tfl-ai-link:hover {
  border-color: rgba(200, 155, 60, 0.68);
  background: #fff7df;
}

.tfl-ai-status,
.tfl-ai-answer {
  border: 1px solid rgba(220, 229, 238, 0.94);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-soft, #405b78);
  box-shadow: 0 12px 34px rgba(16, 38, 63, 0.08);
}

.tfl-ai-status {
  padding: 0.9rem 1rem;
  font-weight: 800;
}

.tfl-ai-answer {
  max-height: 260px;
  overflow: auto;
  padding: 1rem;
  line-height: 1.58;
}

.tfl-ai-answer p {
  margin: 0 0 0.75rem;
}

.tfl-ai-answer p:last-child {
  margin-bottom: 0;
}

.tfl-ai-link {
  width: fit-content;
}

.tfl-ai-qa-hero {
  background:
    radial-gradient(circle at 86% 22%, rgba(200, 155, 60, 0.16), transparent 14rem),
    linear-gradient(145deg, rgba(231, 241, 248, 0.82), rgba(255, 255, 255, 0.92));
}

@keyframes tfl-ai-float {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-10px) rotate(3deg);
  }
}

@keyframes tfl-ai-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

@keyframes tfl-ai-live {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 174, 119, 0.48);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(47, 174, 119, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(47, 174, 119, 0);
  }
}

@media (max-width: 960px) {
  .tfl-ai-card {
    min-height: auto;
  }
}

@media (min-width: 961px) and (max-height: 820px) {
  .tfl-ai-card {
    min-height: clamp(340px, 48vh, 430px);
    gap: 0.72rem;
    padding: clamp(1rem, 1.75vw, 1.55rem);
  }

  .tfl-ai-card h2 {
    font-size: clamp(2rem, 3vw, 3.35rem);
  }

  .tfl-ai-sub,
  .tfl-ai-note {
    font-size: 0.92rem;
  }

  .tfl-ai-form textarea {
    min-height: 62px;
  }

  .tfl-ai-answer {
    max-height: 180px;
  }
}

@media (min-width: 961px) and (max-height: 700px) {
  .tfl-ai-prompts,
  .tfl-ai-note {
    display: none;
  }

  .tfl-ai-card {
    min-height: 330px;
  }
}

@media (max-width: 640px) {
  .tfl-ai-form {
    grid-template-columns: 1fr;
  }

  .tfl-ai-form button {
    min-height: 48px;
  }

  .tfl-ai-card h2 {
    max-width: 12ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tfl-ai-card::after,
  .tfl-ai-orb,
  .tfl-ai-badges i {
    animation: none;
  }
}

@media (max-width: 960px) {
  .hero-ai.hero-visual,
  .tfl-ai-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tfl-ai-card {
    min-height: auto;
    padding: clamp(1rem, 5vw, 1.35rem);
    border-radius: 22px;
  }

  .tfl-ai-card h2 {
    max-width: 11ch;
    font-size: clamp(2.4rem, 12vw, 3.6rem);
  }

  .tfl-ai-badges span {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 0.67rem;
  }

  .tfl-ai-form textarea {
    min-height: 96px;
  }
}

@media (max-width: 520px) {
  .tfl-ai-card::after {
    right: -1rem;
    top: 5rem;
    width: 110px;
    height: 110px;
    opacity: 0.22;
  }

  .tfl-ai-badges {
    gap: 0.4rem;
  }

  .tfl-ai-badges span {
    border-radius: 16px;
  }

  .tfl-ai-prompts button,
  .tfl-ai-link {
    font-size: 0.82rem;
  }
}
