/* ==========================================================================
   Thready — Landing Page
   Hero, Features, Pricing, CTA, etc. — Hybrid light/dark sections
   ========================================================================== */

/* ==========================================================================
   Public Header (Landing)
   ========================================================================== */
.public-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  z-index: var(--z-topbar);
  transition: background var(--duration-base), border-color var(--duration-base);
}
.public-header.is-scrolled {
  background: rgba(15, 15, 20, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}
.public-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.public-header__logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -.02em;
}
.public-header__logo span {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.public-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}
.public-header__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--duration-fast);
}
.public-header__link:hover { color: var(--color-text); }
.public-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-4xl) var(--space-lg);
}

/* Atmospheric background */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(108,92,231,.15) 0%, transparent 70%);
  filter: blur(80px);
}
.hero__bg::after {
  content: '';
  position: absolute;
  top: 20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,210,211,.08) 0%, transparent 70%);
  filter: blur(60px);
}

/* Grid pattern overlay */
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45,45,61,.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,45,61,.3) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 740px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: var(--color-primary-alpha-10);
  border: 1px solid var(--color-primary-alpha-20);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary-light);
  margin-bottom: var(--space-xl);
}
.hero__badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: var(--space-lg);
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2xl);
  max-width: 560px;
  margin-inline: auto;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--color-border);
}
.hero__stat {
  text-align: center;
}
.hero__stat__value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-text), var(--color-text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__stat__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.lp-section {
  padding: var(--space-4xl) var(--space-lg);
  position: relative;
}
.lp-section--light {
  background: #F8F9FC;
  color: #1A1A2E;
}
.lp-section--light .section-title { color: #1A1A2E; }
.lp-section--light .section-subtitle { color: #6B7280; }

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}
.section-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--color-primary-light);
  margin-bottom: var(--space-md);
}
.section-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: var(--space-md);
}
.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* ==========================================================================
   Features
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: var(--container-max);
  margin: 0 auto;
}

.feature-card {
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0;
  transition: opacity var(--duration-base);
}
.feature-card:hover {
  border-color: var(--color-primary-alpha-20);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.feature-card:hover::before { opacity: 1; }

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-alpha-10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  color: var(--color-primary-light);
}
.feature-card__icon svg {
  width: 24px;
  height: 24px;
}

.feature-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.feature-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* Light section variant */
.lp-section--light .feature-card {
  background: #fff;
  border-color: #E5E7EB;
}
.lp-section--light .feature-card:hover {
  border-color: rgba(108,92,231,.3);
  box-shadow: 0 8px 32px rgba(108,92,231,.08);
}
.lp-section--light .feature-card__desc { color: #6B7280; }

/* ==========================================================================
   How It Works
   ========================================================================== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
  max-width: var(--container-max);
  margin: 0 auto;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: .2;
}

.step {
  text-align: center;
  position: relative;
}
.step__number {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--color-bg-card);
  border: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-primary-light);
  margin: 0 auto var(--space-lg);
  position: relative;
  z-index: 1;
}
.step__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.step__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 280px;
  margin: 0 auto;
}

/* ==========================================================================
   Pricing
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-xl);
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

.pricing-grid--two {
  grid-template-columns: repeat(2, 1fr);
  max-width: 700px;
}

.pricing-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.pricing-card--featured {
  border-color: var(--color-primary);
  background: linear-gradient(180deg, rgba(108,92,231,.06) 0%, var(--color-bg-card) 100%);
}
.pricing-card--featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 0;
}

.pricing-card__badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-lg);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-dark));
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

.pricing-card__name {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.pricing-card__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.pricing-card__amount {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 800;
}
.pricing-card__currency {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
}
.pricing-card__period {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.pricing-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
  line-height: var(--leading-relaxed);
}
.pricing-card__features {
  margin-bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.pricing-card__feature {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.pricing-card__feature svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-success);
}
.pricing-card__feature--disabled {
  opacity: .4;
}
.pricing-card__feature--disabled svg {
  color: var(--color-text-muted);
}

.pricing-card .btn {
  width: 100%;
}

/* ==========================================================================
   CTA Section
   ========================================================================== */
.cta-section {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108,92,231,.08), rgba(0,210,211,.05));
  z-index: 0;
}
.cta-section__content {
  position: relative;
  z-index: 1;
}
.cta-section__title {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  letter-spacing: -.02em;
}
.cta-section__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0 auto var(--space-2xl);
  line-height: var(--leading-relaxed);
}

