/* Salesforge rebuild: Agent Frank page, block 4 "Why Work With Agent Frank" (.afp) and
   block 6 "What's It Like Working With Agent Frank" (.afs, the seven steps and the demo form).
   New code written for this rebuild. Design values (colours, sizes, timings, breakpoints) follow salesforge.ai.
   Uses site.css (tokens, .wrap, .container), home.css (.h3, .brand) and solutions.css (.tag). */

.afs {
  --afs-field: #7c51de;          /* form fields on the purple card */
  --afs-field-line: #b692f6;
  --afs-field-hover: #e9d7fe;
  --afs-placeholder: #d6bbfb;
  --afs-button-hover: #6941c6;
  --afs-button-tap: #7f56d9;     /* phone hover of the white button, as on the live page */
  --afs-card-bottom: #faf8ff;
  --afs-out-sine: cubic-bezier(.39, .575, .565, 1);
}

/* small heading used by both blocks: 24 px, 21.6 px below 992 px, 17.6 px below 768 px;
   --big goes back to 24 px on phones */
.afs-h5 { font-size: 24px; line-height: 1.3; font-weight: 600; color: var(--ink); }

/* ================================================================ block 4: Why Work With Agent Frank */
.afp { display: flex; flex-direction: column; gap: 56px; padding: 100px 0; }
.afp__head {
  position: relative; z-index: 1; max-width: 960px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.afp__title { margin-top: 12px; }
.afp__intro { margin-top: 20px; font-size: 20px; line-height: 1.4; }
.afp__small { font-size: 15px; line-height: 1.4; }

/* three light cards, each with a faint square grid at the top */
.afp__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.afp-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 36px 32px 48px; border-radius: 12px; background: var(--gray-50);
}
.afp-card__squares { position: absolute; top: 0; left: 0; width: 100%; height: auto; }
.afp-card__img { position: relative; z-index: 1; width: 100%; }
.afp-card__text {
  flex: 1 1 0%; display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
  gap: 12px; text-align: center;
}
.afp-card__text.afp-card__text--center { justify-content: center; align-items: center; }

/* two wide cards with the picture on the right; each tucks 44 px under the row above, so every gap reads 12 px */
.afp-wide {
  position: relative; margin-top: -44px; padding: 100px 50% 100px 5%; border-radius: 12px;
  background: var(--gray-50) url("../img/af-illu-scale.avif") 100% 50% / contain no-repeat;
}
.afp-wide--intel {
  display: flex; justify-content: flex-start; align-items: center; height: 480px; padding-right: 60%;
  background-image: url("../img/af-intelligence-illu.avif");
}
.afp-wide__text {
  flex: 1 1 0%; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 12px;
}
.afp-wide__title { margin-bottom: 8px; }

/* ================================================================ block 6: the seven steps */
.afs { position: relative; z-index: 2; padding: 100px 0; }
.afs__grid { display: grid; grid-template-columns: .5fr 1fr; column-gap: 10%; align-items: start; }

/* left column: stays near the top of the window while the steps scroll. Frank's value is 120 px under a header
   43.6 px taller than ours (his has the announcement bar); 76 px keeps the same distance below our header.
   At 767 px and below both headers are 65 px, so his 120 px (24 px on phones) is kept there. */
.afs__left { position: sticky; top: 76px; }
.afs__head { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 32px; }
.afs__head-top { display: flex; flex-direction: column; align-items: flex-start; }
.afs__tag { background: var(--violet-50); }
.afs__title { margin-top: 12px; }
.afs__intro { font-size: 18px; line-height: 1.4; }

