/* =============================================
   CALCULATOR FORGE — Main Stylesheet
   File: assets/css/style.css
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ══ VARIABLES ══ */
:root {
  --primary:      #2563EB;
  --primary-dark: #1D4ED8;
  --secondary:    #1E3A5F;
  --accent:       #C2410C; /* Darkened from #F97316 for WCAG AA contrast */
  --accent-dark:  #9A3412;
  --bg:           #F8FAFF;
  --card:         #FFFFFF;
  --text:         #1E293B;
  --subtext:      #4B5563; /* Darkened from #64748B for WCAG AA contrast */
  --success:      #059669; /* Slightly darkened for better contrast */
  --error:        #DC2626;
  --border:       #E2E8F0;
  --shadow:       0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 10px 24px rgba(0,0,0,0.10);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --transition:   0.2s ease;
  --drawer-w:     285px;
}

/* ══ RESET ══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul  { list-style: none; }
button { cursor: pointer; font-family: 'Inter', sans-serif; border: none; background: none; }
input, textarea, select { font-family: 'Inter', sans-serif; }

/* ══ TYPOGRAPHY ══ */
h1,h2,h3,h4,h5,h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text); line-height: 1.3; font-weight: 700;
}
h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 4vw, 2rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.4rem); }
p  { color: var(--subtext); line-height: 1.7; }

/* ══ CONTAINER ══ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content { flex: 1; }

/* ══════════════════════════════════
   HEADER
══════════════════════════════════ */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 1.25rem;
  color: var(--text); text-decoration: none; flex-shrink: 0;
}
.logo-icon {
  width: 33px; height: 33px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; color: #fff; flex-shrink: 0;
}
.logo .logo-tie { color: var(--accent); }

/* Desktop nav */
.nav-links {
  display: none;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}
.nav-links a {
  color: var(--subtext); font-size: 0.82rem; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: all var(--transition); white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary); background: rgba(37,99,235,0.08);
}

/* Hamburger */
.nav-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 1.3rem;
  transition: background var(--transition);
  background: none; border: none; cursor: pointer;
  flex-shrink: 0; position: relative; z-index: 902;
}
.nav-toggle:hover { background: var(--bg); }

/* ══════════════════════════════════
   SLIDE DRAWER — from RIGHT
══════════════════════════════════ */
/* ══════════════════════════════════
   ULTRA-STRICT SEO COMPONENTS
══════════════════════════════════ */

/* 1. Programmatic Content Engine */
.programmatic-engine {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}

.stat-card:hover { 
  transform: translateY(-3px); 
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: 1.5rem;
  background: rgba(37, 99, 235, 0.08);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.stat-info .stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--subtext);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-info .stat-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

/* 2. Solution Snapshot */
.solution-snapshot {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 40px;
}

.solution-snapshot h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.solution-snapshot p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0;
}

/* 3. Case Study / Real-World Use */
.case-study-block {
  background: var(--card);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin: 40px 0;
  box-shadow: var(--shadow);
}

.case-study-block h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--accent-dark);
}

/* 5. Calculator Meta (SEO Density Enhancement) */
.tool-meta-content, .desc-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 80px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--subtext);
}

