/* ===================================================================
   PriceLantern Layouts
   Section patterns, grid helpers, and page-level layout primitives.
   =================================================================== */

/* ======================== BASE RESET ======================== */
*, *::before, *::after { box-sizing: border-box; }

body, html {
  height: 100%;
  margin: 0;
  font-family: var(--pl-font);
  background: var(--pl-dark);
  color: var(--pl-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ======================== CONTAINER ======================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

/* ======================== SECTIONS ======================== */
.pl-section {
  padding: var(--space-24) 0;
}
.pl-section--dark {
  background: var(--pl-dark);
}
.pl-section--mid {
  background: var(--pl-mid);
}
.pl-section--teal {
  background: var(--pl-teal);
}
.pl-section--gradient {
  background: linear-gradient(170deg, var(--pl-teal) 0%, var(--pl-dark) 100%);
}
.pl-section--light {
  background: var(--pl-ghost-light);
}
.pl-section--cream {
  background: linear-gradient(180deg, var(--pl-surface-cream) 0%, var(--pl-surface-light) 100%);
}
.pl-section--compact {
  padding: var(--space-16) 0;
}
.pl-section--flush {
  padding: 0;
}

/* ======================== SECTION HEADERS ======================== */
.pl-section__header {
  text-align: center;
  margin-bottom: var(--space-12);
}
.pl-section__title {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: var(--pl-text-h2);
  line-height: var(--pl-leading-tight);
  margin: 0;
}
.pl-section__title--white { color: var(--pl-white); }
.pl-section__title--dark  { color: var(--pl-dark); }

.pl-section__desc {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: var(--pl-text-body);
  line-height: 1.6;
  max-width: 480px;
  margin: var(--space-2) auto 0;
}
.pl-section__desc--muted { color: var(--pl-carbon); }
.pl-section__desc--light { color: var(--pl-text-muted-dark); }

/* ======================== GRIDS ======================== */
.pl-grid {
  display: grid;
  gap: var(--space-4);
}
.pl-grid--2 { grid-template-columns: repeat(2, 1fr); }
.pl-grid--3 { grid-template-columns: repeat(3, 1fr); }
.pl-grid--4 { grid-template-columns: repeat(4, 1fr); }

.pl-grid--footer {
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--space-12);
}

/* ======================== STEPS LAYOUT ======================== */
.pl-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.pl-steps__item {
  flex: 1;
  padding: var(--space-8) var(--space-6);
  text-align: center;
}
.pl-steps__divider {
  width: 1px;
  align-self: stretch;
  background: rgba(47, 73, 88, 0.15);
  flex-shrink: 0;
  margin: var(--space-6) 0;
}
.pl-steps__num {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  font-size: 2rem;
  line-height: 1;
  margin-bottom: var(--space-3);
}
.pl-steps__num--orange { color: var(--pl-orange); }
.pl-steps__num--blue   { color: var(--pl-blue); }
.pl-steps__num--green  { color: var(--pl-green); }
.pl-steps__title {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: var(--pl-text-h4);
  color: var(--pl-dark);
  margin-bottom: var(--space-2);
}
.pl-steps__desc {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: var(--pl-text-sm);
  color: var(--pl-carbon);
  line-height: var(--pl-leading-normal);
  margin: 0;
}

/* ======================== TWO-COL LAYOUT ======================== */
.pl-two-col {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .pl-two-col { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(28px, 4vw, 48px); }
}

/* ======================== CENTER LAYOUT ======================== */
.pl-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.pl-center--col {
  flex-direction: column;
}
.pl-center--full {
  min-height: 100vh;
}

/* ======================== AUTH PAGE LAYOUT ======================== */
.pl-auth-bg {
  background: radial-gradient(ellipse 80% 60% at 50% 20%, #f7f9fb 60%, #e9eef3 100%);
  min-height: 100vh;
  padding: var(--space-12) 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pl-auth-card {
  max-width: 420px;
  width: 100%;
  background: var(--pl-white);
  border-radius: 2rem;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem 2rem;
}
.pl-auth-card__title {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  font-size: 2rem;
  color: var(--pl-text-dark);
  margin-bottom: var(--space-1);
}
.pl-auth-card__subtitle {
  font-size: 1.1rem;
  color: var(--pl-text-muted);
}

/* ======================== DASHBOARD LAYOUT ======================== */
.pl-dashboard-bg {
  background: linear-gradient(180deg, var(--pl-surface-cream) 0%, var(--pl-surface-light) 100%);
  border-radius: 2rem 2rem 1rem 1rem;
  box-shadow: var(--shadow-md);
  margin: 2.5rem auto 3rem;
  max-width: 1100px;
  padding: 2.5rem 0;
  min-height: 60vh;
}

/* ======================== PROFILE LAYOUT ======================== */
.pl-profile-bg {
  background: radial-gradient(ellipse 120% 120% at 50% 40%, #183153 60%, #0d1a2f 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ======================== LEGAL PAGES ======================== */
.pl-legal {
  padding: var(--space-8) 0 var(--space-24);
}
.pl-legal h1 {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  font-size: var(--pl-text-h1);
  color: var(--pl-white);
  margin-bottom: var(--space-4);
}
.pl-legal h3 {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: var(--pl-text-h3);
  color: var(--pl-white);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}
.pl-legal p,
.pl-legal li {
  font-family: var(--pl-font);
  font-size: var(--pl-text-body);
  color: rgba(255, 255, 255, 0.6);
  line-height: var(--pl-leading-relaxed);
}
.pl-legal ul {
  padding-left: var(--space-5);
}
.pl-legal a {
  color: var(--pl-orange);
  text-decoration: underline;
}
.pl-legal a:hover {
  color: var(--pl-orange-hover);
}

/* ======================== SCROLL REVEALS ======================== */
.pl-reveal {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.pl-reveal.is-visible {
  opacity: 1;
}
.pl-reveal.is-visible .pl-steps__item,
.pl-reveal.is-visible .pl-feature,
.pl-reveal.is-visible .pl-testimonial {
  animation: plFadeIn 0.5s ease both;
}

@keyframes plFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 991px) {
  .pl-steps {
    flex-direction: column;
    max-width: 400px;
    margin: 0 auto;
  }
  .pl-steps__divider {
    width: 60px;
    height: 1px;
    margin: 0 auto;
  }
  .pl-steps__item { padding: var(--space-6); }
  .pl-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .container { padding: 0 var(--space-4); }
  .pl-grid--3 { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .pl-grid--footer { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .pl-dashboard-bg {
    margin: 1rem auto 2rem;
    border-radius: 1.5rem 1.5rem 0.75rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .pl-grid--2 { grid-template-columns: 1fr; }
  .pl-grid--footer { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* ======================== REDUCED MOTION ======================== */
@media (prefers-reduced-motion: reduce) {
  .pl-reveal {
    opacity: 1;
    transition: none;
  }
  .pl-reveal.is-visible .pl-steps__item,
  .pl-reveal.is-visible .pl-feature,
  .pl-reveal.is-visible .pl-testimonial {
    animation: none;
  }
}
