/* =========================================================
   SmartInvoice AI — Global Styles (shared across all pages)
   ========================================================= */

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Animated background ---------- */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.bg-aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: floatBlob 18s ease-in-out infinite;
}
.bg-aurora span:nth-child(1) {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.55), transparent 70%);
  top: -120px; left: -80px;
}
.bg-aurora span:nth-child(2) {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(14, 165, 164, 0.45), transparent 70%);
  top: 30%; right: -120px;
  animation-delay: -6s;
}
.bg-aurora span:nth-child(3) {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.4), transparent 70%);
  bottom: -140px; left: 30%;
  animation-delay: -11s;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}

.section {
  padding-block: clamp(44px, 10vw, 72px);
}

.section-head {
  max-width: 680px;
  margin: 0 auto clamp(32px, 5vw, 60px);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}

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

h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

.lead {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--text-muted);
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease),
    background 0.25s var(--ease), color 0.25s var(--ease);
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 22px 46px -14px rgba(37, 99, 235, 0.6); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(var(--glass-blur));
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }
.btn-soft {
  background: var(--brand-soft);
  color: var(--brand);
}
.btn-soft:hover { transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }

/* ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.5);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ---------- Glass card ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}

.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 16px;
}
.icon-badge svg { width: 24px; height: 24px; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: box-shadow 0.3s var(--ease);
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand span b { color: var(--brand); }

.nav-links {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 16px 20px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateY(-140%);
  transition: transform 0.4s var(--ease);
}
.nav-links.open { transform: translateY(0); }
.nav-links a {
  padding: 13px 14px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--brand); background: var(--brand-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.3s var(--ease), color 0.2s;
}
.theme-toggle:hover { transform: rotate(-15deg); color: var(--brand); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.nav-burger {
  display: grid;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  place-items: center;
}
.nav-burger svg { width: 22px; height: 22px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding-block: 56px 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.footer h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  padding: 5px 0;
  font-size: 0.93rem;
  transition: color 0.2s, transform 0.2s;
}
.footer-col a:hover { color: var(--brand); transform: translateX(3px); }
.footer-about p { color: var(--text-muted); margin: 14px 0; max-width: 320px; font-size: 0.93rem; }
.footer-bottom {
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 0.88rem;
}
.social {
  display: flex;
  gap: 10px;
}
.social a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s, border-color 0.2s;
}
.social a:hover { color: var(--brand); transform: translateY(-3px); border-color: var(--brand); }
.social svg { width: 18px; height: 18px; }

/* ---------- Ad containers (AdSense reserved) ---------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--grad-soft);
  color: var(--text-subtle);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
}
.ad-slot::after { content: "Advertisement"; opacity: 0.7; }
.ad-desktop { display: none; }
.ad-leaderboard { width: 100%; max-width: 970px; min-height: 90px; margin-block: 28px; }
.ad-inline { width: 100%; max-width: 728px; min-height: 90px; margin-block: 32px; }
.ad-rect { width: 100%; max-width: 336px; min-height: 280px; }
.ad-sidebar { width: 100%; min-height: 600px; }
.ad-mobile { display: flex; width: 100%; min-height: 100px; margin-block: 24px; }
@media (max-width: 720px) {
  .ad-mobile { display: flex; }
  
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.field:focus-within label {
  color: var(--brand);
}
.field input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]), 
.field select, 
.field textarea,
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.field input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]):hover, 
.field select:hover, 
.field textarea:hover,
.input:hover, .select:hover, .textarea:hover {
  border-color: var(--text-subtle);
}
.field input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]):focus, 
.field select:focus, 
.field textarea:focus,
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input:disabled, 
.field select:disabled, 
.field textarea:disabled,
.input:disabled, .select:disabled, .textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg);
  border-color: var(--border);
}
/* Error state using HTML5 constraint validation */
.field input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]):invalid:not(:placeholder-shown):not(:focus),
.field textarea:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.textarea { resize: vertical; min-height: 90px; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  animation: toastIn 0.4s var(--ease);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--brand); }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Loading screen ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-inner { display: grid; place-items: center; gap: 20px; }
.loader-mark {
  width: 60px; height: 60px;
  border-radius: 18px;
  background: var(--grad-brand);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: var(--shadow-brand);
  animation: pulseMark 1.4s var(--ease) infinite;
}
.loader-mark svg { width: 32px; height: 32px; }
.loader-bar {
  width: 160px; height: 5px;
  border-radius: 99px;
  background: var(--border-strong);
  overflow: hidden;
}
.loader-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: var(--grad-brand);
  animation: loaderSlide 1.1s var(--ease) infinite;
}

