/* ============================================================
   KeepFile — Design System (Enhanced)
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Tells the browser our page is light, so native chrome — select dropdowns,
     scrollbars, date pickers — is drawn to match instead of fighting the theme. */
  color-scheme: light;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-soft: #f2f4f7;          /* was #f6f7f9 — darker for visible surface contrast */
  --bg-softer: #e4e7ec;        /* was #eef0f3 — stronger subtle backgrounds */
  --surface: #ffffff;
  --border: #cbd5e1;           /* was #e4e7ec — clearly visible borders (slate-300) */
  --border-strong: #94a3b8;    /* was #d0d5dd — focus/active borders */

  --text: #0f172a;             /* was #101828 — slightly darker (slate-900) */
  --text-2: #334155;           /* was #475467 — readable secondary (slate-700) */
  --text-3: #64748b;           /* was #667085 — muted but AA-passing (slate-500) */

  --brand: #4338ca;            /* was #4f46e5 — darker indigo for AA on white */
  --brand-hover: #3730a3;
  --brand-soft: #e0e7ff;       /* was #eef2ff — stronger tint for badge readability */
  --brand-text: #312e81;
  --grad-a: #4f46e5;
  --grad-b: #7c3aed;
  --accent-green: #047857;     /* was #059669 — darker emerald */
  --green-soft: #d1fae5;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --radius-xl: 24px;

  --shadow-s: 0 1px 2px rgba(15, 23, 42, .08);
  --shadow-m: 0 4px 12px -2px rgba(15, 23, 42, .12), 0 2px 6px -2px rgba(15, 23, 42, .08);
  --shadow-l: 0 20px 40px -12px rgba(15, 23, 42, .18);
  --shadow-glow: 0 0 40px rgba(79, 70, 229, .15);

  --header-h: 64px;
  --container: 1160px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0c111d;
  --bg-soft: #111827;
  --bg-softer: #1a2332;
  --surface: #161d2b;
  --border: #232d42;
  --border-strong: #344054;

  --text: #f2f4f7;
  --text-2: #a8b3c5;
  --text-3: #8492a6;

  --brand: #818cf8;
  --brand-hover: #a5b4fc;
  --brand-soft: #1e1b4b;
  --brand-text: #c7d2fe;
  --grad-a: #6366f1;
  --grad-b: #8b5cf6;
  --accent-green: #34d399;
  --green-soft: #052e22;
  --amber: #fbbf24;
  --amber-soft: #291a00;
  --red: #f87171;
  --red-soft: #2a1215;

  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-m: 0 4px 12px -2px rgba(0, 0, 0, .5);
  --shadow-l: 0 20px 40px -12px rgba(0, 0, 0, .6);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--brand); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.container { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-s); text-decoration: none; font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* Anchored sections must clear the sticky header, or a clicked nav link
   parks the heading underneath it. */
[id] { scroll-margin-top: calc(var(--header-h) + 20px); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: var(--header-h); max-width: var(--container);
  margin-inline: auto; padding-inline: 24px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -.02em;
  text-decoration: none; color: var(--text); flex-shrink: 0;
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; color: #fff;
  flex-shrink: 0;
  /* The SVG paints its own indigo badge, so this must stay transparent —
     otherwise the header shows a double square and mismatches the favicon. */
  background: transparent;
}
.main-nav { display: flex; gap: 4px; align-items: center; margin-left: 8px; }
.main-nav a {
  text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 15px;
  padding: 8px 12px; border-radius: var(--radius-s); transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--text); background: var(--bg-softer); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: transparent;
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-softer); color: var(--text); }

.nav-toggle {
  display: none; width: 38px; height: 38px; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: transparent; cursor: pointer;
  place-items: center; color: var(--text-2);
}
.mobile-nav {
  display: none; position: fixed; inset: var(--header-h) 0 auto 0; z-index: 99;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 12px 24px 20px; box-shadow: var(--shadow-l);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: 12px 8px; text-decoration: none;
  color: var(--text); font-weight: 600; border-radius: var(--radius-s);
}
.mobile-nav a:hover { background: var(--bg-soft); }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: grid; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 15px; line-height: 1;
  padding: 12px 22px; border-radius: var(--radius-m);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .1s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand);
  color: #fff; box-shadow: 0 4px 14px -4px rgba(79, 70, 229, .5);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 20px -4px rgba(79, 70, 229, .55); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--bg-soft); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-danger:hover { filter: brightness(.97); }
.btn-lg { padding: 15px 28px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: var(--radius-s); }
.btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 72px 0 48px; text-align: center; position: relative; overflow: hidden; }
.hero > * { position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand-text);
  font-size: 13.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
}
.hero h1 {
  font-size: clamp(36px, 6vw, 60px); font-weight: 800;
  letter-spacing: -.035em; line-height: 1.08; max-width: 780px; margin: 0 auto 18px;
}
.hero h1 .grad {
  color: var(--brand);
}
.hero-sub {
  font-size: clamp(17px, 2vw, 19.5px); color: var(--text-2);
  max-width: 620px; margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; justify-content: center; gap: clamp(24px, 5vw, 56px);
  margin-top: 44px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.hero-stat span { font-size: 13.5px; color: var(--text-3); }

/* ---------- Search ---------- */
.search-wrap { max-width: 560px; margin: 0 auto 26px; position: relative; }
.search-icon {
  position: absolute; left: 16px; top: 50%; translate: 0 -50%;
  color: var(--text-3); pointer-events: none;
}
#tool-search {
  width: 100%; height: 52px; padding: 0 44px 0 48px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 15.5px;
  box-shadow: var(--shadow-s); transition: border-color .15s, box-shadow .15s;
}
#tool-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.search-clear {
  position: absolute; right: 10px; top: 50%; translate: 0 -50%;
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: var(--bg-softer); cursor: pointer; display: none; place-items: center;
  color: var(--text-2);
}
.search-clear.show { display: grid; }
.search-results-count {
  max-width: 560px; margin: -18px auto 20px; font-size: 14px;
  color: var(--text-3); text-align: left; padding-left: 8px; display: none;
}

