/* ============================================================
   PDFAlia — Main Stylesheet
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:        #4F46E5;
  --primary-dark:   #3730A3;
  --primary-light:  #818CF8;
  --bg:             #F9FAFB;
  --bg-white:       #FFFFFF;
  --border:         #E5E7EB;
  --border-dark:    #D1D5DB;
  --text:           #111827;
  --text-muted:     #6B7280;
  --text-light:     #9CA3AF;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:         0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08);
  --transition:     .18s ease;

  /* Tool colors */
  --red:    #EF4444; --red-bg:    #FEF2F2;
  --orange: #F97316; --orange-bg: #FFF7ED;
  --amber:  #F59E0B; --amber-bg:  #FFFBEB;
  --yellow: #EAB308; --yellow-bg: #FEFCE8;
  --green:  #10B981; --green-bg:  #ECFDF5;
  --teal:   #14B8A6; --teal-bg:   #F0FDFA;
  --cyan:   #06B6D4; --cyan-bg:   #ECFEFF;
  --blue:   #3B82F6; --blue-bg:   #EFF6FF;
  --indigo: #6366F1; --indigo-bg: #EEF2FF;
  --violet: #8B5CF6; --violet-bg: #F5F3FF;
  --purple: #A855F7; --purple-bg: #FAF5FF;
  --pink:   #EC4899; --pink-bg:   #FDF2F8;
  --gray:   #6B7280; --gray-bg:   #F3F4F6;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }
details summary { cursor: pointer; }

/* ── Accessibility ─────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container.narrow { max-width: 760px; }

/* ── HEADER ────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }

/* ── Main Nav ──────────────────────────────────────────────── */
.main-nav { flex: 1; }
.main-nav > ul {
  display: flex;
  gap: .25rem;
  align-items: center;
}
.has-dropdown { position: relative; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .75rem;
  border: none;
  background: transparent;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-btn:hover, .nav-btn[aria-expanded="true"] {
  background: var(--bg);
  color: var(--text);
}
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: .5rem;
  z-index: 200;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { display: block; }
.dropdown a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  font-size: .875rem;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.dropdown a:hover { background: var(--bg); text-decoration: none; }
.tool-icon-sm {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tool-icon-sm svg { width: 16px; height: 16px; }

/* ── Header actions ────────────────────────────────────────── */
.header-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }

/* ── Language Switcher ─────────────────────────────────────── */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 150px;
  padding: .5rem;
  z-index: 300;
}
.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown { display: block; }
.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  font-size: .875rem;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.lang-dropdown a:hover { background: var(--bg); text-decoration: none; }
.lang-dropdown [aria-selected="true"] { font-weight: 600; color: var(--primary); }

/* ── Mobile menu btn ───────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: none;
  background: none;
}
.mobile-menu-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform var(--transition);
}

/* ── HERO (home) ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  color: white;
  padding: 4.5rem 0 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.hero-sub {
  font-size: 1.1rem;
  opacity: .9;
  max-width: 560px;
  margin: 0 auto 1.5rem;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 3rem;
}
.badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: white;
  padding: .3rem .85rem;
  border-radius: 999px;
  font-size: .82rem;
  backdrop-filter: blur(4px);
}
.hero-wave { line-height: 0; margin-top: -1px; }
.hero-wave svg { width: 100%; height: 60px; }

/* ── TOOLS SECTION ─────────────────────────────────────────── */
.tools-section { padding: 2.5rem 0 3rem; }
.tools-category { margin-bottom: 2.5rem; }
.category-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}
.cat-icon { width: 18px; height: 18px; color: var(--primary); }