/* ---------- Page transition veil ---------- */
#veil {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
#veil.show { opacity: 1; visibility: visible; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-subtle);
  padding-block: 18px;
}
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs span { opacity: 0.6; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding-block: clamp(40px, 6vw, 72px);
  text-align: center;
}
.page-hero p { max-width: 640px; margin: 16px auto 0; }

/* ---------- Prose (legal / content pages) ---------- */
.prose { max-width: 780px; margin-inline: auto; }
.prose h2 { margin-top: 40px; margin-bottom: 12px; }
.prose h3 { margin-top: 26px; margin-bottom: 8px; }
.prose p, .prose li { color: var(--text-muted); margin-bottom: 12px; }
.prose ul { padding-left: 22px; list-style: disc; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose strong { color: var(--text); }

/* =========================================================
   Home page sections
   ========================================================= */
.hero {
  position: relative;
  padding-block: clamp(40px, 7vw, 90px) clamp(30px, 5vw, 60px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.hero-badge b {
  background: var(--grad-brand);
  color: #fff;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
}
.hero h1 { margin-bottom: 18px; }
.hero h1 .grad {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-cta { display: flex; flex-direction: column; width: 100%; gap: 14px; margin-top: 30px; }
.hero-trust {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 30px;
  color: var(--text-subtle);
  font-size: 0.86rem;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust svg { width: 16px; height: 16px; color: var(--success); }

.hero-visual { position: relative; order: -1; max-width: 520px; margin-inline: auto; }
.hero-visual img {
  width: 100%;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}
.hero-chip {
  display: none;
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
}
.hero-chip small { display: block; font-weight: 500; color: var(--text-subtle); font-size: 0.72rem; }
.hero-chip .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.hero-chip .dot svg { width: 18px; height: 18px; }
.hero-chip.one { top: 8%; left: -18px; }
.hero-chip.two { bottom: 10%; right: -14px; }

/* Feature grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.feature p { color: var(--text-muted); font-size: 0.93rem; margin-top: 8px; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  text-align: center;
}
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat p { color: var(--text-muted); margin-top: 4px; font-size: 0.9rem; }

/* How it works */
.steps { counter-reset: step; }
.step-num {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 800;
  margin-bottom: 16px;
}

/* Coming soon tools */
.tool-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.tool-chip:hover { transform: translateY(-4px); border-color: var(--brand); }
.tool-chip .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.tool-chip .ico svg { width: 20px; height: 20px; }
.tool-chip b { font-size: 0.95rem; }
.tool-chip .soon { margin-left: auto; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); background: rgba(14,165,164,0.12); padding: 4px 8px; border-radius: 99px; }

/* Testimonials */
.quote p { font-size: 1rem; color: var(--text); line-height: 1.6; }
.quote .who { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.quote .who .av { width: 42px; height: 42px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.quote .who b { display: block; font-size: 0.9rem; }
.quote .who span { font-size: 0.8rem; color: var(--text-subtle); }
.stars { color: #f59e0b; display: flex; gap: 2px; margin-bottom: 12px; }
.stars svg { width: 16px; height: 16px; }

/* FAQ accordion */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}
.faq-q .chev { transition: transform 0.3s var(--ease); flex-shrink: 0; }
.faq-q .chev svg { width: 20px; height: 20px; color: var(--brand); }
.faq-item.open .chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); }
.faq-a p { padding: 0 20px 18px; color: var(--text-muted); }

/* Blog preview */
.post-card { overflow: hidden; padding: 0; }
.post-card .thumb { height: 150px; background: var(--grad-brand); display: grid; place-items: center; color: rgba(255,255,255,0.9); }
.post-card .thumb svg { width: 42px; height: 42px; }
.post-card .body { padding: 20px; }
.post-card .tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand); }
.post-card h3 { font-size: 1.05rem; margin: 8px 0; }
.post-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Newsletter / CTA band */
.cta-band {
  text-align: center;
  padding: clamp(40px, 6vw, 70px);
  border-radius: var(--radius-xl);
  background: var(--grad-brand);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 560px; margin: 14px auto 26px; }
.newsletter {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin-inline: auto;
  flex-wrap: wrap;
}
.newsletter input {
  flex: 1;
  min-width: 200px;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 0.95rem;
}
.newsletter .btn { background: #0b1120; color: #fff; }