/* ============================================================
   Sections & tool grid
   ============================================================ */
.section { padding: 56px 0; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; letter-spacing: -.025em; }
.section-head p { color: var(--text-2); margin-top: 8px; max-width: 640px; }
.section-head.center { text-align: center; }
.section-head.center p { margin-inline: auto; }

.tool-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.tool-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); padding: 20px;
  text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative;
}
.tool-card:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: var(--shadow-m); transform: translateY(-2px);
}
.tool-card:focus-visible { outline-offset: 3px; }
.tool-card.popular-tag::after {
  content: "Popular"; position: absolute; top: 14px; right: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--brand-soft); color: var(--brand-text);
  padding: 3px 8px; border-radius: 999px;
}
.tool-card h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.tool-card p { font-size: 14px; color: var(--text-2); flex-grow: 1; }
.tool-card .card-cat {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3);
}

.cat-block { margin-bottom: 40px; }
.cat-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 750; letter-spacing: -.01em; margin-bottom: 16px;
}
.cat-title .cat-chip {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-text);
}
.no-results {
  text-align: center; padding: 48px 0; color: var(--text-2); display: none;
}
.no-results b { display: block; font-size: 17px; margin-bottom: 6px; color: var(--text); }

/* ============================================================
   Feature / how / privacy sections
   ============================================================ */
.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.feature-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-l); padding: 24px;
}
.feature-card .fc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand);
  color: #fff; display: grid; place-items: center; margin-bottom: 14px;
}
.feature-card h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.01em; }
.feature-card p { font-size: 14.5px; color: var(--text-2); }

.steps-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: step; }
.step-card { position: relative; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); }
.step-num {
  counter-increment: step;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand);
  color: #fff; font-weight: 800; font-size: 15px;
  display: grid; place-items: center; margin-bottom: 14px;
}
.step-num::before { content: counter(step); }
.step-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.step-card p { font-size: 14.5px; color: var(--text-2); }

.privacy-band {
  background: var(--bg-soft);
  border-block: 1px solid var(--border);
}
.privacy-inner { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; align-items: center; padding: 56px 0; }
.privacy-inner h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; letter-spacing: -.025em; margin-bottom: 14px; }
.privacy-inner p { color: var(--text-2); margin-bottom: 12px; }
.privacy-points { list-style: none; padding: 0; display: grid; gap: 12px; }
.privacy-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--text-2); }
.privacy-points li svg { color: var(--accent-green); flex-shrink: 0; margin-top: 3px; }
.privacy-points li b { color: var(--text); }
@media (max-width: 800px) { .privacy-inner { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq-list { max-width: 720px; margin: 0 auto; display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; }
.faq-item summary {
  cursor: pointer; padding: 17px 20px; font-weight: 600; font-size: 15.5px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { flex-shrink: 0; color: var(--text-3); transition: transform .2s; }
.faq-item[open] summary svg { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 20px 18px; color: var(--text-2); font-size: 14.5px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 40px; }
.footer-grid {
  display: grid; gap: 36px; grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 52px 0 40px;
}
.footer-brand p { color: var(--text-2); font-size: 14.5px; margin-top: 12px; max-width: 300px; }
.footer-col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.footer-col a { text-decoration: none; color: var(--text-2); font-size: 14.5px; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--text-3);
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Tool page
   ============================================================ */
.tool-page { padding: 40px 0 72px; }
.breadcrumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--text-3); margin-bottom: 26px;
}
.breadcrumbs a { color: var(--text-3); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { color: var(--border-strong); }

.tool-head { max-width: 720px; margin-bottom: 30px; }
.tool-head h1 {
  display: flex; align-items: center; gap: 14px;
  font-size: clamp(27px, 4vw, 36px); font-weight: 800; letter-spacing: -.03em;
}
.tool-head h1 .th-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: var(--brand);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .5);
}
.tool-head .tool-desc { color: var(--text-2); font-size: 16.5px; margin-top: 10px; }
.privacy-chip {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 14px; font-size: 13.5px; font-weight: 600;
  color: var(--accent-green); background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--accent-green) 30%, transparent);
  padding: 6px 12px; border-radius: 999px;
}

