/*
 * Public marketing landing page (views/home.php, layout views/layouts/guest.php).
 * Reuses variables.css tokens and the existing card/button/badge/dashboard
 * component classes throughout — this file only adds layout scaffolding
 * and the handful of things genuinely unique to the marketing page.
 */

.landing-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
  }

  .whatsapp-fab {
    transition: none;
  }
}

/* ---------- WhatsApp floating action button ---------- */
.whatsapp-fab {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 70;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.whatsapp-fab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg, var(--shadow-md));
  text-decoration: none;
}

.whatsapp-fab svg {
  width: 28px;
  height: 28px;
}

/* ---------- nav ---------- */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.landing-nav .landing-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brandmark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.brandmark:hover {
  text-decoration: none;
}

.wordmark {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.navlinks a {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.navlinks a:hover {
  color: var(--color-text);
}

.navcta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

@media (max-width: 860px) {
  .navlinks {
    display: none;
  }
}

/*
 * Icon button base (normally lives in layout.css, which neither the guest
 * nor auth layout loads — the header's theme toggle needs it here instead).
 */
.icon-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-text);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: var(--color-bg);
}

/* ---------- buttons: size variant ---------- */
.btn-lg {
  padding: 13px 24px;
  font-size: 1.02rem;
}

/* ---------- hero ---------- */
.landing-hero {
  padding: clamp(48px, 7vw, 88px) 0 32px;
  background:
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.10), transparent 42%),
    radial-gradient(circle at 85% 80%, rgba(14, 165, 233, 0.10), transparent 42%),
    var(--color-bg);
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}

@media (max-width: 960px) {
  .landing-hero-grid {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.landing-hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.4rem);
  margin: 0.8rem 0 1.1rem;
  text-wrap: balance;
}

.landing-lead {
  font-size: 1.08rem;
  max-width: 46ch;
}

.landing-ctas {
  display: flex;
  gap: 0.9rem;
  margin-top: 1.9rem;
  flex-wrap: wrap;
}

/* ---------- hero dashboard preview ---------- */
@keyframes landing-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.dash-preview {
  box-shadow: var(--shadow-lg, var(--shadow-md));
  animation: landing-card-in 0.4s ease;
}

.dash-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.dash-preview-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.dash-preview-sub {
  font-size: 0.78rem;
}

.preview-stat-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: var(--space-5);
}

.preview-stat-grid .stat-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.preview-stat-grid .stat-value {
  font-size: 1.4rem;
}

.preview-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.preview-chart-grid .chart-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.preview-chart-grid h4 {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 var(--space-2);
}

.preview-activity-list {
  margin-top: var(--space-5);
}

.preview-activity-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  font-size: 0.82rem;
}

.preview-activity-time {
  font-size: 0.75rem;
  white-space: nowrap;
}

/* ---------- stat strip ---------- */
.landing-statbar {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.landing-statbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.6rem;
  padding-block: 1rem;
}

.stat-mini {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: baseline;
  gap: 0.4em;
}