/* ── Tool Grid ─────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.tools-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ── Tool Card ─────────────────────────────────────────────── */
.tool-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--tool-color, var(--primary));
}
.tool-card-link {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.tool-card-link:hover { text-decoration: none; }
.tool-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--tool-bg, var(--indigo-bg));
  color: var(--tool-color, var(--indigo));
}
.tool-card-icon svg { width: 22px; height: 22px; }
.tool-card-body { flex: 1; min-width: 0; }
.tool-card-body h3 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: .2rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-card-body p {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-card-arrow {
  flex-shrink: 0;
  width: 18px; height: 18px;
  color: var(--text-light);
  margin-top: 2px;
}
.tool-card-sm .tool-card-link { padding: .9rem; }
.tool-card-sm .tool-card-icon { width: 38px; height: 38px; }
.tool-card-sm .tool-card-icon svg { width: 18px; height: 18px; }
.tool-card-sm .tool-card-body h3 { font-size: .85rem; }

/* ── Color variants for cards ──────────────────────────────── */
.color-red    { --tool-color: var(--red);    --tool-bg: var(--red-bg); }
.color-orange { --tool-color: var(--orange); --tool-bg: var(--orange-bg); }
.color-amber  { --tool-color: var(--amber);  --tool-bg: var(--amber-bg); }
.color-yellow { --tool-color: var(--yellow); --tool-bg: var(--yellow-bg); }
.color-green  { --tool-color: var(--green);  --tool-bg: var(--green-bg); }
.color-teal   { --tool-color: var(--teal);   --tool-bg: var(--teal-bg); }
.color-cyan   { --tool-color: var(--cyan);   --tool-bg: var(--cyan-bg); }
.color-blue   { --tool-color: var(--blue);   --tool-bg: var(--blue-bg); }
.color-indigo { --tool-color: var(--indigo); --tool-bg: var(--indigo-bg); }
.color-violet { --tool-color: var(--violet); --tool-bg: var(--violet-bg); }
.color-purple { --tool-color: var(--purple); --tool-bg: var(--purple-bg); }
.color-pink   { --tool-color: var(--pink);   --tool-bg: var(--pink-bg); }
.color-gray   { --tool-color: var(--gray);   --tool-bg: var(--gray-bg); }

/* ── HOW IT WORKS ──────────────────────────────────────────── */
.how-section {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0;
}
.how-section h2,
.features-section h2,
.howto-section h2,
.faq-section h2,
.related-section h2 {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 2.5rem;
}
.steps-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.step {
  flex: 1;
  min-width: 180px;
  max-width: 260px;
  text-align: center;
  position: relative;
}
.step-num {
  width: 36px; height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  margin: 0 auto .75rem;
}
.step-icon {
  width: 72px; height: 72px;
  margin: 0 auto .75rem;
  color: var(--primary);
}
.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; }
.step p  { font-size: .88rem; color: var(--text-muted); }
.step-connector {
  font-size: 1.5rem;
  color: var(--text-light);
  margin-top: 2.5rem;
  align-self: flex-start;
}

