/**
 * App & Features test page
 * Matches index/homepage design system
 */

.app-features-banner {
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
  border-bottom: 1px solid #fcd34d;
}

.app-features-banner a {
  color: #b45309;
  font-weight: 700;
}

/* ========== HERO ========== */
.aft-hero {
  padding: 56px 24px 48px;
  text-align: center;
  border-bottom: 1px solid var(--ht-border);
}

.aft-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.aft-hero h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  color: var(--ht-text);
  line-height: 1.25;
}

.aft-hero p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ht-muted);
  margin: 0 0 28px;
  font-weight: 500;
}

.aft-hero .store-buttons {
  justify-content: center;
  margin-top: 0;
}

.aft-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.aft-btn-primary {
  background: var(--ht-accent-strong);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.4);
}

.aft-btn-primary:hover {
  background: var(--ht-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.45);
}

.aft-btn-secondary {
  background: transparent;
  color: var(--ht-accent-strong);
  border: 2px solid var(--ht-accent);
}

.aft-btn-secondary:hover {
  background: var(--ht-accent-light);
  transform: translateY(-1px);
}

.aft-btn-outline {
  background: transparent;
  color: var(--ht-accent-strong);
  border: 2px solid var(--ht-accent);
}

.aft-btn-outline:hover {
  background: var(--ht-accent-light);
  transform: translateY(-1px);
}

/* ========== CAROUSEL ========== */
.aft-carousel-section {
  padding: 48px 24px 48px;
  background: var(--ht-bg-strong);
}

.aft-carousel-header {
  text-align: center;
  margin-bottom: 28px;
}

.aft-carousel-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ht-text);
  letter-spacing: -0.025em;
}

.aft-carousel-header p {
  font-size: 0.9375rem;
  color: var(--ht-muted);
  margin: 0;
  font-weight: 500;
}

.aft-carousel-wrapper {
  position: relative;
  max-width: 720px;
  margin: 0 auto 28px;
}

.aft-carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 24px 52px;
  margin: 0 -20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.aft-carousel-track::-webkit-scrollbar {
  display: none;
}

/* Exactly 3 slides visible: each = (100% - 2 gaps) / 3 */
.aft-carousel-slide {
  flex: 0 0 calc(33.333% - 14px);
  min-width: 180px;
  scroll-snap-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center center;
}

/* Side phones: smaller, angled */
.aft-carousel-slide.is-left {
  transform: scale(0.78) perspective(600px) rotateY(14deg);
  opacity: 0.9;
}

/* Main phone: larger, straight on */
.aft-carousel-slide.is-center {
  transform: scale(1.15);
  opacity: 1;
  z-index: 2;
}

.aft-carousel-slide.is-right {
  transform: scale(0.78) perspective(600px) rotateY(-14deg);
  opacity: 0.9;
}

.aft-carousel-slide:hover {
  opacity: 1;
}

.aft-slide-img {
  background: var(--ht-white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--ht-border);
  box-shadow: var(--ht-shadow-lg);
  aspect-ratio: 9 / 19.5;
}

.aft-slide-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.aft-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--ht-border);
  background: var(--ht-white);
  color: var(--ht-text);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  line-height: 1;
}

.aft-carousel-btn:hover {
  background: var(--ht-accent-light);
  border-color: var(--ht-accent);
  transform: translateY(-50%) scale(1.05);
}

.aft-carousel-prev {
  left: 4px;
}

.aft-carousel-next {
  right: 4px;
}

.aft-carousel-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}

.aft-carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--ht-border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.aft-carousel-dots button:hover {
  background: var(--ht-accent);
}

.aft-carousel-dots button.is-active {
  background: var(--ht-accent-strong);
  transform: scale(1.2);
}

.aft-feature-desc {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: 28px 24px;
  background: var(--ht-white);
  border-radius: 16px;
  border: 1px solid var(--ht-border);
  box-shadow: var(--ht-shadow);
  transition: opacity 0.25s ease;
}

.aft-feature-desc h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ht-text);
  letter-spacing: -0.02em;
}

.aft-feature-desc p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ht-muted);
  margin: 0;
  font-weight: 500;
}

.aft-feature-desc p + p {
  margin-top: 12px;
}

.aft-feature-benefit {
  font-weight: 600 !important;
  color: var(--ht-accent-strong) !important;
  font-size: 0.875rem !important;
}

/* ========== HOW TO SET UP THE APP ========== */
.aft-how-to {
  padding: 56px 24px;
  background: var(--ht-white);
  border-top: 1px solid var(--ht-border);
}

.aft-how-to-inner {
  max-width: 900px;
  margin: 0 auto;
}