/* right column: a thin rail, then one row per step; every row sticks at 120 px and the next slides over it */
.afs__steps { position: relative; display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.afs__steps::before {
  content: ""; position: absolute; top: 0; left: 22px; width: 4px; height: 100%;
  border: 1px solid var(--gray-200); background: var(--white);
}
.afs-step { position: sticky; top: 76px; display: flex; gap: 16px; padding-bottom: 40px; }
.afs-step--last { background: var(--white); }
.afs-step__num {
  position: sticky; top: 32px; flex: none; display: flex; justify-content: center; align-items: center;
  width: 48px; height: 48px; padding-right: 1px;
  border: 1.5px solid var(--white); border-radius: 9999px; background: var(--violet); box-shadow: 0 4px 3px rgba(0, 0, 0, .05);
  font-size: 18px; line-height: 1.4; font-weight: 600; color: var(--white);
}
.afs-card {
  position: relative; flex: 1 1 0%; display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
  gap: 32px; height: 544px; max-height: calc(100vh - 6rem); padding: 32px 24px 64px;
  border: 1px solid var(--gray-300); border-radius: 12px;
  background-image: linear-gradient(var(--white), var(--afs-card-bottom));
}
.afs-card.afs-card--tall { height: 624px; }
.afs-card.afs-card--last { height: auto; max-height: none; }
.afs-card__text {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 16px;
  max-width: 592px; text-align: center;
}
.afs-card__lead { margin-bottom: 12px; }
.afs-card__art { position: absolute; left: 0; right: 0; bottom: 0; }
.afs-card__art img { width: 100%; height: auto; }

/* step 6: six pills; on screens 992 px and wider each shows a dark note on hover
   (Frank: in 300 ms, out 200 ms, "outSine", rising 0.5 rem) */
.afs-pills {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: 6px; width: 80%;
}
.afs-pill {
  position: relative; display: flex; justify-content: center; align-items: center; gap: 12px;
  height: 32px; padding: 0 8px 0 12px;
  border: 1px solid var(--gray-300); border-radius: 9999px; background: var(--white); box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}
.afs-pill__label { font-size: 14px; line-height: 1.4; font-weight: 600; }
.afs-pill__icon { flex: none; width: 16px; height: 16px; line-height: 0; }
.afs-pill__icon img { width: 16px; height: 17px; max-width: none; }
.afs-tip {
  display: none; position: absolute; top: 32px; right: -4px; z-index: 1; width: 288px; padding: 12px;
  border-radius: 8px; background: var(--ink); color: var(--white); box-shadow: 0 4px 5px rgba(0, 0, 0, .1);
  font-size: 14px; line-height: 1.4; cursor: pointer;
}
.afs-tip__tail { position: absolute; top: -6px; right: 12px; width: 16px; height: 6px; }
.afs-tip p { position: relative; z-index: 2; }
@media (min-width: 992px) {
  .afs-tip {
    display: block; visibility: hidden; opacity: 0; transform: translate3d(0, .5rem, 0);
    transition: opacity .2s var(--afs-out-sine), transform .2s var(--afs-out-sine), visibility 0s .2s;
  }
  .afs-pill:hover .afs-tip, .afs-pill:focus-visible .afs-tip {
    visibility: visible; opacity: 1; transform: translate3d(0, 0, 0);
    transition: opacity .3s var(--afs-out-sine), transform .3s var(--afs-out-sine), visibility 0s;
  }
}

/* step 7 title: "Let [photo] Agent Frank Get to Work", one row; on phones "Get to Work" takes a second row */
.afs-go { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.afs-go__let { margin-right: 4px; }
.afs-go__icon { flex: none; width: 48px; height: 48px; }
.afs-go__rest::before { content: " "; white-space: pre; }

/* step 7 purple card with the demo form */
.afs-try {
  position: relative; display: flex; flex-direction: column; align-items: stretch;
  width: calc(100% - 64px); padding: 64px 10% 40px; border-radius: 12px; background: var(--violet);
}
.afs-try__sq { position: absolute; top: 0; left: 0; right: 0; line-height: 1.4; }
.afs-try__sq--bottom { top: auto; bottom: 0; }
.afs-try__sq img { display: inline-block; vertical-align: baseline; width: 100%; height: auto; }
.afs-try__top {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 40px;
}
.afs-avatar { position: relative; flex: none; width: 92px; height: 92px; margin-bottom: 32px; border-radius: 9999px; }
/* the ring turns counter-clockwise, one turn in 8 s, linear, from the moment step 7 comes into view (af-steps.js) */
.afs-spin {
  position: absolute; z-index: 1; top: calc(50% - 80px); left: calc(50% - 80px); width: 160px; height: 160px; max-width: none;
  animation: afs-spin 8s linear infinite; animation-play-state: paused;
}
.afs-spin.is-on { animation-play-state: running; }
@keyframes afs-spin { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .afs-spin { animation: none; } }
.afs-avatar__photo {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border-radius: 9999px; object-fit: cover;
}
.afs-try__title { color: var(--white); }
.afs-try__sub { font-size: 15px; line-height: 1.4; text-align: center; color: var(--white); }
.afs-try__body { position: relative; z-index: 1; }
.afs-try__box { margin-bottom: 15px; }

/* the form: demo mode through site.js (data-demo), it sends nothing */
.afs-form { display: flex; flex-direction: column; gap: 16px; }
.afs-form[hidden], .afs-done[hidden] { display: none; }
.afs-form__pick { position: relative; }
.afs-field {
  display: block; width: 100%; height: 56px; min-height: 56px; margin: 0; padding: 0 14px; overflow: hidden; vertical-align: middle;
  font-family: inherit; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--white);
  background-color: var(--afs-field); border: 1px solid var(--afs-field-line); border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05); outline: 0; transition: all .4s;
}
.afs-field::placeholder { color: var(--afs-placeholder); opacity: 1; }
.afs-field:hover { border-color: var(--afs-field-hover); }
.afs-field:focus { border-color: var(--white); box-shadow: none; }
.afs-field--select { cursor: default; }
.afs-form__hint {
  position: absolute; top: 0; right: 42px; bottom: 0; display: flex; justify-content: flex-end; align-items: center;
  color: var(--white); pointer-events: none;
}
.afs-form__chev { position: absolute; top: calc(50% - 20px); right: 4px; width: 36px; height: 40px; pointer-events: none; }
.afs-form__actions { display: flex; justify-content: center; align-items: center; margin-top: 32px; }
.afs-submit {
  display: flex; justify-content: center; align-items: center; height: 56px; margin: 0; padding: 9px 20px;
  font-family: inherit; font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--violet-hover); white-space: nowrap;
  background-color: var(--white); border: 1px solid var(--violet); border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05); cursor: pointer; transition: all .4s;
}
.afs-submit:hover { border-color: var(--afs-button-hover); opacity: .8; }
.afs-submit:disabled { cursor: default; }

