/* Trading Service Page Styles */

/* Sections */
body.frontend .products-page {
  padding: var(--spacing-xl) 0;
  background: linear-gradient(180deg, var(--bg-gray-50) 0%, #F8FAFC 100%);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

body.frontend .products-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

body.frontend .products-page .services-section {
  padding-top: var(--section-padding-md);
  padding-bottom: var(--section-padding-lg);
}

/* Cards */
body.frontend .products-page .package-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

body.frontend .products-page .package-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-blue);
}

body.frontend .products-page .package-card:hover {
  box-shadow: 0 20px 40px rgba(80, 118, 238, 0.2);
  border-color: var(--brand-blue);
}

body.frontend .products-page .package-cta {
  background: var(--brand-blue);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 20px;
}

body.frontend .products-page .package-cta:hover {
  background: #3d5ec9;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(80, 118, 238, 0.4);
}

/* Pricing */
/* (Pricing grid/table styles live with plan pages and are intentionally not duplicated here.) */

/* Responsive */
@media (max-width: 768px) {
  body.frontend .products-page .package-card {
    padding: 20px;
  }
}

/* Review link (optional on this page) */
body.frontend .products-page .services-section .review-link-container {
  text-align: center;
}

body.frontend .products-page .services-section .review-link {
  font-size: 0.875rem;
  color: #1e3a8a;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin-top: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 6px;
  line-height: 1;
}

body.frontend .products-page .services-section .review-link:hover {
  color: #0f2744;
  text-decoration: underline;
}

/*
 * 3D flip root: `.plan-card--service-flip` (NOT bare `.plan-card` on /user/* — user.css breaks 3D).
 * Public home may use `plan-card plan-card--service-flip` for marketing + cardReveal animation.
 */
body.frontend .plan-card--service-flip {
  perspective: 1200px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  outline: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-bottom: 0;
  transform: none !important;
}

body.frontend .plan-card--service-flip:hover {
  transform: none !important;
  border-color: transparent !important;
}

body.frontend .plan-card--service-flip .package-card--flip-face {
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  background: #fff;
}

body.frontend .plan-card--service-flip .package-card--flip-face::before {
  display: none;
}

body.frontend .plan-card--service-flip:hover .package-card--flip-face,
body.frontend .plan-card--service-flip:focus-within .package-card--flip-face,
body.frontend .plan-card--service-flip.is-flipped .package-card--flip-face {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

body.frontend .services-section .plan-card--service-flip .package-card--flip-face {
  min-height: clamp(300px, 40vw, 400px);
}

body.frontend .plan-card--service-flip .card-inner {
  position: relative;
  width: 100%;
  min-height: clamp(300px, 40vw, 400px);
  border-radius: 16px;
  overflow: visible;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

/* Any device that can hover (mouse / hybrid) — fixes Windows touch laptops reporting hover:none */
body.frontend .plan-card--service-flip:hover .card-inner,
body.frontend .plan-card--service-flip:focus-within .card-inner {
  transform: rotateY(180deg);
}

/* True touch-first UIs: no hover capability at all */
@media not (any-hover: hover) {
  body.frontend .plan-card--service-flip:hover .card-inner,
  body.frontend .plan-card--service-flip:focus-within .card-inner {
    transform: none;
  }

  body.frontend .plan-card--service-flip.is-flipped .card-inner {
    transform: rotateY(180deg);
  }
}

body.frontend .plan-card--service-flip .card-front,
body.frontend .plan-card--service-flip .card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

body.frontend .plan-card--service-flip .card-front {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

body.frontend .plan-card--service-flip .service-flip-learn-more {
  margin-top: auto;
  align-self: stretch;
  padding: 0.65rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.25;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.frontend .plan-card--service-flip .service-flip-learn-more:hover {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

body.frontend .plan-card--service-flip .service-flip-learn-more:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

body.frontend .plan-card--service-flip .card-back {
  transform: rotateY(180deg);
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
  padding: 24px 20px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* Fill card height so back CTA can sit on margin-top: auto at the bottom */
body.frontend .plan-card--service-flip .roi-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  gap: 0.75rem;
}

body.frontend .plan-card--service-flip .roi-section__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

body.frontend .plan-card--service-flip .roi-section__dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 0 0 auto;
  min-height: 0;
}

body.frontend .plan-card--service-flip .roi-section__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.8125rem;
  line-height: 1.35;
  min-width: 0;
}

body.frontend .plan-card--service-flip .roi-section__row dt {
  margin: 0;
  color: #64748b;
  font-weight: 500;
  flex-shrink: 1;
}

body.frontend .plan-card--service-flip .roi-section__row dd {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

body.frontend .plan-card--service-flip .roi-section__row dd.roi-val--pos {
  color: #15803d;
}

body.frontend .plan-card--service-flip .roi-section__row dd.roi-val--neg {
  color: #b91c1c;
}

body.frontend .plan-card--service-flip .roi-section__row dd.roi-val--zero {
  color: #64748b;
}

/* Back-side CTA — hover stays on .service-flip-wrap / .plan-card--service-flip */
body.frontend .plan-card--service-flip .cta-btn {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.2;
  color: #fff !important;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.frontend .plan-card--service-flip .cta-btn:hover {
  color: #fff !important;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.42);
}

body.frontend .plan-card--service-flip .cta-btn:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.75);
  outline-offset: 2px;
}

body.frontend .plan-card--service-flip .cta-btn[disabled] {
  opacity: 0.8;
  cursor: default;
  pointer-events: none;
}

body.frontend .plan-card--service-flip .card-back .card-back-review {
  margin-top: 10px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  body.frontend .plan-card--service-flip .card-inner {
    transition-duration: 0.01ms;
  }

  body.frontend .plan-card--service-flip .cta-btn:hover {
    transform: none;
  }
}

/* Entrance: opacity only (avoid transform on flip root — breaks preserve-3d) */
@keyframes ts-flip-card-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.frontend .services-grid--product-flip > .plan-card--service-flip {
  animation: ts-flip-card-fade-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.frontend .services-grid--product-flip > .plan-card--service-flip:nth-child(1) {
  animation-delay: 0.04s;
}

body.frontend .services-grid--product-flip > .plan-card--service-flip:nth-child(2) {
  animation-delay: 0.1s;
}

body.frontend .services-grid--product-flip > .plan-card--service-flip:nth-child(3) {
  animation-delay: 0.16s;
}

body.frontend .services-grid--product-flip > .plan-card--service-flip:nth-child(4) {
  animation-delay: 0.22s;
}

body.frontend .services-grid--product-flip > .plan-card--service-flip:nth-child(5) {
  animation-delay: 0.28s;
}

body.frontend .services-grid--product-flip > .plan-card--service-flip:nth-child(6) {
  animation-delay: 0.34s;
}

body.frontend .services-grid--product-flip > .plan-card--service-flip:nth-child(7) {
  animation-delay: 0.4s;
}

body.frontend .services-grid--product-flip > .plan-card--service-flip:nth-child(8) {
  animation-delay: 0.46s;
}

@media (prefers-reduced-motion: reduce) {
  body.frontend .services-grid--product-flip > .plan-card--service-flip {
    animation: none;
    opacity: 1;
  }
}

