/* SmartLeftovers v2 — Branded Legal & Launch Web Stylesheet
 * Tokens sourced from design/tokens.json (Option 1 Rounded: Nunito ExtraBold + Plus Jakarta Sans)
 */

:root {
  --bg-canvas: #FAF8F4;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F2EFE9;
  --bg-inverse: #171917;
  --bg-hero: #1B7F5C;

  --text-primary: #171917;
  --text-secondary: #5C635D;
  --text-muted: #8F968F;
  --text-on-brand: #FFFFFF;
  --text-on-accent: #FFFFFF;
  --text-on-hero: #FFFFFF;
  --text-on-inverse: #FAF8F4;

  --brand-primary: #1B7F5C;
  --brand-primary-soft: #E6F4EE;
  --brand-primary-ink: #14664A;
  --brand-accent: #E86A33;
  --brand-accent-strong: #C4531F;
  --brand-accent-soft: #FDEEE7;
  --brand-accent-ink: #B4481A;

  --status-fresh: #1B7F5C;
  --status-fresh-soft: #E6F4EE;
  --status-fresh-ink: #14664A;
  --status-expiring: #D97706;
  --status-expiring-soft: #FEF3E2;
  --status-expiring-ink: #9A5806;
  --status-urgent: #DC2626;
  --status-urgent-soft: #FDECEC;
  --status-urgent-ink: #B42318;

  --border-subtle: #E8E4DC;
  --border-strong: #D6D0C4;
  --header-glass: rgba(250, 248, 244, 0.86);

  --shadow-card: 0 2px 12px rgba(43, 36, 26, 0.06);
  --shadow-float: 0 12px 32px rgba(43, 36, 26, 0.10);
  --shadow-cta: 0 6px 18px rgba(196, 83, 31, 0.28);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --font-display: 'Nunito', ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-canvas: #0F1210;
    --bg-surface: #181C19;
    --bg-subtle: #232924;
    --bg-inverse: #F5F4F0;
    --bg-hero: #143B2E;

    --text-primary: #F5F4F0;
    --text-secondary: #A2ABA3;
    --text-muted: #7D867E;
    --text-on-brand: #0F1210;
    --text-on-accent: #0F1210;
    --text-on-hero: #F5F4F0;
    --text-on-inverse: #171917;

    --brand-primary: #34D399;
    --brand-primary-soft: #16332A;
    --brand-primary-ink: #6EE7B7;
    --brand-accent: #F5834F;
    --brand-accent-strong: #F5834F;
    --brand-accent-soft: #3A2218;
    --brand-accent-ink: #FDBA8C;

    --status-fresh: #34D399;
    --status-fresh-soft: #16332A;
    --status-fresh-ink: #6EE7B7;
    --status-expiring: #FBBF24;
    --status-expiring-soft: #33270F;
    --status-expiring-ink: #FCD34D;
    --status-urgent: #F87171;
    --status-urgent-soft: #3A1A1A;
    --status-urgent-ink: #FCA5A5;

    --border-subtle: #2A312B;
    --border-strong: #3A423B;
    --header-glass: rgba(15, 18, 16, 0.86);

    --shadow-card: none;
    --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-cta: 0 6px 18px rgba(245, 131, 79, 0.25);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-top: 0;
  color: var(--text-primary);
}