/* ==========================================================================
   Public Footer
   ========================================================================== */
.public-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3xl) var(--space-lg) var(--space-xl);
}
.public-footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}
.public-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}
.public-footer__brand {
  font-family: var(--font-heading);
}
.public-footer__brand-name {
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-sm);
}
.public-footer__brand-name span {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.public-footer__brand-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  max-width: 300px;
}
.public-footer__heading {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}
.public-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.public-footer__link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
}
.public-footer__link:hover {
  color: var(--color-primary-light);
}
.public-footer__bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.public-footer__copy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ==========================================================================
   Auth Pages (Login, Register, Password Reset)
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  position: relative;
}
.auth-page__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.auth-page__bg::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(108,92,231,.1) 0%, transparent 70%);
  filter: blur(60px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
}
.auth-card__logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.auth-card__logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
}
.auth-card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xs);
}
.auth-card__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: var(--space-xl);
}
.auth-card__footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.auth-card__footer a {
  color: var(--color-primary-light);
  font-weight: 500;
}
.auth-card__footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Legal Pages (Terms, Privacy)
   ========================================================================== */
.legal-page {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: calc(var(--topbar-height) + var(--space-3xl)) var(--space-lg) var(--space-3xl);
}
.legal-page h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-lg);
}
.legal-page h2 {
  font-size: var(--text-xl);
  margin: var(--space-2xl) 0 var(--space-md);
}
.legal-page h3 {
  font-size: var(--text-lg);
  margin: var(--space-xl) 0 var(--space-sm);
}
.legal-page p {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-md);
}
.legal-page ul, .legal-page ol {
  list-style: disc;
  padding-left: var(--space-xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}
.legal-page li {
  margin-bottom: var(--space-sm);
  line-height: var(--leading-relaxed);
}
.legal-page .last-updated {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
}
.legal-page .legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-lg);
  border: 1px solid var(--color-border, rgba(255,255,255,0.12));
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}
.legal-page .legal-table th,
.legal-page .legal-table td {
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-border, rgba(255,255,255,0.12));
  text-align: left;
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  vertical-align: top;
}
.legal-page .legal-table th {
  white-space: nowrap;
  width: 180px;
  font-weight: 600;
  color: var(--color-text-primary, #fff);
  background: rgba(255,255,255,0.03);
}
.legal-page .legal-table td ul {
  list-style: disc;
  padding-left: var(--space-lg);
  margin: 0;
}
.legal-page .legal-table td a {
  color: var(--color-primary, #a78bfa);
  text-decoration: underline;
}
@media (max-width: 600px) {
  .legal-page .legal-table th,
  .legal-page .legal-table td {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
  }
  .legal-page .legal-table th {
    border-bottom: none;
    padding-bottom: 0;
    font-size: var(--text-sm);
    background: rgba(255,255,255,0.05);
  }
  .legal-page .legal-table td {
    padding-top: var(--space-xs);
  }
}

/* ==========================================================================
   404 Page
   ========================================================================== */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl);
}
.error-page__code {
  font-family: var(--font-heading);
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
}
.error-page__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}
.error-page__desc {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .features-grid,
  .steps,
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps::before { display: none; }
}

@media (max-width: 767px) {
  .hero { min-height: auto; padding: calc(var(--topbar-height) + var(--space-3xl)) var(--space-md) var(--space-3xl); }
  .hero__bg::before { width: 100vw; }
  .hero__bg::after { width: 80vw; right: -20%; }
  .hero__stats { flex-direction: column; gap: var(--space-lg); }
  .features-grid,
  .steps,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .public-header__nav { display: none; }
  .public-footer__grid { grid-template-columns: 1fr 1fr; }
  .auth-page__bg::before { width: 100vw; }
  .auth-card { padding: var(--space-xl); }
}
