/* ==========================================================================
   FreeInvoice.store — Production SaaS Stylesheet
   Author: Muhammad Rameez Tariq
   Clean, Human-Crafted UI/UX • Mobile-First • Print & PDF Engineered
   ========================================================================== */

/* Instant System Font Stack - Zero External Blocking Requests */

:root {
  --brand: #0f766e;
  --brand-hover: #115e59;
  --brand-soft: #f0fdfa;
  --brand-border: #99f6e4;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
}

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

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

body {
  margin: 0;
  padding: 0 0 76px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--slate-50);
  color: var(--slate-700);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Navigation */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--slate-900);
  letter-spacing: -0.4px;
  flex-shrink: 0;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.brand span.tld {
  color: var(--brand);
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: var(--slate-600);
  font-weight: 500;
  font-size: 14px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--slate-900);
  background: var(--slate-100);
}

.nav-link.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.nav-link.blog-link {
  border: 1px solid var(--slate-200);
  color: var(--slate-800);
  font-weight: 600;
  margin-left: 4px;
}
.nav-link.blog-link:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* Mobile Hamburger Button */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: var(--slate-800);
  cursor: pointer;
  padding: 0;
}

.mobile-nav {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: 12px 16px 18px;
  box-shadow: var(--shadow-md);
}
.mobile-nav.open {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mobile-nav .nav-link {
  padding: 10px 12px;
  border: 1px solid var(--slate-100);
  background: var(--slate-50);
  font-size: 13.5px;
}
.mobile-nav .nav-link.active {
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

/* Page Header / Hero */
.page-header {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--slate-200);
  margin-bottom: 24px;
  background: var(--white);
}
.page-header-inner {
  max-width: 820px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--brand);
  margin-bottom: 6px;
}
.page-header h1 {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  color: var(--slate-900);
  margin: 0 0 8px;
  letter-spacing: -0.5px;
  line-height: 1.25;
}
.page-header p {
  font-size: 15.5px;
  color: var(--slate-600);
  margin: 0;
}

/* AdSense Placement Container */
.ad-slot {
  background: var(--white);
  border: 1px dashed var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 18px auto;
  text-align: center;
  color: var(--slate-400);
  font-size: 12px;
  font-weight: 500;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cards & Grids */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--slate-100);
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* Form Elements */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--slate-900);
  background: var(--white);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
input[type="file"].form-control {
  padding: 7px 10px;
  background: var(--slate-50);
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: center;
  line-height: 1.3;
}
.btn-primary {
  background: var(--brand);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--brand-hover);
  color: var(--white);
}
.btn-dark {
  background: var(--slate-900);
  color: var(--white);
}
.btn-dark:hover {
  background: var(--slate-800);
  color: var(--white);
}
.btn-outline {
  background: var(--white);
  color: var(--slate-700);
  border-color: #cbd5e1;
}
.btn-outline:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
  color: var(--slate-900);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecaca;
}
.btn-danger:hover {
  background: #fee2e2;
}
.btn-block {
  width: 100%;
}

/* Stat Boxes */
.stat-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}

/* Internal Linking Directory */
.tools-hub {
  margin: 36px 0;
}
.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}
.section-subtitle {
  color: var(--slate-600);
  margin: 0 0 20px;
  font-size: 14.5px;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tool-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.tool-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-900);
}
.tool-card p {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--slate-600);
  flex-grow: 1;
}
.tool-card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

/* SEO Article Content */
.seo-article {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 32px;
}
.seo-article h2 {
  font-size: 24px;
  color: var(--slate-900);
  margin-top: 0;
  margin-bottom: 14px;
  letter-spacing: -0.4px;
}
.seo-article h3 {
  font-size: 18.5px;
  color: var(--slate-900);
  margin-top: 24px;
  margin-bottom: 10px;
}
.seo-article p {
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--slate-700);
}
.seo-article ul, .seo-article ol {
  margin-bottom: 18px;
  padding-left: 22px;
}
.seo-article li {
  margin-bottom: 7px;
  font-size: 15px;
}
.highlight-box {
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}
.highlight-box h4 {
  margin: 0 0 6px;
  color: var(--slate-900);
  font-size: 15.5px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.faq-item {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  padding: 16px 18px;
}
.faq-item h4 {
  margin: 0 0 6px;
  font-size: 15.5px;
  color: var(--slate-900);
}
.faq-item p {
  margin: 0;
  font-size: 14.5px;
  color: var(--slate-600);
}

/* Footer */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 48px 0 32px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}
.footer-brand {
  color: var(--white);
  font-size: 19px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.footer-col h4 {
  color: var(--white);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 14px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  color: var(--slate-400);
  font-size: 14px;
}
.footer-links a:hover {
  color: var(--white);
}
.footer-bottom {
  border-top: 1px solid var(--slate-800);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

/* Sticky Bottom Ad */
.sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  z-index: 90;
  padding: 6px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.sticky-ad-close {
  position: absolute;
  top: 4px;
  right: 10px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .grid-2, .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .mobile-nav.open {
    grid-template-columns: 1fr;
  }
  .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .card, .seo-article {
    padding: 16px;
  }
  .page-header {
    padding: 20px 0 16px;
  }
}
