/* ===================================================================
   LANDING PAGE STYLES
   =================================================================== */

/* ===================================================================
   BETA STRIP
   =================================================================== */

.landing-beta-strip {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.55rem 1rem;
  background: rgba(90, 74, 58, 0.92);
  backdrop-filter: blur(6px);
  font-size: 0.8rem;
  color: rgba(255, 252, 245, 0.92);
  text-align: center;
}

.landing-beta-badge {
  background: #d4a96a;
  color: #3a2a14;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.landing-beta-msg {
  opacity: 0.88;
}

.landing-beta-link {
  color: #f0d5a0;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.landing-beta-link:hover { opacity: 0.75; }

@media (max-width: 480px) {
  .landing-beta-msg { display: none; }
}

/* Landing page container */
.landing-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: var(--parchment);
  /* Same gingham pattern as main app */
  background-image:
    linear-gradient(90deg, rgba(139, 168, 142, 0.15) 50%, transparent 50%),
    linear-gradient(rgba(139, 168, 142, 0.15) 50%, transparent 50%);
  background-size: 70px 70px;
  overflow-y: auto;
  overflow-x: hidden;
  display: none; /* Hidden by default, shown when not authenticated */
}

.landing-page.show {
  display: block;
}

/* Hide app content when landing page is shown */
body.landing-active .site-header,
body.landing-active .sidebar-nav,
body.landing-active .bottom-nav,
body.landing-active .main-content {
  display: none !important;
}

/* ===================================================================
   HERO SECTION
   =================================================================== */

.landing-hero {
  min-height: 100vh;
  min-height: 100dvh; /* Accounts for mobile address bar */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding: env(safe-area-inset-top, 2rem) max(env(safe-area-inset-right), 1rem) 2rem max(env(safe-area-inset-left), 1rem);
  text-align: center;
  position: relative;
}

/* Warm radial gradient overlaid on the gingham — fades from cream centre */
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 38%,
    rgba(255, 248, 240, 0.88) 0%,
    rgba(250, 243, 232, 0.65) 40%,
    rgba(240, 232, 218, 0.3) 70%,
    transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Ensure hero children sit above the gradient overlay */
.landing-hero > * { position: relative; z-index: 1; }

.landing-logo {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
  will-change: transform;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.landing-title {
  font-family: "Caveat", cursive;
  font-size: 3.5rem;
  color: var(--color-header-purple);
  margin-bottom: 0.5rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.08);
}

.landing-tagline {
  font-family: "Caveat", cursive;
  font-size: 1.8rem;
  color: var(--color-accent-olive);
  margin-bottom: 2.5rem;
  font-weight: 600;
}

/* Auth Card Container */
.landing-auth-card {
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid var(--color-header-purple);
  border-radius: 20px;
  overflow: hidden;
  max-width: 420px;
  width: 90%;
  margin: 0 auto 3rem;
  box-shadow: 0 12px 40px rgba(125, 102, 122, 0.15);
  position: relative;
  backdrop-filter: blur(10px);
}

/* Tab buttons */
.landing-auth-tabs {
  display: flex;
  border-bottom: 3px solid var(--color-header-purple);
}

.landing-tab-btn {
  flex: 1;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  color: var(--color-header-purple);
}

.landing-tab-btn:first-child {
  border-right: 1.5px solid var(--color-header-purple);
}

.landing-tab-btn:last-child {
  border-left: 1.5px solid var(--color-header-purple);
}

.landing-tab-btn.active {
  background: var(--color-header-purple);
  color: white;
}

.landing-tab-btn:not(.active):hover {
  background: rgba(125, 102, 122, 0.08);
}

/* Auth panels (get-started / sign-in) */
.landing-auth-panel {
  padding: 2rem 2.5rem;
  animation: fadeIn 0.25s ease;
}

