/* =======================================================================
   TerraLanding.css (formerly landing.css)
   Shared styles for the public pages: TerraLanding.html (hero + oak tree) and
   TerraLogin.html (account screen). Self-contained: the only font is the app's
   own vendored "Days One" (no external CDN), matching the rest of Terra.
   ======================================================================= */

/* Brand display font, self-hosted (same file the app uses). */
@font-face {
  font-family: 'Days One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../vendor/fonts/daysone-latin.woff2') format('woff2');
}

/* -------- Palette & tokens (dark default) --------
   Very dark grey/near-black surfaces with green accents, matching the app's dark
   default theme. --brand-dark is used as a TEXT colour (headings/hero title), so
   on dark it becomes a light green rather than the old deepest green. */
:root {
  --brand-dark: #9ad3b4; /* light green — used as heading/title TEXT on dark */
  --brand: #3f8b63; /* primary accent (buttons/borders), brightened for dark */
  --brand-hover: #4e9b72;
  --brand-strong: #5aa87d; /* canopy green */
  --page-bg: #101315;
  --surface: #1c2226;
  --text: #e7ece9;
  --muted: #a3aeaa;
  --border: #333b40;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --radius: 12px;
}

/* -------- Light variant --------
   The theme is centralised: a tiny head script on these pages reads the shared
   localStorage preset ('terraThemePreset', set by the app's Settings switcher)
   and sets data-theme="light" for any non-dark choice. Default (unset or 'dark')
   stays the dark :root above. TerraFrontEnd is the only place to change it. */
:root[data-theme='light'] {
  --brand-dark: #01291a;
  --brand: #12524d;
  --brand-hover: #0d3f3b;
  --brand-strong: #2e6b4f;
  --page-bg: #f4f3ef;
  --surface: #ffffff;
  --text: #1c2b26;
  --muted: #5c6b64;
  --border: #dcdfd8;
  --shadow: 0 12px 40px rgba(1, 41, 26, 0.12);
}

/* Light-mode overrides for the few rules that hardcode dark-friendly values. */
:root[data-theme='light'] .auth-input {
  background: #ffffff;
}
:root[data-theme='light'] .auth-message.is-error {
  background: #fdeaea;
  color: #a12b2b;
  border-color: #f3c9c9;
}
:root[data-theme='light'] .auth-message.is-info {
  background: #eaf3ee;
  color: #1f5c40;
  border-color: #cfe6d9;
}

/* -------- Base -------- */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: 'Aptos', 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS',
    system-ui, sans-serif;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* =====================================================================
   Navbar
   ===================================================================== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: 'Days One', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* =====================================================================
   Buttons (shared)
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: clamp(0.95rem, 1.6vmin, 1.1rem);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.btn-solid {
  background: var(--brand);
  color: #fff;
}
.btn-solid:hover {
  background: var(--brand-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-dark);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-lg {
  padding: 0.8rem 1.5rem;
  font-size: clamp(1rem, 1.9vmin, 1.2rem);
}

.btn-block {
  width: 100%;
  margin-top: 0.4rem;
}

/* Icon-only nav buttons (Account = person, Home = house). Square padding; the
   SVG inherits the button's text colour via currentColor, so it works on both
   the solid and ghost button variants. */
.btn-icon {
  padding: 0.5rem;
  line-height: 0;
}

.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

/* =====================================================================
   Hero (TerraLanding.html)
   ===================================================================== */
.hero {
  flex: 1;
  /* Fill the first screen (viewport minus the ~62px nav) so the oak-tree hero is a
     clean "screen 1" and the SEO/marketing content sits BELOW the fold - visitors
     scroll down to reach it. flex:1 still lets it grow on very tall viewports. */
  min-height: calc(100vh - 62px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4rem;
}

/* A subtle "scroll down" cue pinned to the bottom of the hero, linking to the
   first content section. Gently bobs to invite the scroll. */
.hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  display: inline-flex;
  color: var(--muted);
  text-decoration: none;
  animation: heroCueBob 1.8s ease-in-out infinite;
}
.hero-scroll-cue:hover {
  color: var(--brand);
}
.hero-scroll-cue svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes heroCueBob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue {
    animation: none;
  }
}

