/* ============================================================
   DYOR.tax - Base Styles (Dark Theme)
   Nav, footer, typography, global layout
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-100-900.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0a0a0f;
  --bg-card: #0f0f1a;
  --bg-elevated: #1a1a2e;
  --border: #1e1e2e;
  --border-strong: #2d2d3d;
  --text-primary: #f1f5f9;
  --text-secondary: #9ca3af;
  --text-muted: #4b5563;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-hover: #4f46e5;
  --accent-bg: #1e1b4b;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --max-width: 1100px;
  --transition: 0.18s ease;
}

/* ---- Light Theme ---- */
[data-theme="light"] {
  --bg-primary: #f8f9fb;
  --bg-card: #ffffff;
  --bg-elevated: #f1f3f5;
  --border: #e2e5e9;
  --border-strong: #cdd1d6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-hover: #4338ca;
  --accent-bg: #eef2ff;
}

/* Light-mode overrides for elements using hardcoded rgba values */
[data-theme="light"] .site-nav {
  background: rgba(248, 249, 251, 0.92);
  border-bottom-color: var(--border);
}
[data-theme="light"] .nav-dropdown {
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .nav-mobile {
  background: linear-gradient(180deg, rgba(248, 249, 251, 0.98) 0%, #f8f9fb 100%);
}
[data-theme="light"] .nav-mobile .mobile-dropdown-items a {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}
[data-theme="light"] .hero::before {
  opacity: 0;
}
[data-theme="light"] .nav-cta,
[data-theme="light"] .pm-btn-primary,
[data-theme="light"] .uc-btn-primary {
  color: #fff;
}
[data-theme="light"] ::selection {
  background: rgba(79, 70, 229, 0.15);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.staging-banner {
  position: sticky;
  top: 0;
  z-index: 2000;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.55);
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  color: #111827;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

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

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

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

/* ---- Navigation ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--text-primary);
}

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

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links > li {
  position: relative;
}

.nav-links a,
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.nav-links a:hover,
.nav-dropdown-trigger:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-dropdown-trigger .chevron {
  font-size: 10px;
  transition: transform var(--transition);
}

.nav-dropdown-trigger.open .chevron {
  transform: rotate(180deg);
}

/* Dropdown menu */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 9999;
}

.nav-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.nav-dropdown a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-dropdown .dd-label {
  font-size: 0.88rem;
}

.nav-dropdown .dd-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-dropdown .dd-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Dropdown section headers + dividers */
.nav-dropdown .dd-section {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 6px 12px 2px;
}

.nav-dropdown .dd-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* Nav actions group (theme toggle + hamburger) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Language switcher — small EN / BR pill group in the nav.
   Segmented control pattern: current locale is highlighted via .lang-option.active;
   hover/focus reveals the inactive option. Works in both nav-actions (desktop) and
   the mobile menu header. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  margin-right: 6px;
  background: var(--bg-elevated);
  border: 1px solid rgba(129, 140, 248, 0.16);
  border-radius: var(--radius-pill);
}
.lang-switch .lang-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: color var(--transition), background var(--transition);
}
.lang-switch .lang-option:hover { color: var(--text-primary); }
.lang-switch .lang-option.active {
  color: #fff;
  background: var(--accent);
}
[data-theme="light"] .lang-switch {
  background: var(--bg-elevated);
  border-color: rgba(79, 70, 229, 0.18);
}
[data-theme="light"] .lang-switch .lang-option.active {
  color: #fff;
  background: var(--accent);
}

