/* ========== Ledgerly Design System ========== */
:root {
  --navy: #1E2A3B;
  --navy-light: #2A3A52;
  --off-white: #F8F9FA;
  --white: #FFFFFF;
  --teal: #14B8A6;
  --teal-dark: #0D9488;
  --teal-light: #D1FAE5;
  --coral: #F97373;
  --slate: #64748B;
  --slate-light: #94A3B8;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(30, 42, 59, 0.08);
  --shadow-md: 0 4px 12px rgba(30, 42, 59, 0.1);
  --shadow-lg: 0 12px 32px rgba(30, 42, 59, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --container: 1140px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --transition: 0.25s ease;
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--navy);
  background: var(--off-white);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { color: var(--slate); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-2xl) 0;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
}

.section-header h2 {
  margin-bottom: var(--space-sm);
}

.section-header p {
  font-size: 1.1rem;
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
}

.btn-primary:hover {
  background: var(--teal-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-2px);
}

.btn-light {
  background: var(--white);
  color: var(--navy);
}

.btn-light:hover {
  background: var(--teal-light);
  color: var(--teal-dark);
  transform: translateY(-2px);
}

/* ========== Header & Navigation ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  max-width: var(--container);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--navy);
}

.logo svg {
  width: 28px;
  height: 28px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-md);
}

.main-nav a {
  color: var(--slate);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--navy);
  border-bottom-color: var(--teal);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-cta .btn {
  padding: 0.55rem 1.3rem;
  font-size: 0.9rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
  stroke: var(--navy);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav ul {
  list-style: none;
}

.mobile-nav a {
  display: block;
  padding: 0.8rem 0;
  color: var(--navy);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav .btn {
  margin-top: var(--space-sm);
  width: 100%;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  padding: var(--space-2xl) 0;
  background: var(--off-white);
  overflow: hidden;
}

.hero-grid-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(30, 42, 59, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 42, 59, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.hero-badge {
  display: inline-block;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero-subhead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--slate);
  max-width: 540px;
  margin: 0 auto var(--space-lg);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-illustration {
  position: relative;
  max-width: 680px;
  margin: var(--space-xl) auto 0;
  padding: 0 var(--space-md);
}

.hero-illustration svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(30, 42, 59, 0.1));
}

.hero-trust {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--slate-light);
  font-weight: 500;
}

/* ========== Features ========== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal-light);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--teal-dark);
}

.feature-card h3 {
  margin-bottom: var(--space-xs);
}

.feature-card p {
  font-size: 0.95rem;
}

/* ========== How It Works ========== */
.how-it-works {
  background: var(--white);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  position: relative;
}

.step-card {
  text-align: center;
  padding: var(--space-md);
  position: relative;
}

.step-number {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  position: relative;
  z-index: 2;
}

.step-connector {
  position: absolute;
  top: 32px;
  left: calc(50% + 40px);
  right: calc(-50% + 40px);
  height: 2px;
  background: var(--border);
  z-index: 1;
}

.step-card:last-child .step-connector {
  display: none;
}

.step-card h3 {
  margin-bottom: var(--space-xs);
}

.step-card p {
  font-size: 0.95rem;
  max-width: 260px;
  margin: 0 auto;
}

/* ========== Pricing ========== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  align-items: stretch;
}

.pricing-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  box-shadow: var(--shadow-lg);
  transform: scale(1.03);
}

.pricing-card.featured:hover {
  transform: scale(1.03) translateY(-6px);
}

.pricing-card.featured h3,
.pricing-card.featured .price,
.pricing-card.featured .price-period {
  color: var(--white);
}

.pricing-card.featured .feature-list li {
  color: var(--slate-light);
}

.pricing-card.featured .feature-list li::before {
  color: var(--teal);
}

.pricing-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--coral);
  color: var(--white);
  margin-bottom: var(--space-sm);
  align-self: flex-start;
}

.pricing-card h3 {
  margin-bottom: var(--space-sm);
}

.price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.8rem;
  color: var(--navy);
  line-height: 1;
}

.price-period {
  font-size: 0.95rem;
  color: var(--slate);
  margin-bottom: var(--space-md);
}

.feature-list {
  list-style: none;
  margin: var(--space-md) 0;
  flex-grow: 1;
}

.feature-list li {
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-list li::before {
  content: "✓";
  color: var(--teal);
  font-weight: 700;
  flex-shrink: 0;
}

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

.pricing-card.featured .btn-primary {
  background: var(--teal);
}

.pricing-card.featured .btn-primary:hover {
  background: var(--teal-dark);
}

.pricing-note {
  text-align: center;
  margin-top: var(--space-md);
  font-size: 0.9rem;
}

/* ========== Quotes ========== */
.quotes-section {
  background: var(--white);
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.quote-card {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.quote-card:hover {
  box-shadow: var(--shadow-md);
}

.quote-stars {
  color: #F59E0B;
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: var(--space-sm);
}

.quote-text {
  font-style: italic;
  color: var(--navy);
  margin-bottom: var(--space-md);
  font-size: 0.98rem;
}

.quote-author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.quote-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--teal-dark);
  font-family: var(--font-display);
  flex-shrink: 0;
}

.quote-author-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--navy);
}

.quote-author-info span {
  font-size: 0.85rem;
  color: var(--slate);
}

/* ========== FAQ ========== */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  gap: var(--space-sm);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  stroke: var(--teal);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 var(--space-md);
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 var(--space-md) var(--space-md);
}

.faq-answer p {
  font-size: 0.95rem;
}

/* ========== Sign Up ========== */
.signup-section {
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.signup-section::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.12);
}

.signup-section::after {
  content: "";
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(249, 115, 115, 0.08);
}

.signup-card {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.signup-card h2 {
  text-align: center;
  margin-bottom: var(--space-xs);
}

.signup-card > p {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
}

.form-group input {
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.form-group input.error {
  border-color: var(--coral);
}

.form-error {
  font-size: 0.8rem;
  color: var(--coral);
  display: none;
}

.form-group.has-error .form-error {
  display: block;
}

.form-success {
  display: none;
  text-align: center;
  padding: var(--space-md);
  background: var(--teal-light);
  border-radius: var(--radius-md);
  color: var(--teal-dark);
  font-weight: 600;
  margin-top: var(--space-sm);
}

.form-success.show {
  display: block;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--navy);
  color: var(--slate-light);
  padding: var(--space-xl) 0 var(--space-md);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.footer-brand .logo {
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  color: var(--slate-light);
  font-size: 0.9rem;
  max-width: 280px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--slate-light);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--teal);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.85rem;
}

/* ========== Reveal Animations ========== */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

html.js .reveal-delay-1 { transition-delay: 0.1s; }
html.js .reveal-delay-2 { transition-delay: 0.2s; }
html.js .reveal-delay-3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn,
  .feature-card,
  .pricing-card,
  .quote-card {
    transition: none;
  }
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .main-nav,
  .nav-cta .btn-secondary {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .features-grid,
  .steps-grid,
  .pricing-grid,
  .quotes-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .step-connector {
    display: none;
  }
  .pricing-card.featured {
    transform: none;
  }
  .pricing-card.featured:hover {
    transform: translateY(-6px);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .section {
    padding: var(--space-xl) 0;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .signup-card {
    padding: var(--space-md);
  }
}