.hero-inner {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

/* The oak tree emblem: responsive, capped so it stays a sensible size. */
.oak {
  width: min(340px, 70vw);
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
}

.hero-title {
  font-family: 'Days One', sans-serif;
  color: var(--brand-dark);
  font-size: clamp(2.6rem, 8vmin, 4.2rem);
  letter-spacing: 0.04em;
  margin: 0.2rem 0 0.4rem;
}

.hero-tagline {
  color: var(--muted);
  font-size: clamp(1rem, 2.4vmin, 1.25rem);
  margin: 0 auto 1.6rem;
  max-width: 34em;
}

.hero-cta {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* =====================================================================
   Account screen (TerraLogin.html)
   ===================================================================== */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 4rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.75rem 2rem;
}

.auth-brand {
  font-family: 'Days One', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
  text-align: center;
  margin-bottom: 1.1rem;
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--page-bg);
  border-radius: 10px;
  padding: 0.25rem;
  margin-bottom: 1.1rem;
}

.auth-tab {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--brand-dark);
  box-shadow: 0 1px 3px rgba(1, 41, 26, 0.12);
}

/* Forms */
.auth-heading {
  font-size: 1.3rem;
  margin: 0 0 1rem;
  color: var(--text);
}

.auth-help {
  color: var(--muted);
  font-size: 0.95rem;
  margin: -0.4rem 0 1rem;
}

.auth-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0.7rem 0 0.3rem;
}

.auth-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  /* Slightly lighter than the card so the field reads on the dark theme. */
  background: #232a2e;
}
.auth-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18, 82, 77, 0.15);
}

/* Show/hide password: an eye button sitting inside a password field. The input
   gets extra right padding so text never runs under the button. Toggled by
   scripts/login.js, which swaps the input type and adds .is-showing here. */
.auth-input-wrap {
  position: relative;
  display: block;
}
.auth-input-wrap .auth-input {
  padding-right: 2.6rem;
}
.auth-pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
}
.auth-pw-toggle:hover {
  color: var(--brand);
}
.auth-pw-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Default shows the plain eye (password hidden). When the field is revealed,
   .is-showing swaps to the slashed eye. */
.auth-pw-toggle .pw-eye-off {
  display: none;
}
.auth-pw-toggle.is-showing .pw-eye {
  display: none;
}
.auth-pw-toggle.is-showing .pw-eye-off {
  display: inline;
}

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.8rem 0 0.4rem;
  font-size: 0.9rem;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  cursor: pointer;
}

/* A text button styled as a link (used for forgot-password / view switches). */
.auth-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--brand);
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.auth-link:hover {
  text-decoration: underline;
}

.auth-back {
  display: block;
  margin: 0.9rem auto 0;
}

/* Server / validation messages. Hidden until it has text. */
.auth-message {
  margin: 0 0 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}
.auth-message.is-error {
  display: block;
  /* Dark-theme friendly: translucent red tint + light red text. */
  background: rgba(201, 66, 66, 0.16);
  color: #f0a6a6;
  border: 1px solid rgba(201, 66, 66, 0.45);
}
.auth-message.is-info {
  display: block;
  /* Dark-theme friendly: translucent green tint + light green text. */
  background: rgba(63, 139, 99, 0.16);
  color: #9ad3b4;
  border: 1px solid rgba(63, 139, 99, 0.45);
}

/* -------- Small screens -------- */
@media (max-width: 480px) {
  .nav {
    padding: 0.75rem 1rem;
  }
  .hero-cta {
    flex-direction: column;
  }
  .hero-cta .btn {
    width: 100%;
  }
}

/* =====================================================================
   Landing content ("page 2"): the SEO / marketing sections that sit BELOW
   the oak-tree hero on TerraLanding.html. Everything is namespaced .lp-* so it
   can't collide with the hero/auth/nav styles, and it uses the shared Terra
   design tokens above - so it is automatically theme-aware (dark default +
   light variant) rather than carrying its own hardcoded palette.
   ===================================================================== */

/* Section rhythm + optional background variants. */
.lp-section {
  padding: clamp(56px, 9vw, 104px) 0;
  border-top: 1px solid var(--border);
}
.lp-section--soft {
  background: var(--surface);
}
/* Accent band (Benefits + Manifesto): a green gradient with light text in BOTH
   themes, giving the long page a deliberate visual break. */
.lp-section--accent {
  color: #f3f8f5;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  border-top: none;
}

.lp-container {
  width: min(calc(100% - 40px), 1180px);
  margin: 0 auto;
}