.tool-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-m);
  padding: clamp(20px, 3.5vw, 36px); max-width: 860px;
}
.tool-panel + .tool-about { max-width: 860px; margin-top: 28px; }
.tool-about h2 { font-size: 19px; font-weight: 750; margin-bottom: 10px; letter-spacing: -.01em; }
.tool-about p { color: var(--text-2); font-size: 15px; margin-bottom: 12px; }
.tool-about .meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.meta-pill {
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
  background: var(--bg-soft);
}
.related-tools { max-width: 860px; margin-top: 44px; }
.related-tools h2 { font-size: 19px; font-weight: 750; margin-bottom: 16px; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-l);
  padding: clamp(28px, 5vw, 48px); text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
  background: var(--bg-soft);
}
.dropzone:hover { border-color: var(--brand); }
.dropzone.drag-over {
  border-color: var(--brand); background: var(--brand-soft);
  border-style: solid;
}
.dropzone.disabled { opacity: .6; pointer-events: none; }
.dropzone .dz-icon {
  width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 14px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.dropzone.drag-over .dz-icon { background: var(--brand); color: #fff; }
.dropzone h3 { font-size: 17px; font-weight: 700; margin-bottom: 5px; }
.dropzone p { font-size: 14px; color: var(--text-3); }
.dz-hint { margin-top: 14px; font-size: 12.5px; color: var(--text-3); }

/* ---------- File list ---------- */
.file-list { margin-top: 18px; display: grid; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 11px 14px; background: var(--bg-soft);
  animation: fadeUp .25s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.file-item .fi-icon { color: var(--brand); flex-shrink: 0; }
.file-item .fi-info { flex-grow: 1; min-width: 0; }
.file-item .fi-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fi-meta { font-size: 12.5px; color: var(--text-3); }
.fi-remove {
  border: none; background: transparent; cursor: pointer; color: var(--text-3);
  width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0;
}
.fi-remove:hover { background: var(--red-soft); color: var(--red); }
.fi-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }

/* ---------- Options ----------
   `align-items: start` matters: without it every cell stretches to the tallest
   one, and because .opt-group is itself a grid its rows then distribute that
   extra height — pushing a label and its input far apart. */
.options-grid {
  margin-top: 20px;
  display: grid;
  gap: 16px;
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.opt-group { display: grid; gap: 6px; align-content: start; }
.opt-group > label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.field-input, select.field-input, textarea.field-input {
  border: 1px solid var(--border-strong); border-radius: var(--radius-s);
  padding: 10px 12px; background: var(--surface); font-size: 14.5px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
textarea.field-input { resize: vertical; min-height: 120px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; }

/* ---------- Selects ----------
   Without appearance:none the OS draws its own arrow, which varies per platform
   and collides with our padding. We draw the chevron ourselves instead. */
select.field-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  line-height: 1.4;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 15px 15px;
}
[data-theme="dark"] select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238492a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
}
select.field-input:hover { border-color: color-mix(in srgb, var(--brand) 60%, var(--border)); }
select.field-input:disabled { opacity: .55; cursor: not-allowed; }
/* Options are drawn by the OS; give them theme colours where the engine allows. */
select.field-input option {
  background: var(--surface);
  color: var(--text);
}
textarea.field-input.prose { font-family: var(--font-sans); font-size: 15px; }
.hint { font-size: 12.5px; color: var(--text-3); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-2); cursor: pointer; }
.checkbox-row input { accent-color: var(--brand); width: 16px; height: 16px; }

/* A tidy multi-column block of checkboxes — far better than a stray column
   floating beside an unrelated control. */
.check-grid {
  display: grid;
  gap: 10px 18px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  align-content: start;
}

/* Display for a generated value (password, UUID, hash …) */
.value-display {
  margin-top: 18px;
  padding: 18px 20px;
  min-height: 64px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
  word-break: break-all;
  color: var(--text);
  user-select: all;
  cursor: text;
}
.value-display:empty::before {
  content: "—";
  color: var(--text-3);
  font-weight: 400;
}

/* Label + value meter rows (character limits, quotas …) */
.meter-list { display: grid; gap: 14px; margin-top: 18px; }
.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  margin-bottom: 5px;
}
.meter-head .meter-name { font-weight: 600; color: var(--text-2); }
.meter-head .meter-count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.meter-list .progress-track { margin-top: 0; }
.meter-over .meter-count { color: var(--red); font-weight: 600; }
.meter-over .progress-fill { background: var(--red); }