/* Sign-in sub-option buttons */
.landing-signin-options {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.landing-signin-option-btn {
  flex: 1;
  padding: 0.85rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
  border: 2px solid var(--color-accent-olive);
  border-radius: 10px;
  cursor: pointer;
  background: white;
  color: var(--color-accent-olive);
  transition: all 0.2s ease;
}

.landing-signin-option-btn.active,
.landing-signin-option-btn:hover {
  background: var(--color-accent-olive);
  color: white;
}

/* Sub-panels (quick access / password access) */
.landing-auth-subpanel {
  animation: fadeIn 0.2s ease;
}

.landing-auth-subtitle {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.2rem;
  color: var(--color-header-purple);
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-align: center;
}

.landing-auth-hint {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 1rem;
}

.landing-auth-hint-small {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Quick access code input — centered, letter-spaced */
.landing-code-input {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.4rem !important;
  font-weight: 600;
  text-transform: uppercase;
}

/* Auth Form (legacy class kept for safety) */
.landing-auth-form {
  width: 100%;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-auth-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  color: var(--color-header-purple);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.landing-form-group {
  margin-bottom: 1.25rem;
}

.landing-form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

.landing-form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #D4E2D4;
  border-radius: 10px;
  background: var(--parchment);
  color: var(--color-text-primary);
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.landing-form-group input:focus {
  outline: none;
  border-color: var(--color-accent-olive);
  box-shadow: 0 0 0 3px rgba(139, 168, 142, 0.1);
}

/* Password show/hide toggle */
.landing-password-wrap {
  position: relative;
}

.landing-password-wrap input {
  padding-right: 3.5rem;
}

.landing-pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-accent-olive);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.landing-auth-error {
  color: #d32f2f;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
  min-height: 1.2rem;
  font-weight: 500;
}

.landing-auth-panel .landing-btn,
.landing-auth-subpanel .landing-btn {
  width: 100%;
  margin-bottom: 1rem;
}

.landing-auth-toggle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.landing-auth-toggle a {
  color: var(--color-accent-olive);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.landing-auth-toggle a:hover {
  color: var(--color-header-purple);
  text-decoration: underline;
}


.landing-btn {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}

.landing-btn-primary {
  background: var(--color-header-purple);
  color: white;
  border-color: var(--color-header-purple);
}

.landing-btn-primary:hover {
  background: #6a5668;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(125, 102, 122, 0.3);
}

.landing-btn-secondary {
  background: white;
  color: var(--color-header-purple);
  border-color: var(--color-header-purple);
}

.landing-btn-secondary:hover {
  background: var(--color-header-purple);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(125, 102, 122, 0.3);
}

/* Disabled button state */
.landing-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ===================================================================
   FEATURES SECTION
   =================================================================== */

.landing-features {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.landing-section-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.5rem;
  color: var(--color-header-purple);
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 600;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.landing-feature-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
}

/* Triggered by IntersectionObserver adding .visible */
.landing-feature-card.visible {
  animation: fadeInUp 0.6s ease forwards;
}

.landing-feature-card.visible:nth-child(1) { animation-delay: 0.1s; }
.landing-feature-card.visible:nth-child(2) { animation-delay: 0.2s; }
.landing-feature-card.visible:nth-child(3) { animation-delay: 0.3s; }
.landing-feature-card.visible:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--color-accent-olive);
}

.landing-feature-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2rem;
  transition: transform 0.3s ease;
}

/* Per-card icon tints */
.landing-feature-card:nth-child(1) .landing-feature-icon { background: rgba(212, 169, 106, 0.18); }
.landing-feature-card:nth-child(2) .landing-feature-icon { background: rgba(139, 147, 118, 0.18); }
.landing-feature-card:nth-child(3) .landing-feature-icon { background: rgba(125, 102, 122, 0.16); }
.landing-feature-card:nth-child(4) .landing-feature-icon { background: rgba(80, 140, 100, 0.14); }

.landing-feature-card:hover .landing-feature-icon {
  transform: scale(1.08);
}

.landing-feature-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.4rem;
  color: var(--color-header-purple);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.landing-feature-description {
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ===================================================================
   MANIFESTO LINE
   =================================================================== */

.landing-manifesto {
  padding: 2.5rem 2rem 1rem;
  text-align: center;
}

.landing-manifesto-text {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  font-style: italic;
  color: var(--color-text-secondary);
  margin: 0;
  opacity: 0.75;
  letter-spacing: 0.02em;
}

/* ===================================================================
   HOW IT WORKS SECTION
   =================================================================== */

.landing-steps {
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
}

.landing-steps-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.landing-step {
  text-align: center;
  padding: 2rem;
  position: relative;
}

/* Desktop step connectors — dashed line between circles */
@media (min-width: 769px) {
  .landing-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 4rem; /* vertically centres with the 60px circle (2rem padding + 30px radius) */
    right: -1rem;
    width: 2rem;
    height: 0;
    border-top: 2px dashed rgba(125, 102, 122, 0.35);
    pointer-events: none;
  }
}

.landing-step-number {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-header-purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  margin: 0 auto 1.5rem;
  font-family: "Playfair Display", Georgia, serif;
}

.landing-step-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.3rem;
  color: var(--color-header-purple);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.landing-step-description {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ===================================================================
   FOOTER SECTION
   =================================================================== */

.landing-footer {
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(125, 102, 122, 0.05);
}

.landing-footer-cta {
  margin-bottom: 2rem;
}

.landing-footer-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2rem;
  color: var(--color-header-purple);
  margin-bottom: 1rem;
  font-weight: 600;
}