/* what the form shows after sending, in Frank's words */
.afs-done { padding: 48px 40px 56px; border-radius: 16px; background: var(--violet-100); text-align: center; }
.afs-done__art { width: 60%; max-width: 288px; height: auto; margin: 0 auto 5.4px; }
.afs-done__title { margin-bottom: 8px; }
.afs-done__text { color: var(--ink); }
.afs-done__cta { margin: 24px 0 20px; font-size: 18px; line-height: 1.4; font-weight: 600; color: var(--violet); }

/* ================================================================ tablet */
@media (max-width: 991px) {
  .afs-h5 { font-size: 21.6px; }

  .afp-card { padding: 24px 12px 32px; }
  .afp-wide { padding-top: 48px; padding-right: 30%; padding-bottom: 48px; background-image: none; }
  .afp-wide.afp-wide--intel { height: auto; padding-right: 30%; background-image: none; }

  .afs__grid { grid-template-columns: .5fr minmax(0, 1fr); column-gap: 24px; }
  .afs-card { height: 480px; }
  .afs-try { width: auto; align-self: stretch; }
}

/* ================================================================ phone, landscape */
@media (max-width: 767px) {
  .afs-h5 { font-size: 17.6px; }

  .afp__grid { grid-template-columns: 1fr; }
  .afp-card { flex-direction: row; }
  .afp-card__img { width: 30%; }
  .afp-card__text { text-align: left; justify-content: flex-start; align-items: flex-start; }
  .afp-wide { padding-right: 5%; }

  .afs-submit:hover { background-color: var(--afs-button-tap); border-color: var(--afs-button-tap); }
  .afs__left, .afs-step { top: 120px; }
}

/* Between 480 and 519 px the steps column is too narrow for the last card's button, so the columns stack
   there as they do below 480, instead of the card spilling past the window. */
@media (max-width: 519px) {
  .afs__grid { display: flex; flex-direction: column; align-items: stretch; gap: 56px; }
  .afs__left { position: static; }
}

/* ================================================================ phone, portrait */
@media (max-width: 479px) {
  .afs-h5--big { font-size: 24px; }

  .afp { padding: 80px 0; gap: 40px; }
  .afp-card { flex-direction: column; }
  .afp-card__img { width: 100%; }
  .afp-card__text { text-align: center; justify-content: flex-start; align-items: center; }
  .afp-wide {
    margin-top: -28px; padding-top: 272px;
    background: var(--gray-50) url("../img/m-af-unlimited-illu.avif") 100% 0 / 130% auto no-repeat;
  }
  .afp-wide.afp-wide--intel {
    padding-top: 70vw; padding-right: 5%;
    background: var(--gray-50) url("../img/m-af-intelligence-illu.avif") 50% 0 / 100% auto no-repeat;
  }
  .afp-wide__text { text-align: center; align-items: center; }

  .afs__grid { display: flex; flex-direction: column; align-items: stretch; gap: 56px; }
  .afs__left { position: static; }
  .afs__head { gap: 24px; }
  .afs__steps::before { left: 8px; }
  .afs-step { top: 24px; gap: 8px; margin-left: -8px; }
  .afs-step__num { top: 24px; width: 36px; height: 36px; }
  .afs-card { padding-left: 16px; padding-right: 16px; }
  .afs-card__text { gap: 12px; }
  /* round 6 fix: the step cards have fixed heights, at most the window's height, so that each one fits on screen
     while the next slides over it. On a phone the long steps (4 and 6) need more room than that: the words ran over
     the picture and past the card. Here every step takes its natural height, the picture follows the words, and
     the steps scroll by one after another. */
  .afs-step { position: static; }
  .afs-card, .afs-card.afs-card--tall { height: auto; max-height: none; padding-bottom: 0; overflow: hidden; }
  .afs-card__art { position: relative; left: auto; right: auto; bottom: auto; width: calc(100% + 32px); margin: 0 -16px; }
  .afs-pill__icon { width: 20px; height: 20px; }
  .afs-pill__icon img { width: 20px; height: 21.25px; }
  .afs-go { column-gap: 4px; }
  .afs-go__rest { flex-basis: 100%; text-align: center; }
  .afs-go__rest::before { content: none; }
  .afs-avatar { transform: scale(.8); }
  .afs-try { padding-left: 16px; padding-right: 16px; }
}
