/* ============================================================
   iLovePDF theme — bespoke modern design. Self-sufficient
   (Tailwind preflight is disabled on tool pages; this file
   styles everything the theme renders).
   ============================================================ */
:root {
  --brand: #7c3aed;
  --brand-dark: #6d28d9;
  --brand-soft: #f5f3ff;
  --brand-border: #ede9fe;
  --ink: #1e1b4b;
  --ink-soft: #312e81;
  --muted: #64748b;
  --bg: #faf9ff;
  --card: #ffffff;
  --radius: 1.25rem;
  --shadow: 0 20px 50px -20px rgba(124, 58, 237, .25);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--bg); line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.02em; }

.ilp-wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.ilp-wrap.narrow { max-width: 880px; }

/* ---------- Header ---------- */
.ilp-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--brand-border);
}
.ilp-header-inner {
  max-width: 1140px; margin: 0 auto; padding: .8rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.ilp-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.25rem; }
.ilp-logo-mark {
  width: 2.4rem; height: 2.4rem; border-radius: .8rem;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  display: grid; place-items: center; color: #fff; font-size: 1.3rem;
  box-shadow: 0 8px 20px -8px rgba(124, 58, 237, .6);
}
.ilp-nav { display: flex; gap: 1.25rem; margin-left: auto; align-items: center; }
.ilp-nav a { text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.ilp-nav a:hover { color: var(--brand); }
.ilp-btn {
  display: inline-block; background: var(--brand); color: #fff !important;
  font-weight: 700; border-radius: 9999px; padding: .7rem 1.6rem;
  text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
  box-shadow: 0 10px 25px -10px rgba(124, 58, 237, .7);
}
.ilp-btn:hover { background: var(--brand-dark); transform: translateY(-2px); }
.ilp-btn.ghost { background: #fff; color: var(--brand) !important; border: 2px solid var(--brand-border); box-shadow: none; }

/* ---------- Hero ---------- */
.ilp-hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 5rem 1.25rem 4rem;
  background:
    radial-gradient(600px 300px at 15% 10%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(700px 340px at 85% 20%, rgba(76, 29, 149, .14), transparent 60%),
    radial-gradient(500px 260px at 50% 110%, rgba(124, 58, 237, .12), transparent 60%),
    #fff;
  border-bottom: 1px solid var(--brand-border);
}
.ilp-hero-badge {
  display: inline-block; background: var(--brand-soft); color: var(--brand-dark);
  border: 1px solid var(--brand-border); font-weight: 700; font-size: .8rem;
  padding: .35rem 1rem; border-radius: 9999px; margin-bottom: 1.2rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.ilp-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; margin: 0 0 1rem; color: var(--ink); }
.ilp-hero h1 .grad {
  background: linear-gradient(120deg, #8b5cf6, #6d28d9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ilp-hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 2rem; }
.ilp-hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.ilp-stats { display: flex; gap: 2.5rem; justify-content: center; flex-wrap: wrap; }
.ilp-stat b { display: block; font-size: 1.8rem; color: var(--ink); }
.ilp-stat span { font-size: .85rem; color: var(--muted); font-weight: 600; }

.ilp-search { max-width: 520px; margin: 0 auto 2rem; position: relative; }
.ilp-search input {
  width: 100%; padding: 1rem 1.25rem 1rem 3rem; font-size: 1rem;
  border: 2px solid var(--brand-border); border-radius: 9999px; outline: none;
  font-family: var(--font); transition: border-color .15s, box-shadow .15s;
}
.ilp-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }
.ilp-search .mag { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 1.1rem; }

/* ---------- Sections ---------- */
.ilp-section { padding: 4rem 0; }
.ilp-section.alt { background: #fff; border-top: 1px solid var(--brand-border); border-bottom: 1px solid var(--brand-border); }
.ilp-kicker { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; margin: 0 0 .5rem; }
.ilp-section h2.ilp-h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; margin: 0 0 .6rem; }
.ilp-section .ilp-sub { color: var(--muted); max-width: 620px; margin: 0 0 2.2rem; font-size: 1.05rem; }

/* ---------- Tool cards ---------- */
.ilp-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
.ilp-card-grid.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.ilp-card {
  background: var(--card); border: 1px solid var(--brand-border);
  border-radius: var(--radius); padding: 1.4rem 1.2rem; text-decoration: none;
  display: flex; flex-direction: column; gap: .35rem; color: var(--ink);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.ilp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #c4b5fd; }
.ilp-card-emoji { font-size: 2rem; }
.ilp-card-name { font-weight: 800; font-size: 1.02rem; }
.ilp-card-tag { font-size: .82rem; color: var(--muted); line-height: 1.5; flex: 1; }
.ilp-card-go { font-size: .85rem; font-weight: 700; color: var(--brand); margin-top: .5rem; }

/* ---------- Features ---------- */
.ilp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.ilp-feature { background: var(--card); border: 1px solid var(--brand-border); border-radius: var(--radius); padding: 1.6rem; }
.ilp-feature .fi { font-size: 1.8rem; margin-bottom: .6rem; }
.ilp-feature h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.ilp-feature p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- Steps ---------- */
.ilp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; counter-reset: step; }
.ilp-step { background: var(--brand-soft); border-radius: var(--radius); padding: 1.6rem; position: relative; }
.ilp-step::before {
  counter-increment: step; content: counter(step);
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800;
  display: grid; place-items: center; margin-bottom: .8rem;
}
.ilp-step h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.ilp-step p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- FAQ ---------- */
.ilp-faq { margin-top: 3rem; }
.ilp-faq h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 1.2rem; }
.ilp-faq-list { display: grid; gap: .8rem; }
.ilp-faq-item { background: #fff; border: 1px solid var(--brand-border); border-radius: 1rem; padding: 1rem 1.25rem; }
.ilp-faq-item summary {
  font-weight: 700; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
}
.ilp-faq-item summary::-webkit-details-marker { display: none; }
.ilp-faq-icon { color: var(--brand); font-size: 1.4rem; line-height: 1; transition: transform .2s; flex: none; }
.ilp-faq-item[open] .ilp-faq-icon { transform: rotate(45deg); }
.ilp-faq-item p { color: var(--muted); margin: .7rem 0 0; font-size: .95rem; }

/* ---------- Tool page ---------- */
.ilp-crumb { font-size: .85rem; color: var(--muted); margin: 1.8rem 0 1rem; }
.ilp-crumb a { color: var(--brand); text-decoration: none; font-weight: 600; }
.ilp-tool-head { text-align: center; margin-bottom: 2rem; }
.ilp-tool-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; margin: 0 0 .5rem; }
.ilp-tool-head .ilp-emoji-big { font-size: 3rem; }
.ilp-tool-head p.tag { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto; }
.ilp-engine-badge {
  display: inline-block; margin-top: .9rem; font-size: .78rem; font-weight: 700;
  padding: .3rem .9rem; border-radius: 9999px; letter-spacing: .04em;
}
.ilp-engine-badge.browser { background: #dcfce7; color: #166534; }
.ilp-engine-badge.server { background: #fef3c7; color: #92400e; }
.ilp-tool-stage {
  background: #fff; border: 1px solid var(--brand-border);
  border-radius: 1.5rem; padding: 1.5rem; box-shadow: var(--shadow);
  margin-bottom: 3rem;
}
.ilp-server-note {
  background: #fef3c7; border: 1px solid #fcd34a; border-radius: .9rem;
  padding: .9rem 1.1rem; font-size: .9rem; color: #92400e; margin-bottom: 1.1rem;
}

/* Article prose */
.ilp-article { background: #fff; border: 1px solid var(--brand-border); border-radius: 1.5rem; padding: 2rem clamp(1.25rem, 4vw, 2.75rem); }
.ilp-article h2 { font-size: 1.4rem; font-weight: 800; color: var(--ink); margin: 2rem 0 .7rem; }
.ilp-article h2:first-child { margin-top: 0; }
.ilp-article h3 { font-size: 1.1rem; font-weight: 700; color: var(--ink-soft); margin: 1.4rem 0 .5rem; }
.ilp-article p { margin: .7rem 0; color: #334155; }
.ilp-article ul, .ilp-article ol { margin: .7rem 0 .7rem 1.4rem; color: #334155; }
.ilp-article ul { list-style: disc; } .ilp-article ol { list-style: decimal; }
.ilp-article li { margin: .3rem 0; }
.ilp-article strong { color: var(--ink); }
.ilp-article code { background: var(--brand-soft); padding: .1rem .4rem; border-radius: .35rem; font-size: .9em; }

.ilp-related { margin-top: 3rem; }
.ilp-related h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 1.2rem; }

/* ---------- CTA band ---------- */
.ilp-cta {
  background: linear-gradient(135deg, #7c3aed, #4c1d95); color: #fff;
  border-radius: 1.75rem; padding: 3.5rem 2rem; text-align: center;
  margin: 4rem 0; position: relative; overflow: hidden;
}
.ilp-cta::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(500px 240px at 80% 10%, rgba(255,255,255,.15), transparent 60%);
}
.ilp-cta h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 0 0 .7rem; position: relative; }
.ilp-cta p { opacity: .85; max-width: 540px; margin: 0 auto 1.8rem; position: relative; }
.ilp-cta .ilp-btn { background: #fff; color: var(--brand-dark) !important; position: relative; }

/* ---------- Footer ---------- */
.ilp-footer { background: #1e1b4b; color: #c4b5fd; margin-top: 4rem; }
.ilp-footer-inner { max-width: 1140px; margin: 0 auto; padding: 3.5rem 1.25rem 1.5rem; }
.ilp-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 2rem; margin-bottom: 2.5rem; }
.ilp-footer h4 { color: #fff; margin: 0 0 .9rem; font-size: .95rem; }
.ilp-footer a { color: #c4b5fd; text-decoration: none; font-size: .9rem; display: block; margin-bottom: .5rem; }
.ilp-footer a:hover { color: #fff; }
.ilp-footer .brand p { font-size: .88rem; max-width: 280px; }
.ilp-footer-bottom { border-top: 1px solid rgba(196, 181, 253, .2); padding-top: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; }

/* ---------- Contact form ---------- */
.ilp-form { background: #fff; border: 1px solid var(--brand-border); border-radius: 1.5rem; padding: 2rem clamp(1.25rem, 4vw, 2.5rem); margin-bottom: 4rem; box-shadow: var(--shadow); }
.ilp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ilp-form-field { margin-bottom: 1.1rem; }
.ilp-form-field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .4rem; }
.ilp-form-field input, .ilp-form-field select, .ilp-form-field textarea {
  width: 100%; font-family: var(--font); font-size: 1rem; color: var(--ink);
  border: 2px solid var(--brand-border); border-radius: .8rem; padding: .8rem 1rem;
  outline: none; transition: border-color .15s, box-shadow .15s; background: #fff;
}
.ilp-form-field input:focus, .ilp-form-field select:focus, .ilp-form-field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124, 58, 237, .12);
}
.ilp-form-field textarea { resize: vertical; min-height: 8rem; }
.ilp-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.ilp-form-notice { border-radius: .9rem; padding: .9rem 1.1rem; font-weight: 600; margin: 0 0 1.5rem; }
.ilp-form-notice.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.ilp-form-notice.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.ilp-form-hint { font-size: .85rem; color: var(--muted); margin-top: 1rem; }
@media (max-width: 560px) { .ilp-form-row { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.ilp-404 { text-align: center; padding: 6rem 1.25rem; }
.ilp-404 h1 { font-size: 5rem; margin: 0; color: var(--brand); }
.ilp-404 p { color: var(--muted); margin-bottom: 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .ilp-nav a:not(.ilp-btn) { display: none; }
  .ilp-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .ilp-hero { padding: 3.5rem 1.25rem 3rem; }
  .ilp-card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .ilp-footer-grid { grid-template-columns: 1fr; }
  .ilp-tool-stage { padding: 1rem; }
}