/* ── FEATURES ──────────────────────────────────────────────── */
.features-section { padding: 3.5rem 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.feature-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.feature-card p  { font-size: .875rem; color: var(--text-muted); }

/* ── TOOL HERO (tool page) ─────────────────────────────────── */
.tool-hero {
  background: linear-gradient(135deg, var(--tool-color, var(--primary)), color-mix(in srgb, var(--tool-color, var(--primary)) 70%, #000));
  color: white;
  padding: 2rem 0 2.5rem;
}
.breadcrumb { margin-bottom: 1.25rem; }
.breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .82rem;
  opacity: .8;
}
.breadcrumb a { color: white; opacity: .75; }
.breadcrumb a:hover { opacity: 1; }
.breadcrumb .sep { opacity: .5; margin: 0 .1rem; }
.tool-hero-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.tool-hero-icon {
  width: 72px; height: 72px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.tool-hero-icon svg { width: 36px; height: 36px; color: white; }
.tool-hero h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; }
.tool-hero-desc { font-size: 1rem; opacity: .88; margin-top: .35rem; max-width: 520px; }

/* ── UPLOAD SECTION ────────────────────────────────────────── */
.upload-section { padding: 2rem 0 3rem; }
.tool-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 0 auto;
}

/* ── Drop Zone ─────────────────────────────────────────────── */
.drop-zone {
  border: 2.5px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--indigo-bg);
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-zone-icon {
  width: 64px; height: 64px;
  margin: 0 auto .75rem;
  color: var(--primary);
  opacity: .7;
}
.drop-zone-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .25rem;
}
.drop-zone-sub { font-size: .875rem; color: var(--text-muted); margin-bottom: .5rem; }
.drop-zone-formats {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .2rem .75rem;
  font-size: .78rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* ── File List ─────────────────────────────────────────────── */
.file-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.file-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: box-shadow var(--transition);
}
.file-item.dragging { opacity: .5; box-shadow: var(--shadow-lg); }
.file-item-drag { color: var(--text-light); flex-shrink: 0; }
.file-item-icon { font-size: 1.4rem; flex-shrink: 0; }
.file-item-name {
  flex: 1;
  font-size: .875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item-size { font-size: .78rem; color: var(--text-muted); flex-shrink: 0; }
.file-item-remove {
  background: none;
  border: none;
  padding: .2rem;
  color: var(--text-light);
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}
.file-item-remove:hover { color: var(--red); background: var(--red-bg); }

/* ── Options Panel ─────────────────────────────────────────── */
.options-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.form-fields-status {
  font-size: .875rem;
  color: var(--text-muted);
  padding: .75rem 0 .5rem;
  font-style: italic;
}
.options-title {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .4rem;
}
.form-select, .form-input {
  width: 100%;
  padding: .55rem .85rem;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  background: var(--bg-white);
  color: var(--text);
  transition: border-color var(--transition);
}
.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 2.5rem; }
.toggle-pwd {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: .2rem;
  color: var(--text-muted);
}
.radio-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.radio-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--indigo-bg);
  color: var(--primary);
}
.radio-label input { display: none; }

/* ── Action Area ───────────────────────────────────────────── */
.action-area {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.action-note {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Progress ──────────────────────────────────────────────── */
.progress-wrap { margin-top: 1.5rem; text-align: center; }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: .75rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;
  transition: width .3s ease;
  width: 0%;
}
.progress-fill.indeterminate {
  width: 45%;
  animation: indeterminate 1.4s ease-in-out infinite;
}
@keyframes indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}
.progress-text { font-size: .875rem; color: var(--text-muted); }