.action-bar { margin-top: 22px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------- States ---------- */
.state-banner {
  margin-top: 20px; border-radius: var(--radius-m); padding: 14px 18px;
  font-size: 14.5px; display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid transparent;
}
.state-banner.error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.state-banner.info { background: var(--brand-soft); color: var(--brand-text); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.state-banner.warning { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
/* Banner holding more than one line of content */
.banner-body { display: grid; gap: 6px; min-width: 0; }
/* The offending source line shown under a parse error */
.error-context {
  display: block;
  overflow: auto;
  padding: 7px 11px;
  border-radius: var(--radius-s);
  border: 1px solid color-mix(in srgb, var(--red) 25%, transparent);
  background: var(--bg-softer);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.progress-track { margin-top: 20px; height: 8px; border-radius: 999px; background: var(--bg-softer); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--brand);
  transition: width .25s ease;
}
.progress-label { margin-top: 8px; font-size: 13px; color: var(--text-3); }

.result-area { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 24px; animation: fadeUp .3s ease both; }
.result-area h3 { font-size: 17px; font-weight: 750; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.result-area h3 svg { color: var(--accent-green); }
.result-sub { font-size: 14px; color: var(--text-3); margin-bottom: 16px; }
.result-files { display: grid; gap: 10px; margin-bottom: 16px; }
.result-file {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 11px 14px; background: var(--bg-soft);
}
.result-file img.rf-preview { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.result-file .rf-name { font-weight: 600; font-size: 14px; word-break: break-all; }
.result-file .rf-meta { font-size: 12.5px; color: var(--text-3); }
.result-file .btn { margin-left: auto; }

.stat-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 16px 0; }
.stat-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 14px; text-align: center; }
.stat-card b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-card span { font-size: 12px; color: var(--text-3); }

.output-box {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 16px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
  overflow: auto; max-height: 420px; white-space: pre-wrap; word-break: break-word;
}
.output-box.error-text { background: var(--red-soft); color: var(--red); }
.qr-holder { display: grid; place-items: center; padding: 20px; background: #fff; border-radius: var(--radius-m); border: 1px solid var(--border); }
.qr-holder canvas, .qr-holder img { image-rendering: pixelated; }

.diff-view { font-family: var(--font-mono); font-size: 13px; line-height: 1.65; border-radius: var(--radius-m); overflow: auto; max-height: 480px; border: 1px solid var(--border); }
.diff-line { padding: 1px 14px; white-space: pre-wrap; word-break: break-word; }
.diff-add { background: color-mix(in srgb, var(--accent-green) 16%, transparent); color: var(--accent-green); }
.diff-del { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.diff-same { color: var(--text-2); }
.diff-hunk { background: var(--brand-soft); color: var(--brand-text); font-style: italic; }

.crop-stage {
  position: relative; background:
    repeating-conic-gradient(var(--bg-softer) 0 25%, var(--bg-soft) 0 50%) 0 0/20px 20px;
  border: 1px solid var(--border); border-radius: var(--radius-m);
  overflow: hidden; touch-action: none; user-select: none;
  max-height: 520px;
}
.crop-stage img { display: block; max-width: 100%; max-height: 520px; margin-inline: auto; }
.crop-box {
  position: absolute; border: 2px solid var(--brand);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45);
  cursor: move;
}
.crop-handle {
  position: absolute; width: 14px; height: 14px; border-radius: 3px;
  background: #fff; border: 2px solid var(--brand);
}
.ch-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.ch-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.ch-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.ch-se { bottom: -7px; right: -7px; cursor: nwse-resize; }

.pdf-preview-strip { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px; }
.pdf-preview-strip img { height: 120px; border-radius: 6px; border: 1px solid var(--border); }

.toast-region { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: grid; gap: 8px; }
.toast {
  background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: var(--radius-m); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-l); animation: toastIn .25s ease both; max-width: 320px;
}
[data-theme="dark"] .toast { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
  .hero { padding: 44px 0 32px; }
  .section { padding: 40px 0; }
  .hero-actions .btn { flex: 1 1 auto; min-width: 150px; }
  .action-bar .btn { flex: 1 1 auto; }
  .tool-panel { border-radius: var(--radius-l); }
  .result-file .btn { margin-left: 0; }
  .toast-region { left: 20px; right: 20px; }
  .toast { max-width: none; }
}


/* ============================================================
   KeepFile — Interactive Hero & Polish Layer (solid colors)
   ============================================================ */
.hero { position: relative; }
.hero-canvas-host, .hero { overflow: visible; }
#hero-canvas {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.hero > *:not(#hero-canvas) { position: relative; z-index: 1; }

/* theme-aware node/line colors */
:root {
  --hero-dot: #4f46e5; --hero-link: rgba(79,70,229,.35);
  --cat-pdf: #ef4444;   --cat-pdf-soft: #fef2f2;
  --cat-images: #3b82f6; --cat-images-soft: #eff6ff;
  --cat-text: #10b981;  --cat-text-soft: #ecfdf5;
  --cat-gen: #f59e0b;   --cat-gen-soft: #fffbeb;
  --cat-conv: #8b5cf6;  --cat-conv-soft: #f5f3ff;
}
[data-theme="dark"] {
  --cat-pdf: #f87171;   --cat-pdf-soft: #2a1215;
  --cat-images: #60a5fa; --cat-images-soft: #0c1a2e;
  --cat-text: #34d399;  --cat-text-soft: #052e22;
  --cat-gen: #fbbf24;   --cat-gen-soft: #291a00;
  --cat-conv: #a78bfa;  --cat-conv-soft: #1e1a33;
}
[data-theme="dark"] { --hero-dot: #818cf8; --hero-link: rgba(129,140,248,.4); }

/* headline: solid brand color with subtle underline flourish */
.hero h1 .grad {
  color: var(--brand);
  background: none;
}

/* card hover: crisp lift, solid border accent */
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow-l);
}
.tool-card h3 { transition: color .15s; }
.tool-card:hover h3 { color: var(--brand); }

/* buttons: springy press, no sheen gradients */
.btn-primary { transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, background .18s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--brand) 55%, transparent); }
.btn-primary:active { transform: translateY(0) scale(.97); }

/* feature cards lift */
.feature-card, .step-card { transition: transform .2s ease, border-color .2s, box-shadow .2s; }
.feature-card:hover, .step-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }

/* dropzone drag feedback */
.dropzone { transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.dropzone.drag-over { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 14%, transparent); }

/* staggered entrance animations */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-badge, .hero h1, .hero-sub, .search-wrap, .hero-actions, .hero-stats {
  animation: riseIn .55s cubic-bezier(.2,.7,.3,1) both;
}
.hero-badge { animation-delay: .05s; }
.hero h1 { animation-delay: .12s; }
.hero-sub { animation-delay: .2s; }
.search-wrap { animation-delay: .28s; }
.hero-actions { animation-delay: .36s; }
.hero-stats { animation-delay: .44s; }
.tool-card { animation: riseIn .5s cubic-bezier(.2,.7,.3,1) both; }
.cat-block:nth-child(1) .tool-card:nth-child(n) { animation-delay: calc(var(--i, 0) * 30ms); }

@media (prefers-reduced-motion: reduce) {
  .hero-badge, .hero h1, .hero-sub, .search-wrap, .hero-actions, .hero-stats, .tool-card { animation: none !important; }
}