@media (max-width: 480px) {
  .container, .tool-meta-content, .desc-section {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.tool-meta-content h2, .tool-meta-content h3,
.desc-section h2, .desc-section h3 {
  margin-top: 50px;
  margin-bottom: 20px;
  color: var(--text);
}

.tool-meta-content p, .desc-section p {
  margin-bottom: 24px;
}

/* ══ MOBILE SAFE ZONE ══ */
@media (max-width: 480px) {
  html, body {
    padding-left: 0;
    padding-right: 0;
  }
  .container, .tool-meta-content, .desc-section, .hero, .info-page, .site-header, .site-footer {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}

.faq-section {
  margin-top: 80px;
  border-top: 2px solid var(--border);
  padding-top: 40px;
}

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

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

.faq-item:first-child { padding-top: 0; }
.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.faq-item h3 .q-num {
  color: var(--primary);
  font-weight: 800;
  background: rgba(37,99,235,0.08);
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: -2px;
}

.faq-item p {
  margin-bottom: 0;
  color: var(--subtext);
  padding-left: 0;
  line-height: 1.75;
}

.drawer-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.50);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.drawer-overlay.active { display: block; opacity: 1; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  width: var(--drawer-w);
  max-width: 88vw;
  height: 100%;
  background: var(--card);
  z-index: 1001;
  box-shadow: -6px 0 28px rgba(0,0,0,0.16);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 60px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer-close {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 1.1rem;
  color: var(--subtext); cursor: pointer;
  background: none; border: none; transition: background var(--transition);
}
.drawer-close:hover { background: var(--bg); color: var(--text); }

.drawer-nav { display: flex; flex-direction: column; padding: 8px; flex: 1; }

.drawer-section-label {
  font-size: 0.67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--subtext); padding: 14px 10px 5px;
}

.drawer-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600;
  color: var(--text); text-decoration: none;
  transition: all var(--transition);
}
.drawer-nav a:hover, .drawer-nav a.active {
  background: var(--bg); color: var(--primary);
}
.drawer-nav a .d-icon { font-size: 1rem; flex-shrink: 0; }

.drawer-foot {
  padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.drawer-foot p { font-size: 0.71rem; color: var(--subtext); text-align: center; }

body.drawer-open { overflow: hidden; }

/* ══════════════════════════════════
   HERO
══════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, #1a4fa0 100%);
  padding: 48px 16px 60px;
  text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(249,115,22,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -40px; left: -40px;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9); font-size: 0.77rem; font-weight: 600;
  padding: 5px 14px; border-radius: 100px; margin-bottom: 18px;
  backdrop-filter: blur(6px);
  max-width: 100%;
  line-height: 1.4;
}
.hero h1 {
  font-weight: 800; color: #fff;
  font-size: clamp(1.7rem, 6vw, 3rem);
  line-height: 1.15; margin-bottom: 12px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-content > p {
  color: rgba(255,255,255,0.75);
  font-size: clamp(0.87rem, 2.5vw, 1.03rem);
  margin-bottom: 26px;
  max-width: 480px; margin-left: auto; margin-right: auto;
}

.search-wrap { position: relative; max-width: 520px; margin: 0 auto 26px; }
.search-bar {
  width: 100%; padding: 15px 65px 15px 25px;
  border-radius: 14px; border: none; font-size: 1rem;
  font-family: 'Inter', sans-serif; background: #fff;
  color: var(--text); box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  line-height: normal;
}
.search-bar::placeholder { color: var(--subtext); }
.search-bar:focus { 
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25), 0 8px 32px rgba(0,0,0,0.22);
}
.search-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--accent); color: #fff; width: 42px; height: 42px;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem;
  border: none; cursor: pointer; transition: background var(--transition);
  z-index: 2;
}
.search-btn:hover { background: var(--accent-dark); }

.hero-stats { 
  display: flex; 
  justify-content: center; 
  gap: 15px 30px; 
  flex-wrap: wrap; 
  margin-top: 32px;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-stat strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem; font-weight: 800; color: #fff;
  line-height: 1.2;
}
.hero-stat span { 
  font-size: 0.78rem; 
  color: rgba(255,255,255,0.7); 
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════
   TRUST BAR
══════════════════════════════════ */
.trust-bar { background: var(--card); border-bottom: 1px solid var(--border); padding: 9px 16px; }
.trust-bar-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 5px 10px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto;
}
.trust-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.74rem; font-weight: 600; color: var(--subtext); white-space: nowrap;
}
.trust-badge .t-icon { font-size: 0.85rem; }
.trust-sep { color: var(--border); font-size: 0.9rem; }

/* ══════════════════════════════════
   CATEGORY TABS
══════════════════════════════════ */
.section-header { margin-bottom: 14px; }
.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 800; color: var(--text); margin-bottom: 2px;
}
.section-sub { font-size: 0.83rem; color: var(--subtext); }

.cat-tabs-wrap {
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 4px;
}
.cat-tabs-wrap::-webkit-scrollbar { display: none; }
.cat-tabs { display: flex; gap: 7px; width: max-content; }

.cat-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 15px; border-radius: 8px;
  font-size: 0.80rem; font-weight: 600; white-space: nowrap;
  cursor: pointer; transition: all var(--transition);
  background: var(--card); color: var(--subtext);
  border: 1.5px solid var(--border);
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 12px rgba(37,99,235,0.2); }

