/* ============================================================
   XLPro — Public pages design layer (landing / auth / pricing)
   Loads AFTER theme.css. Scoped to landing-* / auth-* / xl-* —
   must not restyle app dashboard tokens or shared md-* controls.
   ============================================================ */

.landing-page,
.auth-bg {
  --xl-blob-yellow: #fde68a;
  --xl-blob-teal: #99f6e4;
  --xl-blob-pink: #fbcfe8;
  --xl-ink: #14322c;
  --xl-ink-soft: #3f554e;
  --xl-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --xl-card-shadow: 0 10px 30px rgba(20, 50, 44, 0.08);
  --xl-card-shadow-hover: 0 18px 44px rgba(20, 50, 44, 0.13);
}

html:has(body.landing-page),
html:has(.auth-bg) {
  overflow-x: clip;
}
body.landing-page {
  background: var(--md-surface);
  overflow-x: clip;
}

/* ---------- Floating brand blobs ---------- */
.xl-blobs {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.xl-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.5;
  will-change: transform;
}
.xl-blob--yellow {
  width: 340px;
  height: 340px;
  top: -110px;
  inset-inline-end: -90px;
  background: radial-gradient(circle, var(--xl-blob-yellow), transparent 70%);
  animation: xlBlobA 8s ease-in-out infinite;
}
.xl-blob--teal {
  width: 380px;
  height: 380px;
  bottom: -140px;
  inset-inline-start: -110px;
  background: radial-gradient(circle, var(--xl-blob-teal), transparent 70%);
  animation: xlBlobB 9s ease-in-out infinite;
}
.xl-blob--pink {
  width: 240px;
  height: 240px;
  top: 42%;
  inset-inline-start: 16%;
  background: radial-gradient(circle, var(--xl-blob-pink), transparent 70%);
  opacity: 0.35;
  animation: xlBlobA 10s ease-in-out infinite reverse;
}
@keyframes xlBlobA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -14px) scale(1.06); }
}
@keyframes xlBlobB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-16px, 16px) scale(1.08); }
}

/* ---------- Hero ---------- */
.landing-hero {
  position: relative;
}
.landing-hero > .landing-hero__copy,
.landing-hero > .landing-hero__visual {
  position: relative;
  z-index: 1;
}
.landing-hero__title {
  color: var(--xl-ink);
}
.landing-hero__subtitle {
  color: var(--xl-ink-soft);
}

/* Primary CTA: soft attention pulse */
.landing-cta-primary {
  animation: xlCtaPulse 2.6s ease-in-out 1.2s infinite;
}
@keyframes xlCtaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.35); }
  55% { box-shadow: 0 0 0 12px rgba(13, 148, 136, 0); }
}

/* Hero mock: staggered row entrance on load */
.landing-mock {
  box-shadow: var(--xl-card-shadow-hover);
}
html.js-landing .landing-mock__row {
  animation: xlRowIn 0.5s var(--xl-ease) both;
}
html.js-landing .landing-mock__row:nth-child(1) { animation-delay: 0.45s; }
html.js-landing .landing-mock__row:nth-child(2) { animation-delay: 0.58s; }
html.js-landing .landing-mock__row:nth-child(3) { animation-delay: 0.71s; }
html.js-landing .landing-mock__row:nth-child(4) { animation-delay: 0.84s; }
html.js-landing .landing-mock__row:nth-child(5) { animation-delay: 0.97s; }
@keyframes xlRowIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Smoother reveal curve than theme.css default */
html.js-landing .landing-reveal:not(.is-visible) {
  transform: translateY(22px);
  transition: opacity 0.6s var(--xl-ease), transform 0.6s var(--xl-ease);
  transition-delay: var(--reveal-delay, 0ms);
}

/* ---------- Stats ---------- */
.landing-stats {
  position: relative;
  border-radius: var(--md-radius-lg);
  border: 1px solid var(--md-outline-variant);
  background: color-mix(in srgb, var(--md-surface), transparent 20%);
  padding: 18px clamp(14px, 3vw, 34px);
  box-shadow: var(--xl-card-shadow);
}
.landing-stats__item strong {
  color: var(--md-primary);
}