a {
  color: var(--brand-primary-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

a:hover {
  opacity: 0.85;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* Language switching visibility */
html[lang="en"] [data-lang="es"],
html[lang="es"] [data-lang="en"] {
  display: none !important;
}

/* Container */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.container--narrow {
  max-width: 780px;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  display: block;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-name span {
  color: var(--brand-primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
}

.nav-links a[aria-current="page"] {
  color: var(--brand-primary-ink);
}

/* Language Switcher */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-btn[aria-pressed="true"] {
  background: var(--bg-inverse);
  color: var(--text-on-inverse);
}

/* Badges & Pills */
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--brand-primary-soft);
  color: var(--brand-primary-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.eyebrow-pill--accent {
  background: var(--brand-accent-soft);
  color: var(--brand-accent-ink);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill--urgent {
  background: var(--status-urgent-soft);
  color: var(--status-urgent-ink);
}

.status-pill--expiring {
  background: var(--status-expiring-soft);
  color: var(--status-expiring-ink);
}

.status-pill--fresh {
  background: var(--status-fresh-soft);
  color: var(--status-fresh-ink);
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

.btn--primary {
  background: var(--brand-accent-strong);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-cta);
}

.btn--emerald {
  background: var(--brand-primary);
  color: var(--text-on-brand);
}

.btn--dark {
  background: var(--bg-inverse);
  color: var(--text-on-inverse);
}

.btn--outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-sub {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.btn-sub small {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

/* Landing Hero */
.hero {
  padding: 56px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 1.08;
  margin-bottom: 18px;
}

.hero-highlight {
  color: var(--brand-primary);
}

.hero-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 28px;
  max-width: 540px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Mockup Preview Card on Landing */
.preview-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-savings-card {
  background: var(--bg-hero);
  color: var(--text-on-hero);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-float);
  position: relative;
  overflow: hidden;
}

.hero-savings-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.hero-savings-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.hero-savings-amount {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 4px 0 2px;
}

.hero-savings-sub {
  font-size: 14px;
  opacity: 0.9;
}

.mascot-badge {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.radar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.radar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.radar-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.radar-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Sections & Grids */
.section {
  padding: 48px 0;
}

.section--tight {
  padding: 32px 0;
}

.section-header {
  max-width: 640px;
  margin-bottom: 30px;
}

.section-header h2 {
  font-size: clamp(26px, 3.2vw, 34px);
  margin-bottom: 10px;
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary-ink);
}

.card-icon--accent {
  background: var(--brand-accent-soft);
  color: var(--brand-accent-ink);
}

.card-icon--amber {
  background: var(--status-expiring-soft);
  color: var(--status-expiring-ink);
}

.card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

/* Pricing / Trial Banner */
.pricing-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.price-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-tier {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.price-tier--featured {
  border-color: var(--brand-primary);
  background: var(--brand-primary-soft);
}

.price-tier strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.price-tier .amount {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-primary-ink);
}

/* Legal & Content Pages */
.doc-hero {
  padding: 44px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 32px;
}

.doc-hero h1 {
  font-size: clamp(30px, 4vw, 40px);
  margin-bottom: 10px;
}

.doc-meta {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.prose {
  padding-bottom: 56px;
}

.prose h2 {
  font-size: 23px;
  margin-top: 34px;
  margin-bottom: 12px;
  padding-top: 8px;
}

.prose h3 {
  font-size: 18px;
  margin-top: 22px;
  margin-bottom: 8px;
}

.prose p,
.prose li {
  color: var(--text-primary);
  font-size: 15.5px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
  margin: 10px 0 18px;
}

.prose li {
  margin-bottom: 8px;
}

/* Callouts */
.callout {
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin: 22px 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.callout--emerald {
  background: var(--brand-primary-soft);
  border-color: transparent;
}

.callout--warning {
  background: var(--status-expiring-soft);
  border-color: transparent;
}

.callout--urgent {
  background: var(--status-urgent-soft);
  border-color: transparent;
}

.callout-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout--emerald .callout-title { color: var(--brand-primary-ink); }
.callout--warning .callout-title { color: var(--status-expiring-ink); }
.callout--urgent .callout-title { color: var(--status-urgent-ink); }

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 18px 0 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

th {
  background: var(--bg-subtle);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: 0;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

details.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

details.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-primary-ink);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

details.faq-item[open] summary::after {
  content: "−";
}

details.faq-item .faq-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 15px;
}

details.faq-item .faq-body p:last-child {
  margin-bottom: 0;
}

/* Forms (Delete Account Helper) */
.form-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: grid;
  gap: 10px;
}

.step-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--brand-primary);
  color: var(--text-on-brand);
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Entity Legal Block */
.legal-entity-box {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-size: 14.5px;
  margin: 18px 0;
}

.legal-entity-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0 44px;
  margin-top: 32px;
  background: var(--bg-surface);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--brand-primary-ink);
}

.footer-copy {
  width: 100%;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Responsive */
@media (max-width: 860px) {
  .hero-grid,
  .pricing-card {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 34px 0 28px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .pricing-card {
    padding: 22px;
  }
}

@media print {
  .site-header,
  .lang-toggle,
  .btn-row {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
}