/* ══════════════════════════════════
   TOOLS SECTION — PAGE LAYOUT
══════════════════════════════════ */
.tools-section { padding: 24px 0 52px; }

/*
  TWO COLUMN LAYOUT: grid + sidebar
  On mobile: only 1 column (sidebar hidden)
  On desktop 768px+: content + 300px sidebar
*/
.tools-layout {
  display: block; 
}

/* ══════════════════════════════════
   TOOL CARDS GRID
   THIS IS THE FIX — explicit breakpoints
   no nested grids, no conflicting rules
══════════════════════════════════ */
.tools-grid {
  display: grid;
  gap: 10px;
  /* Default: 2 columns — works on all phones */
  grid-template-columns: repeat(2, 1fr);
}

/* 3 columns from 500px */
@media (min-width: 500px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); gap: 11px; }
}

/* 4 columns from 768px (desktop, left of sidebar) */
@media (min-width: 768px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); gap: 13px; }
}

/* 4 columns from 900px */
@media (min-width: 900px) {
  .tools-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}

/* 4 col still at 1024+ (sidebar takes space) */
@media (min-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(4, 1fr); gap: 15px; }
}

/* ── Calculator card ── */
.tool-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  /* Animation */
  opacity: 0;
  animation: fadeUp 0.3s ease forwards;
}
.tool-card:hover { 
  border-color: var(--primary); 
  box-shadow: var(--shadow-lg); 
  transform: translateY(-5px); 
}

.tool-card.disabled {
  cursor: default;
  opacity: 0.6;
  filter: grayscale(0.5);
  pointer-events: none;
}
.tool-card.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

/* Icon */
.tool-icon {
  width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
  margin-bottom: 2px;
  transition: transform 0.25s ease;
}
.tool-card:hover .tool-icon { transform: scale(1.1) rotate(3deg); }

