/* =============================================================================
   Autofocuss — Thank You / PDF delivery page
   -----------------------------------------------------------------------------
   Loaded only on pages using page-templates/page-thank-you.php.
   Fluid from 320px up; no fixed widths anywhere.
   ========================================================================== */

.af-ty {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fills the viewport below the fixed 80px header without ever clipping. */
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px);
  padding: 140px 24px 90px;
  overflow: hidden;
  background: var(--bg-light);
  text-align: center;
}

/* Soft brand wash behind the lockup. Decorative only. */
.af-ty-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  width: min(900px, 120vw);
  height: min(900px, 120vw);
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 62%);
  pointer-events: none;
  z-index: 0;
}

.af-ty-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.af-ty-badge { margin-bottom: 28px; }

/* --- Lockup --------------------------------------------------------------- */

.af-ty-title {
  font-family: var(--font-headings);
  /* Scales from phone to desktop without a single breakpoint. */
  font-size: clamp(46px, 13vw, 104px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text-dark);
  margin: 0 0 20px;
}

/* Optional uploaded artwork (featured image) in place of the wordmark. */
.af-ty-artwork {
  width: 100%;
  max-width: 520px;
  margin: 0 0 24px;
}

.af-ty-artwork img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.af-ty-sub {
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted-light);
  margin: 0 0 30px;
}

/* Animated ellipsis after "being prepared" */
.af-ty-dots span {
  display: inline-block;
  animation: af-ty-dot 1.4s infinite;
}
.af-ty-dots span:nth-child(2) { animation-delay: 0.2s; }
.af-ty-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes af-ty-dot {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}

/* --- Progress ------------------------------------------------------------- */

.af-ty-progress {
  width: min(320px, 100%);
  height: 6px;
  margin: 0 0 16px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.af-ty-progress-bar {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  animation: af-ty-slide 1.5s var(--ease-premium) infinite;
}

@keyframes af-ty-slide {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

/* Once the file is handed over the bar fills and stops travelling. */
.af-ty.is-ready .af-ty-progress-bar {
  width: 100%;
  animation: none;
  transform: none;
}

.af-ty.is-ready .af-ty-dots { display: none; }

.af-ty-status {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted-light);
  margin: 0 0 30px;
  min-height: 1.4em; /* reserves space so the text swap doesn't shift layout */
}

/* --- Actions -------------------------------------------------------------- */

.af-ty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.woocommerce .af-ty-download,
.af-ty-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 15px 34px;
  font-size: 16px;
  line-height: 1.2;
}

.af-ty-download svg { flex-shrink: 0; }

.af-ty-note {
  font-size: 13px;
  color: var(--text-muted-light);
  opacity: 0.85;
  margin: 0;
  max-width: 420px;
}

/* --- Editor content ------------------------------------------------------- */

.af-ty-body {
  margin: 36px 0 0;
  text-align: left;
  width: 100%;
}

.af-ty-body:empty { display: none; }

/* --- Secondary links ------------------------------------------------------ */

.af-ty-next {
  width: 100%;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.af-ty-next-label {
  display: block;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted-light);
}

.af-ty-next-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.af-ty-next-links .btn-primary-outline {
  padding: 11px 22px;
  font-size: 14px;
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 782px) {
  .af-ty { padding: 116px 20px 72px; }
  .af-ty-badge { margin-bottom: 22px; }
  .af-ty-next { margin-top: 40px; padding-top: 26px; }
}

@media (max-width: 560px) {
  .af-ty { padding: 104px 16px 60px; }
  .af-ty-sub { margin-bottom: 24px; }

  /* Full-width tap targets read better than a centred pill on a phone. */
  .af-ty-actions { width: 100%; }
  .af-ty-download { width: 100%; }

  .af-ty-next-links { flex-direction: column; align-items: stretch; }
  .af-ty-next-links .btn-primary-outline { text-align: center; }
}

@media (max-width: 380px) {
  .af-ty-title { letter-spacing: -0.02em; }
  .af-ty-status { font-size: 13px; }
}

/* Very short landscape viewports: drop the min-height so nothing is cut off. */
@media (max-height: 620px) and (orientation: landscape) {
  .af-ty { min-height: 0; padding-top: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  .af-ty-dots span,
  .af-ty-progress-bar { animation: none; }
  .af-ty-progress-bar { width: 100%; transform: none; }
}

@media print {
  .af-ty-glow,
  .af-ty-progress,
  .af-ty-actions,
  .af-ty-next { display: none !important; }
}