/* ---------- Feature cards ---------- */
.landing-feature {
  border-radius: var(--md-radius-lg);
  box-shadow: none;
  transition: transform 0.25s var(--xl-ease), box-shadow 0.25s var(--xl-ease),
    border-color 0.25s var(--xl-ease);
}
.landing-feature:hover {
  transform: translateY(-5px);
  box-shadow: var(--xl-card-shadow-hover);
  border-color: rgba(13, 148, 136, 0.35);
}

/* ---------- Steps: numbered path with connector ---------- */
.landing-steps {
  counter-reset: xl-step;
  position: relative;
}
.landing-step {
  position: relative;
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-lg);
  padding: 20px 18px;
  transition: transform 0.25s var(--xl-ease), box-shadow 0.25s var(--xl-ease);
}
.landing-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--xl-card-shadow);
}
.landing-step__num {
  background: linear-gradient(145deg, #107c41, var(--md-primary));
  color: #fff;
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.3);
}
@media (min-width: 981px) {
  .landing-steps::before {
    content: '';
    position: absolute;
    top: 42px;
    inset-inline: 12%;
    height: 2px;
    background: repeating-linear-gradient(
      to left,
      rgba(13, 148, 136, 0.35) 0 10px,
      transparent 10px 20px
    );
    z-index: 0;
  }
  .landing-step { z-index: 1; }
}

/* ---------- Comparison: Excel vs XLPro ---------- */
.xl-compare {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-lg);
  overflow: hidden;
  background: var(--md-surface);
  box-shadow: var(--xl-card-shadow);
}
.xl-compare__row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
  border-top: 1px solid var(--md-outline-variant);
}
.xl-compare__row:first-child {
  border-top: none;
}
.xl-compare__row--head {
  background: var(--md-surface-variant);
  font-weight: 800;
  color: var(--xl-ink);
}
.xl-compare__cell {
  padding: 14px 16px;
  font-size: 0.92rem;
  line-height: 1.8;
  display: flex;
  align-items: center;
  gap: 8px;
}
.xl-compare__cell--scenario {
  font-weight: 700;
  color: var(--xl-ink);
  background: color-mix(in srgb, var(--md-surface-variant), transparent 55%);
}
.xl-compare__cell--excel {
  color: var(--md-on-surface-variant);
}
.xl-compare__cell--xlpro {
  color: var(--xl-ink);
  background: rgba(13, 148, 136, 0.06);
  font-weight: 600;
}
.xl-compare__cell .material-symbols-rounded {
  font-size: 19px;
  flex-shrink: 0;
}
.xl-compare__cell--excel .material-symbols-rounded { color: #c2703d; }
.xl-compare__cell--xlpro .material-symbols-rounded { color: var(--md-primary); }
@media (max-width: 760px) {
  .xl-compare__row {
    grid-template-columns: 1fr;
  }
  .xl-compare__row--head { display: none; }
  .xl-compare__cell--scenario {
    padding-bottom: 6px;
    background: var(--md-surface-variant);
  }
  .xl-compare__cell[data-label]::before {
    content: attr(data-label);
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--md-on-surface-variant);
    min-width: 64px;
  }
}

/* ---------- FAQ accordion (no-JS details/summary) ---------- */
.xl-faq {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}
.xl-faq__item {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-md);
  background: var(--md-surface);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.xl-faq__item[open] {
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: var(--xl-card-shadow);
}
.xl-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 700;
  color: var(--xl-ink);
  list-style: none;
  user-select: none;
}
.xl-faq__q::-webkit-details-marker { display: none; }
.xl-faq__q::after {
  content: 'add';
  font-family: 'Material Symbols Rounded', sans-serif;
  font-size: 20px;
  color: var(--md-primary);
  transition: transform 0.25s var(--xl-ease);
  flex-shrink: 0;
}
.xl-faq__item[open] .xl-faq__q::after {
  transform: rotate(45deg);
}
.xl-faq__a {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--md-on-surface-variant);
  font-size: 0.93rem;
  line-height: 1.9;
}

/* ---------- Download banner ---------- */
.landing-download-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--md-radius-lg);
  border: 1px solid rgba(13, 148, 136, 0.25);
  background:
    radial-gradient(circle at 85% 0%, rgba(253, 230, 138, 0.35), transparent 45%),
    radial-gradient(circle at 10% 100%, rgba(153, 246, 228, 0.4), transparent 45%),
    var(--md-surface);
  box-shadow: var(--xl-card-shadow);
}