.icon-pdf   { background: rgba(239,68,68,0.10); color: #ef4444; }
.icon-image { background: rgba(16,185,129,0.10); color: #10b981; }
.icon-text  { background: rgba(37,99,235,0.10); color: #2563eb; }
.icon-math  { background: rgba(249,115,22,0.10); color: #f97316; }
.icon-dev   { background: rgba(139,92,246,0.10); color: #8b5cf6; }
.icon-seo   { background: rgba(20,184,166,0.10); color: #14b8a6; }

/* Name */
.tool-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem; font-weight: 700; color: var(--text);
  line-height: 1.25;
  transition: color var(--transition);
}
.tool-card:hover .tool-name { color: var(--primary); }

/* Description */
.tool-desc {
  font-size: 0.72rem; color: var(--subtext); line-height: 1.4;
}

/* Badges */
.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 8px;
}
.badge {
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 7px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.badge-free { background: rgba(16, 185, 129, 0.08); color: #059669; border: 1px solid rgba(16, 185, 129, 0.15); }
.badge-popular { background: rgba(249, 115, 22, 0.08); color: #ea580c; border: 1px solid rgba(249, 115, 22, 0.15); }
.badge-fast { background: rgba(37, 99, 235, 0.08); color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.15); }
.badge-new { background: rgba(139, 92, 246, 0.08); color: #7c3aed; border: 1px solid rgba(139, 92, 246, 0.15); }
.badge-soon { background: var(--bg); color: var(--subtext); border: 1px solid var(--border); }

/* Card Action */
.card-go {
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.6;
  transition: all var(--transition);
}
.go-arrow {
  transition: transform var(--transition);
}
.tool-card:hover .card-go {
  opacity: 1;
  color: var(--primary-dark);
}
.tool-card:hover .go-arrow {
  transform: translateX(3px);
}

/* ══════════════════════════════════
   HOW IT WORKS
══════════════════════════════════ */
.hiw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 32px;
}
@media (min-width: 768px) {
  .hiw-grid { grid-template-columns: repeat(3, 1fr); }
}
.hiw-item {
  text-align: center;
  position: relative;
}
.hiw-number {
  width: 40px; height: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.hiw-item h4 { margin-bottom: 8px; font-size: 1rem; }
.hiw-item p { font-size: 0.88rem; }

@media (min-width: 768px) {
  .hiw-item:not(:last-child)::after {
    content: '→';
    position: absolute;
    top: 20px;
    right: -12px;
    font-size: 1.5rem;
    color: var(--border);
  }
}

/* No results */
.no-results {
  grid-column: 1 / -1; text-align: center; padding: 40px 16px;
}
.no-results .no-icon { font-size: 2.4rem; margin-bottom: 11px; }
.no-results p { color: var(--subtext); font-size: 0.92rem; }

/* ══════════════════════════════════
   FOOTER
══════════════════════════════════ */
.site-footer { background: var(--secondary); margin-top: auto; }
.footer-main { padding: 44px 16px 28px; max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }

.footer-brand .logo { color: #fff; margin-bottom: 10px; }
.footer-brand .logo-icon {
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
}
.footer-brand p { color: rgba(255,255,255,0.55); font-size: 0.85rem; max-width: 270px; line-height: 1.6; }

.footer-col h4 {
  color: #fff; font-size: 0.80rem; font-weight: 700; margin-bottom: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.footer-col ul { display: flex; flex-direction: column; gap: 7px; }
.footer-col ul li a { color: rgba(255,255,255,0.72); font-size: 0.85rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 15px 16px; max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 9px;
  align-items: center; text-align: center;
}
.footer-bottom p { color: rgba(255,255,255,0.5); font-size: 0.77rem; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: 0.77rem; transition: color var(--transition); }
.footer-links a:hover { color: #fff; }

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600; font-family: 'Inter', sans-serif;
  transition: all var(--transition); cursor: pointer;
  text-decoration: none; white-space: nowrap; border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.3); color: #fff; }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover  { background: var(--accent-dark); transform: translateY(-1px); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 13px 28px; font-size: 0.96rem; border-radius: var(--radius); }
.btn-sm { padding: 6px 13px; font-size: 0.78rem; }

/* ══════════════════════════════════
   TOOL PAGE STYLES
══════════════════════════════════ */
.tool-page-hero {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  padding: 32px 16px 38px; text-align: center;
}
.tool-page-hero h1 { color: #fff; margin-bottom: 7px; }
.tool-page-hero p  { color: rgba(255,255,255,0.72); max-width: 480px; margin: 0 auto; }

.breadcrumb {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.75rem; color: rgba(255,255,255,0.55);
  margin-bottom: 12px; justify-content: center; flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,0.65); }
.breadcrumb a:hover { color: #fff; }

.tool-container {
  background: var(--card); border-radius: var(--radius-lg);
  border: 1.5px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-md); margin-bottom: 22px;
  min-height: 320px; /* Reserve space for tool logic */
}
.tool-head {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; background: var(--bg);
  height: 54px; /* Explicit height */
}
.tool-head .t-icon { font-size: 1.25rem; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.tool-head h2 { font-size: 0.98rem; margin: 0; }
.tool-body { padding: 20px; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center;
  cursor: pointer; transition: all var(--transition); background: var(--bg);
  min-height: 180px; /* Reserve space */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary); background: rgba(37,99,235,0.03);
}
.upload-icon { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.upload-zone p { font-size: 0.875rem; color: var(--subtext); }
.upload-zone strong { color: var(--primary); }

/* ══════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════ */
.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 0.83rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.88rem; color: var(--text); background: var(--card);
  transition: border-color var(--transition); outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ══════════════════════════════════
   ALERTS
══════════════════════════════════ */
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.875rem; display: flex;
  align-items: flex-start; gap: 8px; margin-bottom: 12px;
}
.alert-info    { background: rgba(37,99,235,0.07);  border: 1px solid rgba(37,99,235,0.18);  color: #1d4ed8; }
.alert-success { background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.18); color: #059669; }
.alert-error   { background: rgba(239,68,68,0.07);  border: 1px solid rgba(239,68,68,0.18);  color: #dc2626; }

/* ══════════════════════════════════
   INFO PAGES (about, privacy, terms)
══════════════════════════════════ */
.info-page { max-width: 780px; margin: 0 auto; padding: 44px 16px 60px; }
.info-page h2 { margin: 28px 0 10px; }
.info-page p  { margin-bottom: 12px; font-size: 0.94rem; }

/* ══════════════════════════════════
   FEATURES GRID (homepage)
══════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-top: 22px;
}
@media (min-width: 768px) {
  .features-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
.feature-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px;
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.feature-card .f-icon { 
  font-size: 2rem; margin-bottom: 12px; 
  background: var(--bg);
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  transition: transform var(--transition);
}
.feature-card:hover .f-icon { transform: scale(1.1); }
.feature-card h4 { margin-bottom: 8px; font-size: 1rem; color: var(--text); }
.feature-card p  { font-size: 0.85rem; line-height: 1.6; }

/* ══════════════════════════════════
   SPINNER
══════════════════════════════════ */
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.75s linear infinite; margin: 0 auto;
}
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeUp  {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════
   DESKTOP BREAKPOINTS
══════════════════════════════════ */
@media (min-width: 768px) {
  .container     { padding: 0 24px; }
  .header-inner  { padding: 0 24px; }
  .nav-links     { display: flex; }
  .nav-toggle    { display: none; }
  .footer-grid   { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
  .trust-sep     { display: inline; }
}
@media (min-width: 1024px) {
  .container     { padding: 0 32px; }
  .header-inner  { padding: 0 32px; }
}
@media (max-width: 767px) {
  .trust-sep { display: none; }
}

/* ══════════════════════════════════
   404 / ERROR PAGE
══════════════════════════════════ */
.error-hero {
  background: linear-gradient(135deg, var(--secondary) 0%, #1a4fa0 100%);
  padding: 64px 16px 72px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.error-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(249,115,22,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.error-content { position: relative; z-index: 1; max-width: 540px; }
.error-code {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
  text-shadow: 0 4px 24px rgba(249,115,22,0.3);
}
.error-hero h1 {
  color: #fff;
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 12px;
}
.error-hero p {
  color: rgba(255,255,255,0.72);
  font-size: clamp(0.87rem, 2.5vw, 1rem);
  max-width: 400px;
  margin: 0 auto 24px;
}
.error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.error-actions .btn-outline {
  border-color: rgba(255,255,255,0.4);
  color: #fff !important;
}
.error-actions .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
  color: #fff !important;
}

.error-deco {
  position: relative;
  z-index: 1;
  font-size: clamp(3rem, 10vw, 5rem);
  opacity: 0.25;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.error-links {
  padding: 48px 0 64px;
  text-align: center;
}
.el-title {
  color: var(--subtext);
  font-size: 0.80rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.el-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.el-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.el-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  color: var(--primary);
}
.el-icon { font-size: 1.1rem; flex-shrink: 0; }

@media (min-width: 500px) {
  .el-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .el-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ══════════════════════════════════
   UTILITIES
══════════════════════════════════ */
.text-center  { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-muted   { color: var(--subtext); }
.fw-bold      { font-weight: 700; }
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
/* ══════════════════════════════════
   COOKIE CONSENT BANNER (GDPR)
══════════════════════════════════ */
#cookieConsent {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 720px;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: ccSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ccSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.cc-inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.cc-icon {
  width: 48px; height: 48px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.cc-body { flex: 1; }

.cc-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

#cookieConsent p {
  color: var(--subtext);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

#cookieConsent a { 
  color: var(--primary); 
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-top: 4px;
}

.cc-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  text-align: center;
}

.cc-accept {
  background: var(--primary);
  color: #fff;
}
.cc-accept:hover { background: var(--primary-dark); transform: translateY(-1px); }

.cc-decline {
  background: transparent;
  color: var(--subtext);
  border: 1.5px solid var(--border);
}
.cc-decline:hover { border-color: var(--text); color: var(--text); background: var(--bg); }

.cc-link {
  background: none;
  color: var(--subtext);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 10px 4px;
}
.cc-link:hover { color: var(--primary); }

.cc-fade { opacity: 0; transform: translate(-50%, 10px) !important; transition: all 0.3s ease; }

@media (max-width: 640px) {
  #cookieConsent {
    bottom: 16px;
    padding: 20px;
  }
  .cc-inner {
    flex-direction: column;
    gap: 16px;
  }
  .cc-icon {
    width: 40px; height: 40px;
    font-size: 1.2rem;
  }
  .cc-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cc-btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.8rem;
  }
  .cc-link {
    width: 100%;
    order: 3;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 4px;
  }
  .cc-accept { order: 1; }
  .cc-decline { order: 2; }
}

@media (max-width: 400px) {
  .cc-btn {
    width: 100%;
    flex: none;
  }
  .cc-accept { order: 1; }
  .cc-decline { order: 2; }
}