/* Theme toggle */
.theme-toggle {
  background: none; border: none; cursor: pointer;
  line-height: 1;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { color: var(--text-primary); background: var(--bg-elevated); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { display: block; width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* CTA button */
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.nav-hamburger:hover { background: var(--bg-elevated); }
.nav-hamburger:active { transform: scale(0.92); }

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
.nav-mobile {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.98) 0%, #0a0a0f 100%);
  border-top: 1px solid var(--border);
  padding: 20px 18px calc(32px + env(safe-area-inset-bottom));
  z-index: 999;
  overflow-y: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

.nav-mobile a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.nav-mobile a:hover {
  color: var(--text-primary);
}

.nav-mobile .mobile-cta {
  display: block;
  margin-top: 20px;
  padding: 15px 18px;
  text-align: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border: none;
  border-bottom: none;
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.28);
}

.nav-mobile .mobile-dropdown-items {
  padding: 8px 0 14px;
  display: none;
}

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

.nav-mobile .mobile-dropdown-items a {
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.nav-mobile .mobile-dropdown-items a:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.nav-mobile .mobile-dropdown-btn {
  color: var(--text-primary);
  font-weight: 700;
}

.nav-mobile .mobile-dropdown-label {
  display: block;
}

.nav-mobile .mobile-chevron {
  font-size: 13px;
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
}

.nav-mobile .mobile-dropdown-btn.open .mobile-chevron {
  transform: rotate(180deg);
  color: var(--accent-light);
}

.nav-mobile .dd-section {
  display: block;
  margin: 14px 2px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.nav-mobile .dd-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0 8px;
}

.nav-mobile .dd-logo {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex-shrink: 0;
}

.nav-mobile .mobile-dropdown-items a > div {
  min-width: 0;
}

.nav-mobile .dd-label {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.nav-mobile .dd-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Hero Section ---- */
.hero {
  text-align: center;
  padding: 64px 24px 48px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent-light);
  background: var(--accent-bg);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.hero-badge .badge-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  margin-bottom: 16px;
}

.hero h1 .accent {
  color: var(--accent-light);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* Calculator widget wrapper */
.calc-wrap {
  max-width: 640px;
  margin: 0 auto 32px;
}

/* Trust signals row */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ---- Features Row ---- */
.features-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto 64px;
  padding: 0 24px;
}

.feat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
}

.feat-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.feat h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.feat p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Pricing Band ---- */
.pricing-band {
  max-width: var(--max-width);
  margin: 0 auto 64px;
  padding: 48px 24px;
  text-align: center;
}

.pricing-band h2 {
  margin-bottom: 8px;
}

.pricing-band .pricing-sub {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
}

.price-card .tier {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.price-card .price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.price-card.popular {
  border-color: var(--accent);
  background: var(--accent-bg);
}

/* ---- Guide CTA Box ---- */
.guide-cta {
  background: var(--accent-bg);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 24px 0 32px;
}

.guide-cta p {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.guide-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff !important;
  background: var(--accent);
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: background var(--transition), transform var(--transition);
}

.guide-cta-btn:hover {
  background: var(--accent-hover);
  color: #fff !important;
  transform: translateY(-1px);
}

/* ---- SEO Content ---- */
.seo-content {
  max-width: 760px;
  margin: 0 auto 64px;
  padding: 0 24px;
}

.seo-content h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}

.seo-content h3 {
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.seo-content p {
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.seo-content ul, .seo-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.seo-content li {
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.seo-content a {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

/* ---- FAQ Accordion ---- */
.faq {
  max-width: 760px;
  margin: 0 auto 64px;
  padding: 0 24px;
}

.faq h2 {
  text-align: center;
  margin-bottom: 32px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  font-family: inherit;
  gap: 16px;
}

.faq-q:hover {
  color: var(--accent-light);
}

.faq-q .faq-icon {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-a {
  display: block;
  max-height: 500px;
}

.faq-a p {
  padding-bottom: 20px;
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  /* Language switch stays visible in the nav-actions group on mobile so users
     can flip EN ↔ BR without opening the hamburger. Slightly tighter spacing. */
  .lang-switch { margin-right: 4px; padding: 2px; }
  .lang-switch .lang-option { min-width: 26px; padding: 2px 6px; font-size: 0.68rem; }

  .hero { padding: 40px 20px 32px; }
  .hero h1 { font-size: 1.75rem; }
  .hero-sub { font-size: 0.95rem; }

  .features-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-row {
    gap: 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .features-row {
    grid-template-columns: 1fr;
  }

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

  .footer-links {
    gap: 12px 20px;
  }
}