/* ---------- Category color system (solid colors) ---------- */
.tool-card .th-icon, .tool-card .card-icon { border-radius: 10px; display: grid; place-items: center; }
.tool-card[data-cat="pdf"] .card-icon, .tool-card[data-cat="pdf"] .th-icon { background: var(--cat-pdf-soft); color: var(--cat-pdf); }
.tool-card[data-cat="images"] .card-icon, .tool-card[data-cat="images"] .th-icon { background: var(--cat-images-soft); color: var(--cat-images); }
.tool-card[data-cat="text"] .card-icon, .tool-card[data-cat="text"] .th-icon { background: var(--cat-text-soft); color: var(--cat-text); }
.tool-card[data-cat="generators"] .card-icon, .tool-card[data-cat="generators"] .th-icon { background: var(--cat-gen-soft); color: var(--cat-gen); }
.tool-card[data-cat="converter"] .card-icon, .tool-card[data-cat="converter"] .th-icon { background: var(--cat-conv-soft); color: var(--cat-conv); }

.tool-card[data-cat="pdf"]:hover { border-color: var(--cat-pdf); }
.tool-card[data-cat="images"]:hover { border-color: var(--cat-images); }
.tool-card[data-cat="text"]:hover { border-color: var(--cat-text); }
.tool-card[data-cat="generators"]:hover { border-color: var(--cat-gen); }
.tool-card[data-cat="converter"]:hover { border-color: var(--cat-conv); }
.tool-card[data-cat="pdf"]:hover h3 { color: var(--cat-pdf); }
.tool-card[data-cat="images"]:hover h3 { color: var(--cat-images); }
.tool-card[data-cat="text"]:hover h3 { color: var(--cat-text); }
.tool-card[data-cat="generators"]:hover h3 { color: var(--cat-gen); }
.tool-card[data-cat="converter"]:hover h3 { color: var(--cat-conv); }

.tool-card .card-cat { font-weight: 700; }
.tool-card[data-cat="pdf"] .card-cat { color: var(--cat-pdf); }
.tool-card[data-cat="images"] .card-cat { color: var(--cat-images); }
.tool-card[data-cat="text"] .card-cat { color: var(--cat-text); }
.tool-card[data-cat="generators"] .card-cat { color: var(--cat-gen); }
.tool-card[data-cat="converter"] .card-cat { color: var(--cat-conv); }