/* ── Result Area ───────────────────────────────────────────── */
.result-area {
  margin-top: 1.5rem;
  text-align: center;
  padding: 1.5rem;
  background: var(--green-bg);
  border-radius: var(--radius);
  border: 1px solid #A7F3D0;
}
.result-area h3 { font-size: 1.2rem; font-weight: 700; color: #065F46; margin-bottom: 1rem; }
.result-icon.success-icon {
  width: 64px; height: 64px;
  margin: 0 auto .75rem;
  color: var(--green);
}
.result-area .btn + .btn { margin-top: .5rem; }

/* ── Error Area ────────────────────────────────────────────── */
.error-area {
  margin-top: 1.5rem;
  text-align: center;
  padding: 1.5rem;
  background: var(--red-bg);
  border-radius: var(--radius);
  border: 1px solid #FECACA;
}
.error-icon { font-size: 2rem; margin-bottom: .5rem; }
.error-area p { color: #991B1B; margin-bottom: 1rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
  cursor: pointer;
}
.btn-lg { padding: .8rem 2rem; font-size: 1rem; }
.btn-icon { width: 20px; height: 20px; }
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }
.btn.color-red    { background: var(--red);    border-color: var(--red); }
.btn.color-red:hover { background: #DC2626; }
.btn.color-orange { background: var(--orange); border-color: var(--orange); }
.btn.color-green  { background: var(--green);  border-color: var(--green); }
.btn.color-teal   { background: var(--teal);   border-color: var(--teal); }
.btn.color-blue   { background: var(--blue);   border-color: var(--blue); }
.btn.color-indigo { background: var(--indigo); border-color: var(--indigo); }
.btn.color-purple { background: var(--purple); border-color: var(--purple); }
.btn.color-pink   { background: var(--pink);   border-color: var(--pink); }
.btn.color-violet { background: var(--violet); border-color: var(--violet); }
.btn.color-amber  { background: var(--amber);  border-color: var(--amber); }
.btn.color-yellow { background: var(--yellow); border-color: var(--yellow); color: #1a1a1a; }
.btn.color-cyan   { background: var(--cyan);   border-color: var(--cyan); }
.btn.color-gray   { background: var(--gray);   border-color: var(--gray); }
.btn-success {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.btn-success:hover { background: #059669; text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-dark);
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary, .btn-success, .btn.color-red, .btn.color-orange,
.btn.color-green, .btn.color-blue, .btn.color-indigo, .btn.color-teal,
.btn.color-purple, .btn.color-pink, .btn.color-violet,
.btn.color-amber, .btn.color-cyan, .btn.color-gray { color: white; }

/* ── HOWTO SECTION (tool page) ─────────────────────────────── */
.howto-section {
  padding: 2.5rem 0;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
}
.steps-inline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.step-inline {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.step-num-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
  background: var(--tool-color, var(--primary));
}
.step-inline strong { font-size: .95rem; display: block; }
.step-inline p { font-size: .875rem; color: var(--text-muted); }
.howto-detail {
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── FAQ SECTION ───────────────────────────────────────────── */
.faq-section { padding: 2.5rem 0; }
.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-q {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: .95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}
.faq-q::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .2s;
}
details[open] .faq-q::after {
  content: '−';
}
.faq-a {
  padding: 0 1.25rem 1rem;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── RELATED SECTION ───────────────────────────────────────── */
.related-section {
  padding: 2.5rem 0 3rem;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
}

/* ── FOOTER ────────────────────────────────────────────────── */
.site-footer {
  background: #111827;
  color: #9CA3AF;
  padding: 3rem 0 1.5rem;
}
.footer-popular {
  border-bottom: 1px solid #1F2937;
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
}
.footer-popular h3 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #E5E7EB;
  margin-bottom: .75rem;
}
.footer-popular-links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
}
.footer-popular-links a {
  font-size: .82rem;
  color: #9CA3AF;
  transition: color var(--transition);
}
.footer-popular-links a:hover { color: white; text-decoration: none; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(6, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-brand .logo { color: white; margin-bottom: .75rem; }
.footer-brand p { font-size: .82rem; line-height: 1.6; max-width: 280px; }
.footer-col h3 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #E5E7EB;
  margin-bottom: .75rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: .35rem; }
.footer-col a {
  font-size: .82rem;
  color: #9CA3AF;
  transition: color var(--transition);
}
.footer-col a:hover { color: white; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid #1F2937;
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}
.footer-bottom p { font-size: .8rem; }
.footer-langs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.footer-langs a {
  font-size: .75rem;
  color: #6B7280;
  padding: .2rem .5rem;
  border: 1px solid #374151;
  border-radius: 4px;
  transition: all var(--transition);
}
.footer-langs a:hover,
.footer-langs a[aria-current="page"] { color: white; border-color: #6B7280; text-decoration: none; }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ───────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .step-connector { display: none; }
  .steps-grid { flex-direction: column; align-items: center; }
  .step { max-width: 100%; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .hero-sub { font-size: .95rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-panel { padding: 1.25rem; }
  .drop-zone { padding: 1.75rem 1rem; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .tool-hero-content { flex-direction: column; }
  .radio-group { flex-direction: column; }
}

/* ── Mobile nav overlay ────────────────────────────────────── */
.main-nav.open {
  display: block;
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--bg-white);
  overflow-y: auto;
  z-index: 99;
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.main-nav.open > ul { flex-direction: column; }
.main-nav.open .has-dropdown:hover .dropdown,
.main-nav.open .has-dropdown:focus-within .dropdown { display: block; position: static; box-shadow: none; border: none; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tool-panel, .tool-card { animation: fadeIn .25s ease both; }