/* Small green uppercase label above each section heading. */
.lp-eyebrow {
  margin: 0 0 16px;
  color: var(--brand-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lp-section--accent .lp-eyebrow {
  color: rgba(255, 255, 255, 0.85);
}

/* Headings scale (uses the body sans stack, tightened - no chunky display font). */
.lp-display {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.03;
}
.lp-heading {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.09;
}
.lp-subheading {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: clamp(1.25rem, 2.3vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.lp-section--accent .lp-display,
.lp-section--accent .lp-heading,
.lp-section--accent .lp-subheading {
  color: #ffffff;
}

.lp-lead {
  max-width: 760px;
  margin: 26px 0 0;
  color: var(--text);
  font-size: clamp(1.1rem, 1.9vw, 1.4rem);
  line-height: 1.5;
}
.lp-copy {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}
.lp-section--accent .lp-lead,
.lp-section--accent .lp-copy {
  color: rgba(255, 255, 255, 0.82);
}

.lp-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

/* 2. Belief statement - green left rule. */
.lp-belief {
  max-width: 970px;
}
.lp-belief__statement {
  margin: 34px 0 0;
  padding-left: 26px;
  border-left: 4px solid var(--brand);
  color: var(--text);
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

/* 3. Split (judgement vs automation) + ticked card. */
.lp-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 64px;
  align-items: start;
}
.lp-card {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.lp-card__label {
  margin: 0 0 16px;
  color: var(--brand-strong);
  font-weight: 700;
}
.lp-check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.lp-check-list li {
  position: relative;
  padding: 14px 0 14px 28px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.lp-check-list li:first-child {
  border-top: none;
}
.lp-check-list li::before {
  position: absolute;
  left: 0;
  top: 14px;
  content: '\2713'; /* check mark */
  color: var(--brand-strong);
  font-weight: 700;
}

/* 4/6/7. Card grids (workflow steps, use-cases, audiences). */
.lp-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 54px;
}
.lp-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  margin-top: 54px;
}
.lp-workflow-card {
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.lp-workflow-card__number {
  display: block;
  margin-bottom: 22px;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
}
.lp-workflow-card .lp-copy {
  margin-top: 10px;
}

/* Bordered content card (use-case + audience). */
.lp-tile {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.lp-tile h3 {
  margin: 0 0 0.4rem;
  color: var(--text);
  font-size: 1.2rem;
}
.lp-tile .lp-copy {
  margin-top: 8px;
}
.lp-tag {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(90, 168, 125, 0.14);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* 5. Proof panel - subtle green-tinted band (works in both themes). */
.lp-proof-panel {
  margin-top: 46px;
  padding: 40px;
  border: 1px solid rgba(90, 168, 125, 0.3);
  border-radius: var(--radius);
  background: rgba(90, 168, 125, 0.1);
}
.lp-proof-panel .lp-copy {
  color: var(--text);
  font-size: 1.1rem;
}

/* 8. Benefit cards (inside the accent band) - translucent white. */
.lp-benefit {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}
.lp-benefit h3 {
  margin: 0 0 0.4rem;
  color: #ffffff;
  font-size: 1.2rem;
}
.lp-benefit .lp-copy {
  color: rgba(255, 255, 255, 0.78);
}

/* 9. Manifesto (centred, inside the accent band). */
.lp-manifesto {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}
.lp-manifesto__line {
  margin: 30px 0 0;
  font-size: clamp(1.8rem, 4.6vw, 3.6rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: #ffffff;
}
.lp-manifesto .lp-copy {
  max-width: 760px;
  margin: 26px auto 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.12rem;
}

/* 10. Final CTA row. */
.lp-cta {
  display: flex;
  gap: 48px;
  align-items: center;
  justify-content: space-between;
}
.lp-cta__copy {
  max-width: 830px;
}

/* -------- Landing-content responsiveness -------- */
@media (max-width: 900px) {
  .lp-split,
  .lp-grid-3,
  .lp-grid-2 {
    grid-template-columns: 1fr;
  }
  .lp-split {
    gap: 44px;
  }
  .lp-cta {
    display: grid;
    align-items: start;
  }
}
@media (max-width: 600px) {
  .lp-card,
  .lp-proof-panel,
  .lp-tile,
  .lp-benefit {
    padding: 24px;
  }
  .lp-button-row {
    display: grid;
  }
  .lp-button-row .btn {
    width: 100%;
  }
}