.stat-mini b {
  color: var(--color-primary);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- sections ---------- */
.landing-section {
  padding: clamp(56px, 8vw, 96px) 0;
}

.landing-section-alt {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.landing-section-head {
  max-width: 44rem;
  margin-bottom: clamp(28px, 4.5vw, 44px);
}

.landing-section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin: 0.5rem 0 0.9rem;
  text-wrap: balance;
}

.landing-section-head p {
  font-size: 1.02rem;
}

/* ---------- feature grid ---------- */
.modules {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 980px) {
  .modules {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .modules {
    grid-template-columns: 1fr;
  }
}

.module {
  padding: var(--space-5);
}

.module .icon {
  width: 26px;
  height: 26px;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  display: block;
}

.module h3 {
  font-size: 0.98rem;
  margin-bottom: 0.5rem;
}

.module p {
  font-size: 0.88rem;
}

/* ---------- traceability ---------- */
.landing-trace {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

@media (max-width: 920px) {
  .landing-trace {
    grid-template-columns: 1fr;
  }
}

.landing-trace-heading {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  text-wrap: balance;
}

.landing-legend-row {
  margin-top: var(--space-4);
  justify-content: flex-start;
}

.landing-chip-swatch {
  width: 9px;
  height: 9px;
  border: 1px dashed var(--color-border);
  display: inline-block;
  border-radius: 2px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: auto repeat(5, 30px);
  gap: 6px;
  align-items: center;
}

.matrix-grid .rowlabel {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.matrix-grid .collabel {
  font-size: 0.62rem;
  color: var(--color-text-muted);
  text-align: center;
}

.chip {
  width: 30px;
  height: 22px;
  border-radius: var(--radius-sm);
}

.chip.pass {
  background-color: rgba(22, 163, 74, 0.16);
  border: 1px solid var(--color-success);
}

.chip.fail {
  background-color: rgba(220, 38, 38, 0.16);
  border: 1px solid var(--color-danger);
}

.chip.blocked {
  background-color: rgba(245, 158, 11, 0.16);
  border: 1px solid var(--color-warning);
}

.chip.untested {
  background-color: transparent;
  border: 1px dashed var(--color-border);
}

/* ---------- workflow ---------- */
.wf-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 1.3rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--color-border);
}

.wf-step:last-child {
  border-bottom: 1px solid var(--color-border);
}

.wf-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.wf-body h3 {
  font-size: 1.08rem;
  margin-bottom: 0.35rem;
}

/* ---------- governance ---------- */
.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.landing-governance-lead {
  max-width: 60ch;
}

/* ---------- global teams ---------- */
.globalgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 860px) {
  .globalgrid {
    grid-template-columns: 1fr;
  }
}

.globe-item {
  border-top: 3px solid var(--color-primary);
  padding-top: var(--space-3);
}

.globe-item h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.globe-item p {
  font-size: 0.94rem;
}

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

@media (max-width: 900px) {
  .pricing {
    grid-template-columns: 1fr;
  }
}

.plan {
  display: flex;
  flex-direction: column;
}

.plan-featured {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-md);
}

.plan-name {
  font-weight: 700;
  font-size: 1rem;
}

.plan-price {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.5rem 0 0.1rem;
}

.plan-note {
  font-size: 0.78rem;
  margin-bottom: var(--space-5);
}

.plan ul {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.plan li {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  padding-left: 1.1rem;
  position: relative;
}

.plan li::before {
  content: "\2013";
  position: absolute;
  left: 0;
  color: var(--color-primary);
}

/* ---------- final cta ---------- */
.landing-finalcta {
  background-color: var(--color-secondary);
  color: #f1f5f9;
}

.landing-finalcta-row {
  padding-block: clamp(52px, 7vw, 80px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.landing-finalcta h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  max-width: 18ch;
  color: #fff;
  text-wrap: balance;
}

.landing-finalcta p {
  color: #94a3b8;
  margin-top: 0.6rem;
}

.landing-finalcta-signin {
  border-color: #334155;
  color: #f1f5f9;
}

/* ---------- footer ---------- */
.landing-footer {
  padding: 48px 0 36px;
}

.landing-footer-brand {
  margin-bottom: 0.8rem;
  display: inline-flex;
}

.landing-footer-tagline {
  font-size: 0.85rem;
  max-width: 32ch;
}

.footgrid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-5);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 760px) {
  .footgrid {
    grid-template-columns: 1fr 1fr;
  }
}

.footgrid h4 {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.footgrid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footgrid a {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.footgrid a:hover {
  color: var(--color-primary);
}

.footbottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.4rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/*
 * Docs shell — the User Guide hub/sub-pages (views/user-guide/*). A
 * two-column sidebar + content layout, distinct from .auth-shell's
 * single-centered-card design, since the guide is browsed page to page
 * rather than filled in and submitted.
 */
.docs-shell {
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-sidebar a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
}

.docs-sidebar a:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.docs-sidebar a.active {
  color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.08);
  border-left-color: var(--color-primary);
  font-weight: 600;
}

.docs-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.docs-hub-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.docs-hub-card:hover {
  text-decoration: none;
}

.docs-hub-card:hover .card {
  border-color: var(--color-primary);
}

@media (max-width: 760px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2);
  }
}