.landing-footer-text {
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.landing-scroll-to-top {
  display: inline-block;
  color: var(--color-accent-olive);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border: 2px solid var(--color-accent-olive);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.landing-scroll-to-top:hover {
  background: var(--color-accent-olive);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 168, 142, 0.3);
}


/* ===================================================================
   MOBILE RESPONSIVE
   =================================================================== */

/* Scroll nudge */
.landing-scroll-nudge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--color-accent-olive);
  margin-top: 1.5rem;
  animation: nudge-bounce 2.4s ease-in-out infinite;
}

.landing-scroll-nudge-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}

.landing-scroll-chevron {
  font-size: 1.4rem;
  line-height: 1;
}

@keyframes nudge-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Section subtitle */
.landing-section-subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  margin-top: -1.75rem;
  margin-bottom: 2.5rem;
}

/* Demo CTA section — bold olive band */
.landing-demo-cta {
  padding: 3.5rem 2rem;
  text-align: center;
  background: #4a5c3d;
}

.landing-demo-cta-inner {
  max-width: 520px;
  margin: 0 auto;
}

.landing-demo-cta-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.9rem;
  color: rgba(255, 252, 240, 0.97);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.landing-demo-cta-text {
  color: rgba(220, 215, 200, 0.88);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.landing-btn-demo {
  background: transparent;
  color: rgba(255, 252, 240, 0.97);
  border-color: rgba(255, 252, 240, 0.6);
  font-size: 1rem;
  padding: 0.85rem 2.25rem;
}
.landing-btn-demo:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 252, 240, 0.95);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* ===================================================================
   GENERIC FADE-IN-UP (IntersectionObserver adds .visible)
   =================================================================== */

.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-up:nth-child(2) { transition-delay: 0.12s; }
.fade-in-up:nth-child(3) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .fade-in-up { opacity: 1; transform: none; transition: none; }
}

/* ===================================================================
   FEEDBACK / BETA SECTION
   =================================================================== */

.landing-feedback {
  padding: 4rem 2rem;
  background: rgba(90, 74, 58, 0.04);
  border-top: 1px solid rgba(139, 147, 118, 0.2);
}

.landing-feedback-inner {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
}

.landing-feedback-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.landing-feedback-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.75rem;
  color: var(--color-header-purple);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.landing-feedback-text {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

.landing-btn-feedback {
  background: white;
  color: var(--color-accent-olive);
  border-color: var(--color-accent-olive);
  font-size: 1rem;
  padding: 0.85rem 2rem;
}

.landing-btn-feedback:hover {
  background: var(--color-accent-olive);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 147, 118, 0.3);
}

/* Footer fine print */
.landing-footer-fine {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
  margin-top: 1.5rem;
}

.landing-footer-fine a {
  color: var(--color-accent-olive);
  text-decoration: none;
}
.landing-footer-fine a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .landing-hero {
    padding: 1.5rem 1rem;
  }

  .landing-title {
    font-size: 2.5rem;
  }

  .landing-tagline {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
  }

  .landing-logo {
    font-size: 3rem;
  }

  .landing-section-title {
    font-size: 1.8rem;
  }

  .landing-features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .landing-steps-container {
    grid-template-columns: 1fr;
  }

  .landing-auth-card {
    max-width: 100%;
    border-width: 2px;
  }

  .landing-auth-panel {
    padding: 1.5rem 1.25rem;
  }

  .landing-auth-title {
    font-size: 1.3rem;
  }

  .landing-form-group input {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .landing-btn {
    padding: 0.85rem 2rem;
  }

  .landing-feature-card {
    padding: 1.5rem;
  }

  .landing-step {
    padding: 1.5rem 1rem;
  }

  .landing-footer-title {
    font-size: 1.5rem;
  }
}

/* ===================================================================
   SPECIAL EFFECTS
   =================================================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .landing-logo,
  .landing-feature-icon,
  .landing-feature-card.visible {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ===================================================================
   DEMO MODE BANNER
   =================================================================== */

.demo-banner {
  background: linear-gradient(135deg, #8a9a5b 0%, #7a8a4b 100%);
  color: white;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10002; /* Above modal (10001) */
  animation: slideDown 0.3s ease; /* slideDown keyframes defined in style.css */
}

.demo-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.demo-banner-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-banner-link {
  color: white;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.demo-banner-link:hover {
  opacity: 0.8;
}

/* Push content down when demo banner is visible */
body.demo-mode-active .site-header {
  margin-top: 50px;
}

body.demo-mode-active .main-content {
  padding-top: 50px;
}

@media (max-width: 768px) {
  .demo-banner {
    font-size: 0.85rem;
    padding: 0.6rem 0.5rem;
  }

  body.demo-mode-active .site-header,
  body.demo-mode-active .main-content {
    margin-top: 40px;
    padding-top: 40px;
  }
}