.tool-card[data-cat="converter"]::before { background: linear-gradient(90deg, var(--cat-conv), #c4b5fd); }

/* tool page header icon follows category too */
.tool-head h1 .th-icon { background: var(--brand-soft); color: var(--brand); }
[data-cat="pdf"] .tool-head h1 .th-icon { background: var(--cat-pdf-soft); color: var(--cat-pdf); }
[data-cat="images"] .tool-head h1 .th-icon { background: var(--cat-images-soft); color: var(--cat-images); }
[data-cat="text"] .tool-head h1 .th-icon { background: var(--cat-text-soft); color: var(--cat-text); }
[data-cat="generators"] .tool-head h1 .th-icon { background: var(--cat-gen-soft); color: var(--cat-gen); }
[data-cat="converter"] .tool-head h1 .th-icon { background: var(--cat-conv-soft); color: var(--cat-conv); }
/* breadcrumbs + privacy chip pick up category subtly */
[data-cat] .privacy-chip { color: var(--accent-green); }

/* colorful stat accents in hero */
.hero-stat:nth-child(1) b { color: var(--cat-text); }
.hero-stat:nth-child(3) b { color: var(--cat-gen); }


/* ---------- Spread color across the whole site ---------- */

/* section title chips follow category color */
.cat-block[data-cat="pdf"] .cat-chip { background: var(--cat-pdf-soft); color: var(--cat-pdf); }
.cat-block[data-cat="images"] .cat-chip { background: var(--cat-images-soft); color: var(--cat-images); }
.cat-block[data-cat="text"] .cat-chip { background: var(--cat-text-soft); color: var(--cat-text); }
.cat-block[data-cat="generators"] .cat-chip { background: var(--cat-gen-soft); color: var(--cat-gen); }
.cat-block[data-cat="converter"] .cat-chip { background: var(--cat-conv-soft); color: var(--cat-conv); }
.cat-block[data-cat="pdf"] .cat-title { color: var(--cat-pdf); }
.cat-block[data-cat="images"] .cat-title { color: var(--cat-images); }
.cat-block[data-cat="text"] .cat-title { color: var(--cat-text); }
.cat-block[data-cat="generators"] .cat-title { color: var(--cat-gen); }
.cat-block[data-cat="converter"] .cat-title { color: var(--cat-conv); }
.cat-title { transition: color .2s; }

/* feature cards: each gets its own accent (fast=violet, private=green, free=amber) */
.feature-card:nth-child(1) .fc-icon { background: #8b5cf6; }
.feature-card:nth-child(2) .fc-icon { background: var(--cat-text); }
.feature-card:nth-child(3) .fc-icon { background: var(--cat-gen); }
.feature-card:nth-child(1):hover { border-color: #8b5cf6; }
.feature-card:nth-child(2):hover { border-color: var(--cat-text); }
.feature-card:nth-child(3):hover { border-color: var(--cat-gen); }

/* popular badge = amber pop */
.tool-card.popular-tag::after {
  background: var(--cat-gen-soft);
  color: var(--cat-gen);
}

/* how-it-works steps: numbered circles get rotating category colors */
.steps-grid .step-card:nth-child(4n+1) .step-num { background: var(--cat-pdf); }
.steps-grid .step-card:nth-child(4n+2) .step-num { background: var(--cat-images); }
.steps-grid .step-card:nth-child(4n+3) .step-num { background: var(--cat-text); }
.steps-grid .step-card:nth-child(4n+4) .step-num { background: var(--cat-gen); }

/* privacy band checkmarks green */
.privacy-points li svg { color: var(--accent-green); }

/* footer brand mark + link hovers get brand color pop */
.footer-col a:hover { color: var(--brand); }

/* FAQ open state: left accent border in brand color */
.faq-item[open] { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }

/* header nav active link */
.main-nav a:hover { color: var(--brand); background: var(--brand-soft); }

/* search focus ring in brand color (already), placeholder polish */
#tool-search::placeholder { color: var(--text-3); }

/* buttons: secondary hover border pop */
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }


/* ---------- Donate button (Ko-fi) ---------- */
.donate-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #e11d48; color: #fff !important;
  font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: 999px;
  text-decoration: none; white-space: nowrap;
  border: 1px solid #e11d48;
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, background .2s;
  box-shadow: 0 3px 10px -3px rgba(225,29,72,.5);
}
.donate-btn:hover {
  background: #f43f5e; border-color: #f43f5e;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px -4px rgba(225,29,72,.6);
}
.donate-btn:active { transform: scale(.97); }
.donate-btn svg { animation: heartbeat 2.4s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  8% { transform: scale(1.25); }
  16% { transform: scale(1); }
  24% { transform: scale(1.18); }
  32% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .donate-btn svg { animation: none; } }

.donate-mobile {
  display: flex; width: 100%; justify-content: center;
  color: #e11d48 !important; font-weight: 700;
  background: transparent; border: 1px dashed #e11d48; border-radius: var(--radius-s);
  margin-top: 6px; text-align: center;
}
.donate-mobile:hover { background: color-mix(in srgb, #e11d48 8%, transparent); }

@media (max-width: 640px) {
  .donate-btn span { display: none; }   /* icon-only on small screens */
  .donate-btn { padding: 9px 12px; }
}


/* donate nudge under results */
.donate-nudge {
  margin-top: 18px; padding: 11px 16px;
  border: 1px dashed color-mix(in srgb, #e11d48 45%, var(--border));
  border-radius: var(--radius-m);
  background: color-mix(in srgb, #e11d48 4%, var(--surface));
  font-size: 14px; color: var(--text-2);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.donate-nudge svg { color: #e11d48; flex-shrink: 0; animation: heartbeat 2.4s ease-in-out infinite; }
.donate-nudge a { color: #e11d48; font-weight: 700; text-decoration: none; }
.donate-nudge a:hover { text-decoration: underline; }


/* ---------- Usage-based support prompt ---------- */
.ff-support-overlay {
  position: fixed; inset: 0; z-index: 420;
  background: rgba(8, 11, 22, .5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .18s ease both;
}
.ff-support-overlay.closing { animation: fadeOut .16s ease both; }

.ff-support-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45);
  padding: 32px 28px 24px;
  text-align: center;
  animation: popIn .24s cubic-bezier(.2,.9,.3,1.2) both;
}
.ff-support-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.ff-support-close:hover { background: var(--bg-soft); color: var(--text); }

.ff-support-icon {
  width: 54px; height: 54px; border-radius: 16px;
  margin: 0 auto 16px;
  background: color-mix(in srgb, #e11d48 12%, var(--surface));
  color: #e11d48;
  display: grid; place-items: center;
  animation: heartbeat 2.4s ease-in-out infinite;
}
.ff-support-card h2 {
  font-size: 18.5px; font-weight: 750; letter-spacing: -.015em;
  line-height: 1.3; margin-bottom: 10px;
}
.ff-support-card p {
  font-size: 14.5px; color: var(--text-2); line-height: 1.6;
  margin-bottom: 22px;
}
.ff-support-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.ff-support-actions .btn { text-decoration: none; }
.ff-support-note {
  display: block; margin-top: 16px;
  font-size: 12px; color: var(--text-3);
}
@media (max-width: 480px) {
  .ff-support-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ff-support-icon { animation: none; }
  .ff-support-overlay, .ff-support-card { animation: none; }
}

/* ---------- Donate modal: two columns with a scan-from-phone QR ---------- */
.ff-support-card--wide { width: min(640px, 100%); text-align: left; }
.ff-support-card--wide .ff-support-icon { margin-inline: 0; }
.ff-support-card--wide .ff-support-actions { justify-content: flex-start; }

.ff-donate-grid {
  display: grid;
  gap: 24px;
  align-items: center;
}
@media (min-width: 620px) {
  .ff-donate-grid { grid-template-columns: 1fr auto; }
}

.ff-qr {
  display: none;                 /* revealed only once the code has rendered */
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ff-qr-box {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  line-height: 0;
  box-shadow: var(--shadow-s);
}
.ff-qr-canvas {
  display: block;
  width: 132px; height: 132px;
  image-rendering: pixelated;
}
.ff-qr span {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  max-width: 150px;
}

/* Accepted payment methods — reassures visitors that this is not Indonesia-only */
.ff-pay-note {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
}
.ff-pay-note strong { color: var(--text-2); font-weight: 600; }


/* ============================================================
   New tools v2 — inspector, hash, zip, organizer, exif, tables
   ============================================================ */

/* File Inspector */
.inspector-list { margin-top: 16px; display: grid; gap: 10px; }
.fi-panel { border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--bg-soft); overflow: hidden; }
.fi-panel summary {
  cursor: pointer; padding: 13px 16px;
  display: flex; align-items: center; gap: 12px;
  list-style: none; user-select: none; font-weight: 600;
}
.fi-panel summary::-webkit-details-marker { display: none; }
.fi-panel summary:hover { background: var(--bg-softer); }
.fi-panel[open] .fi-body { animation: fadeUp .2s ease both; }
.fi-name { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-chip { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--brand-soft); color: var(--brand-text); padding: 3px 9px; border-radius: 999px; }
.fi-size { color: var(--text-3); font-size: 13px; font-weight: 500; }
.fi-body { padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.fi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fi-grid > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 10px 12px; }
.fi-grid b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 2px; }
.fi-grid span { font-weight: 600; font-size: 14px; word-break: break-all; }

/* File Hash */
.hash-results { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 18px; animation: fadeUp .25s ease both; }
.hash-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.hash-name { font-weight: 700; font-size: 13px; width: 72px; flex-shrink: 0; color: var(--text-2); }
.hash-value { flex: 1; min-width: 200px; font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 8px 12px; overflow-x: auto; white-space: nowrap; cursor: pointer; }
.hash-value:hover { border-color: var(--brand); }
.hash-progress { font-variant-numeric: tabular-nums; }

/* ZIP create/extract */
.zip-summary { margin-top: 12px; font-weight: 600; }
.zip-entries { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 18px; animation: fadeUp .25s ease both; }
.zip-tree { margin-top: 14px; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-m); }
.zip-entry { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.zip-entry:last-child { border-bottom: none; }
.zip-entry:hover { background: var(--bg-soft); }
.ze-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ze-size { color: var(--text-3); font-size: 12.5px; flex-shrink: 0; }
.zip-entry-unsafe { color: var(--amber); }
.zip-entry-unsafe .ze-name { text-decoration: line-through; }
.fi-path { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }

/* PDF Organizer */
.org-toolbar { margin-top: 16px; }
.org-count { margin-left: auto; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 16px; }
.org-page {
  position: relative; border: 2px solid var(--border); border-radius: var(--radius-m);
  background: var(--surface); cursor: grab; overflow: hidden;
  aspect-ratio: 3/4; display: grid; place-items: center;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  user-select: none;
}
.org-page:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-m); }
.org-page.selected { border-color: var(--cat-pdf, #ef4444); box-shadow: 0 0 0 3px color-mix(in srgb, #ef4444 22%, transparent); }
.org-page.dragging { opacity: .45; border-style: dashed; }
.org-page.drop-target { border-color: var(--accent-green); transform: scale(1.04); }
.org-page img { max-width: 88%; max-height: 88%; box-shadow: 0 2px 8px rgba(0,0,0,.18); pointer-events: none; }
.org-num { position: absolute; top: 6px; left: 6px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.org-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-green); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }

/* EXIF table */
.exif-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.exif-table th { text-align: left; padding: 9px 14px 9px 0; color: var(--text-3); font-weight: 600; white-space: nowrap; vertical-align: top; border-bottom: 1px solid var(--border); }
.exif-table td { padding: 9px 0; font-family: var(--font-mono); font-size: 13px; word-break: break-all; border-bottom: 1px solid var(--border); }
.exif-table tr:last-child th, .exif-table tr:last-child td { border-bottom: none; }

@media (max-width: 640px) {
  .org-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .hash-row { align-items: stretch; flex-direction: column; }
  .hash-row .btn { align-self: flex-end; margin-top: -34px; }
}


/* ============================================================
   ENHANCED POLISH — Animations, Micro-interactions, Scroll FX
   ============================================================ */

/* ---- Scroll-driven reveal animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(.93);
  transition: opacity .5s cubic-bezier(.2,.7,.3,1), transform .5s cubic-bezier(.2,.7,.3,1);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered child reveals */
.stagger-children > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 60ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 120ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 180ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 240ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 300ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(n+7) { transition-delay: 360ms; opacity: 1; transform: none; }

/* ---- Enhanced Hero ---- */
.hero-badge {
  position: relative;
  overflow: hidden;
}
.hero-badge::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shimmer 3.5s ease-in-out infinite;
}
@keyframes shimmer {
  0% { left: -100%; }
  50%, 100% { left: 200%; }
}

.hero h1 .grad {
  position: relative;
  display: inline-block;
}
.hero h1 .grad::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--grad-b), transparent);
  border-radius: 999px;
  animation: underlineGrow 1.2s cubic-bezier(.2,.7,.3,1) both;
  animation-delay: .8s;
}
@keyframes underlineGrow {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}

/* ---- Enhanced tool cards ---- */
.tool-card {
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--grad-b));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.2,.7,.3,1);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}
.tool-card:hover::before {
  transform: scaleX(1);
}
.tool-card .card-icon {
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.tool-card:hover .card-icon {
  transform: scale(1.12) rotate(-3deg);
}
.tool-card .card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .2s, transform .2s;
  margin-top: 4px;
}
.tool-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ---- Pulse glow on popular cards ---- */
.tool-card.popular-tag {
  box-shadow: var(--shadow-m);
}
.tool-card.popular-tag::after {
  animation: pulseBadge 2.5s ease-in-out infinite;
}
@keyframes pulseBadge {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

/* ---- Enhanced buttons ---- */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
  opacity: 0;
  transition: opacity .2s;
}
.btn-primary:hover::before { opacity: 1; }