/* ---------- Footer ---------- */
.landing-footer {
  border-top: 1px solid var(--md-outline-variant);
  background: var(--md-surface-variant);
  margin-top: 30px;
}
.xl-footer-grid {
  width: min(1140px, calc(100% - 28px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding: 34px 0 22px;
}
.xl-footer-grid__about {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--md-on-surface-variant);
  max-width: 34ch;
}
.xl-footer-col__title {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--xl-ink);
}
.xl-footer-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.xl-footer-col a {
  color: var(--md-on-surface-variant);
  text-decoration: none;
  font-size: 0.9rem;
  width: fit-content;
  transition: color 0.15s ease;
}
.xl-footer-col a:hover { color: var(--md-primary); }
.xl-footer-bottom {
  width: min(1140px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0 20px;
  border-top: 1px solid var(--md-outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--md-on-surface-variant);
}
@media (max-width: 760px) {
  .xl-footer-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- Pricing page ---------- */
.xl-page-head {
  position: relative;
  text-align: center;
  padding: clamp(28px, 5vw, 54px) 0 clamp(18px, 3vw, 30px);
}
.xl-page-head__title {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--xl-ink);
  position: relative;
  z-index: 1;
}
.xl-page-head__lead {
  margin: 0 auto;
  max-width: 52ch;
  color: var(--xl-ink-soft);
  line-height: 1.9;
  position: relative;
  z-index: 1;
}
.landing-page .landing-plans {
  position: relative;
  z-index: 1;
}
.landing-plan {
  border-radius: var(--md-radius-lg);
  transition: transform 0.25s var(--xl-ease), box-shadow 0.25s var(--xl-ease);
}
.landing-plan:hover {
  transform: translateY(-5px);
  box-shadow: var(--xl-card-shadow-hover);
}
.landing-plan--featured {
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 14px 40px rgba(13, 148, 136, 0.16);
}

/* ---------- Auth page ---------- */
.auth-bg {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 8%, rgba(253, 230, 138, 0.3), transparent 38%),
    radial-gradient(circle at 8% 92%, rgba(153, 246, 228, 0.34), transparent 40%),
    var(--md-surface);
}
.auth-shell {
  position: relative;
  z-index: 1;
}
.auth-card {
  border: 1px solid var(--md-outline-variant);
  box-shadow: var(--xl-card-shadow-hover);
}
.auth-hero__tagline {
  color: var(--xl-ink-soft);
}

/* Mini mock table in auth aside */
.xl-auth-mock {
  margin-top: 26px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-md);
  overflow: hidden;
  background: var(--md-surface);
  box-shadow: var(--xl-card-shadow);
  font-size: 0.78rem;
  max-width: 300px;
}
.xl-auth-mock__row {
  display: flex;
  padding: 8px 12px;
}
.xl-auth-mock__row > span {
  flex: 1;
  text-align: center;
  color: var(--xl-ink-soft);
}
.xl-auth-mock__row--head {
  background: var(--md-surface-variant);
  font-weight: 800;
}
.xl-auth-mock__row--head > span { color: var(--xl-ink); }
.xl-auth-mock__row--alt { background: rgba(0, 0, 0, 0.02); }
html.js-landing .xl-auth-mock__row,
.xl-auth-mock__row {
  animation: xlRowIn 0.5s var(--xl-ease) both;
}
.xl-auth-mock__row:nth-child(1) { animation-delay: 0.35s; }
.xl-auth-mock__row:nth-child(2) { animation-delay: 0.5s; }
.xl-auth-mock__row:nth-child(3) { animation-delay: 0.65s; }
.xl-auth-mock__row:nth-child(4) { animation-delay: 0.8s; }

.xl-auth-trust {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.xl-auth-trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}
.xl-auth-trust .material-symbols-rounded {
  font-size: 19px;
  color: var(--xl-blob-yellow);
}
.auth-hero__tagline {
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .xl-blob,
  .landing-cta-primary,
  html.js-landing .landing-mock__row,
  .xl-auth-mock__row {
    animation: none;
  }
  html.js-landing .landing-mock__row,
  .xl-auth-mock__row {
    opacity: 1;
    transform: none;
  }
  .landing-feature:hover,
  .landing-step:hover,
  .landing-plan:hover {
    transform: none;
  }
  .xl-faq__q::after {
    transition: none;
  }
}