.aft-how-to-header {
  text-align: center;
  margin-bottom: 40px;
}

.aft-how-to-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ht-text);
  letter-spacing: -0.025em;
}

.aft-how-to-header p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ht-muted);
  margin: 0;
  font-weight: 500;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.aft-how-to-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aft-how-to-steps li {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--ht-border);
}

.aft-how-to-steps li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.aft-step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ht-accent-strong);
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: 50%;
  line-height: 1;
}

.aft-step-content {
  flex: 1;
  min-width: 0;
}

.aft-step-with-img {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: center;
}

.aft-step-with-img .aft-step-text {
  min-width: 0;
}

.aft-step-img {
  flex-shrink: 0;
  text-align: center;
}

.aft-step-img img {
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--ht-border);
  box-shadow: var(--ht-shadow);
  display: block;
  margin: 0 auto;
}

.aft-step-img-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aft-step-img-clickable:hover {
  transform: scale(1.02);
}

.aft-step-img-clickable:focus {
  outline: 2px solid var(--ht-accent-strong);
  outline-offset: 4px;
}

/* ========== LIGHTBOX ========== */
.aft-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.aft-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.aft-lightbox.is-open[hidden] {
  display: flex !important;
}

.aft-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.aft-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aft-lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.aft-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.aft-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.aft-how-to-steps h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ht-text);
}

.aft-how-to-steps p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ht-muted);
  margin: 0;
  font-weight: 500;
}

.aft-how-to-steps a {
  color: var(--ht-accent-strong);
  font-weight: 600;
}

.aft-how-to-steps a:hover {
  text-decoration: underline;
}

.aft-how-to-cta {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .aft-how-to {
    padding: 40px 16px;
  }

  .aft-how-to-steps li {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 32px;
  }

  .aft-step-with-img {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .aft-step-img img {
    max-width: 260px;
  }

  .aft-how-to-steps h3 {
    font-size: 1.125rem;
  }

  .aft-how-to-steps p {
    font-size: 0.9375rem;
  }
}

@media (max-width: 480px) {
  .aft-step-img img {
    max-width: 220px;
  }
}

/* ========== CALCULATORS ========== */
.aft-calculators {
  padding: 56px 24px;
  text-align: center;
  border-top: 1px solid var(--ht-border);
}

.aft-calc-inner {
  max-width: 600px;
  margin: 0 auto;
}

.aft-calculators h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ht-text);
}

.aft-calculators p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ht-muted);
  margin: 0 0 24px;
  font-weight: 500;
}

.aft-calculators a:not(.aft-btn) {
  color: var(--ht-accent-strong);
  font-weight: 600;
}

.aft-calc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ========== CTA ========== */
.aft-cta {
  padding: 56px 24px;
  text-align: center;
  background: #1a1a1a;
  color: #ffffff;
}

.aft-cta h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 8px;
  color: #ffffff;
}

.aft-cta p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 28px;
  font-weight: 500;
}

.aft-cta .store-buttons {
  justify-content: center;
}

.aft-cta .store-badge img {
  height: 48px;
}

/* ========== MOBILE ========== */
@media (max-width: 900px) {
  .aft-carousel-wrapper {
    max-width: 560px;
  }

  .aft-carousel-slide {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 150px;
  }

  .aft-carousel-slide.is-left {
    transform: scale(0.75) perspective(600px) rotateY(16deg);
  }

  .aft-carousel-slide.is-center {
    transform: scale(1.12);
  }

  .aft-carousel-slide.is-right {
    transform: scale(0.75) perspective(600px) rotateY(-16deg);
  }
}

@media (max-width: 600px) {
  .aft-hero {
    padding: 40px 16px 36px;
  }

  .aft-carousel-section {
    padding: 40px 16px 36px;
  }

  .aft-carousel-wrapper {
    max-width: 100%;
  }

  .aft-carousel-slide {
    flex: 0 0 calc(33.333% - 12px);
    min-width: 100px;
  }

  .aft-carousel-slide.is-left {
    transform: scale(0.72) perspective(500px) rotateY(18deg);
  }

  .aft-carousel-slide.is-center {
    transform: scale(1.1);
  }

  .aft-carousel-slide.is-right {
    transform: scale(0.72) perspective(500px) rotateY(-18deg);
  }

  .aft-carousel-track {
    padding: 20px 40px;
  }

  .aft-carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .aft-feature-desc {
    padding: 22px 18px;
  }

  .aft-feature-desc h3 {
    font-size: 1.2rem;
  }

  .aft-calculators {
    padding: 40px 16px;
  }

  .aft-cta {
    padding: 40px 16px;
  }

  .aft-cta .store-buttons {
    flex-direction: column;
    align-items: center;
  }
}