.btn-secondary {
  position: relative;
  overflow: hidden;
}
.btn-secondary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand);
  opacity: 0;
  transition: opacity .2s;
  border-radius: inherit;
}
.btn-secondary:hover::after { opacity: .06; }

/* ---- Enhanced feature cards ---- */
.feature-card {
  position: relative;
  overflow: hidden;
}
.feature-card .fc-icon {
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
}
.feature-card:hover .fc-icon {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.3);
}

/* ---- Enhanced step cards ---- */
.step-card:hover .step-num {
  transform: scale(1.1);
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .4);
}

/* ---- Better inputs ---- */
.field-input:hover {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--border));
}

/* Range sliders share one look across every tool */
input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  cursor: pointer;
}
.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}

/* ---- Enhanced file items ---- */
.file-item {
  position: relative;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.file-item:hover {
  background: var(--bg-softer);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  box-shadow: var(--shadow-s);
}

/* ---- Better dropzone ---- */
.dropzone {
  position: relative;
  overflow: hidden;
}
.dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--brand) 6%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity .3s;
}
.dropzone:hover::before,
.dropzone.drag-over::before {
  opacity: 1;
}
.dropzone.drag-over .dz-icon {
  transform: scale(1.1) translateY(-4px);
}
.dz-icon {
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}

/* ---- Enhanced progress ---- */
.progress-fill {
  background: linear-gradient(90deg, var(--brand), var(--grad-b), var(--brand));
  background-size: 200% 100%;
  animation: progressShimmer 1.8s linear infinite;
}
@keyframes progressShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---- Scroll progress bar in header ---- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--grad-b));
  width: 0;
  z-index: 999;
  transition: width .1s linear;
  border-radius: 0 999px 999px 0;
}

/* ---- Back to top button ---- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px -4px rgba(79,70,229,.5);
  opacity: 0;
  transform: translateY(16px) scale(.9);
  transition: opacity .3s, transform .3s cubic-bezier(.34,1.56,.64,1), background .2s;
  z-index: 90;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.back-to-top:hover { background: var(--brand-hover); transform: translateY(-3px) scale(1.05); }
.back-to-top:active { transform: translateY(0) scale(.95); }

/* ---- Enhanced FAQ ---- */
.faq-item summary {
  position: relative;
  padding-left: 36px;
}
.faq-item summary::before {
  content: '';
  position: absolute;
  left: 16px; top: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  transform: translateY(-50%) scale(0);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  opacity: 0;
}
.faq-item[open] summary::before {
  transform: translateY(-50%) scale(1);
  opacity: 1;
}
.faq-item[open] {
  background: color-mix(in srgb, var(--brand-soft) 30%, var(--surface));
}

/* ---- Result area animation ---- */
.result-area {
  animation: resultSlideIn .45s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes resultSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ---- Hash values copy feedback ---- */
.hash-value {
  position: relative;
  transition: border-color .2s, background .2s;
}
.hash-value:active, .hash-value.copied {
  border-color: var(--accent-green);
  background: var(--green-soft);
}

/* ---- Org page drag enhancements ---- */
.org-page:active { cursor: grabbing; }

/* ---- PDF preview strip smooth scroll ---- */
.pdf-preview-strip::-webkit-scrollbar { height: 6px; }
.pdf-preview-strip::-webkit-scrollbar-track { background: var(--bg-soft); border-radius: 999px; }
.pdf-preview-strip::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.pdf-preview-strip::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ---- Custom scrollbar for output boxes ---- */
.output-box::-webkit-scrollbar { width: 6px; height: 6px; }
.output-box::-webkit-scrollbar-track { background: var(--bg-soft); }
.output-box::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.output-box::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ---- Smooth result download button animation ---- */
.result-file .btn {
  position: relative;
  overflow: hidden;
}
.result-file .btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.2);
  transform: translateY(-100%);
  transition: transform .25s cubic-bezier(.2,.7,.3,1);
  border-radius: inherit;
}
.result-file .btn:hover::before { transform: translateY(0); }

/* ---- Tool page icon animation ---- */
.tool-head h1 .th-icon {
  animation: iconPop .5s cubic-bezier(.34,1.56,.64,1) both;
  animation-delay: .15s;
}
@keyframes iconPop {
  from { opacity: 0; transform: scale(.5) rotate(-10deg); }
  to { opacity: 1; transform: none; }
}

/* ---- Reduced motion: disable decorative animations ---- */
@media (prefers-reduced-motion: reduce) {
  .hero-badge::before,
  .hero h1 .grad::after,
  @keyframes shimmer,
  @keyframes underlineGrow,
  @keyframes pulseBadge,
  @keyframes progressShimmer,
  @keyframes resultSlideIn,
  @keyframes iconPop { animation: none !important; }
  .reveal, .reveal-left, .reveal-scale {
    opacity: 1;
    transform: none;
  }
  .stagger-children > * {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Universal File Converter — mode tabs & panels
   ============================================================ */
.uc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.uc-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s,
              transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
}
.uc-tab:hover {
  transform: translateY(-2px);
  border-color: var(--cat-conv);
  color: var(--cat-conv);
  box-shadow: var(--shadow-s);
}
.uc-tab[aria-current="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 55%, transparent);
}
.uc-tab[aria-current="true"]:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: var(--brand);
}
.uc-tab:active { transform: translateY(0) scale(.97); }

@media (max-width: 560px) {
  .uc-tabs { gap: 6px; }
  .uc-tab { padding: 8px 12px; font-size: 13.5px; flex: 1 1 auto; justify-content: center; }
}

/* converter mode switch: slidey segmented feel */
#uc-opts .options-grid { margin-top: 0; }

/* converter result emphasis */
#uc-out {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

/* format chips row (supported formats strip on converter page) */
.fmt-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.fmt-chip {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--cat-conv-soft);
  color: var(--cat-conv);
  border: 1px solid color-mix(in srgb, var(--cat-conv) 25%, transparent);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), background .18s;
}
.fmt-chip:hover { transform: translateY(-2px) scale(1.04); }
.fmt-chip.in {
  background: var(--bg-soft);
  color: var(--text-2);
  border-color: var(--border);
}

