/* =========================================================================
   123FileConverter — design system
   Light theme only, indigo/violet brand, green reserved for success/download.
   ========================================================================= */

:root {
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-ink: #4f46e5;
  --success: #10b981;
  --success-ink: #059669;
  --danger: #ef4444;
  --warn: #f59e0b;

  --bg: #f7f7fb;
  --bg-soft: #eef0f6;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --ink: #1f2430;
  --ink-soft: #4b5566;
  --muted: #6b7280;

  --radius: 14px;
  --radius-lg: 22px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 60px -12px rgba(79, 70, 229, .28);
  --wrap: 1280px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.grad {
  background: linear-gradient(105deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .68rem 1.15rem; line-height: 1; transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); text-decoration: none; }
.btn-success { background: linear-gradient(135deg, var(--success), var(--success-ink)); color: #fff; }
.btn-success:hover { text-decoration: none; filter: brightness(1.03); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .45rem .7rem; font-size: .85rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ink); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; }
/* "123" prefix matches the icon's gradient */
.brand-num {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-nav { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.site-nav a { color: var(--ink-soft); font-weight: 500; padding: .45rem .7rem; border-radius: 8px; }
.site-nav a:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.nav-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--ink-soft);
  border-radius: 8px; width: 38px; height: 38px; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.nav-toggle span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 1.5rem; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 0; height: 480px; z-index: 0;
  background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block; font-size: .82rem; font-weight: 600; color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.2rem;
}
.hero-title { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .5rem; }
.hero-sub { font-size: clamp(1rem, 2.2vw, 1.2rem); color: var(--ink-soft); max-width: 620px; margin: 0 auto 2rem; }

/* ---------- Upload widget ---------- */
.uw {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1.6rem; max-width: 720px; margin: 0 auto; text-align: center;
}
.uw-drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 2.4rem 1.2rem; transition: border-color .15s, background .15s; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
}
.uw-drop:hover, .uw-drop:focus-visible { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, transparent); outline: none; }
.uw.dragover .uw-drop { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); }
.uw-cloud { color: var(--brand); }
.uw-cta { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.uw-choose { padding: .8rem 1.6rem; font-size: 1.02rem; }
.uw-hint { margin: 0; color: var(--muted); font-size: .95rem; }

.uw-sources { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.1rem; }
.uw-sources-label { color: var(--muted); font-size: .85rem; margin-right: .2rem; }
.uw-source {
  display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .85rem; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-soft);
  padding: .4rem .7rem; border-radius: 8px; cursor: pointer;
}
.uw-source:hover:not(:disabled) { border-color: var(--brand); color: var(--ink); }
.uw-source:disabled { opacity: .45; cursor: not-allowed; }
.uw-source svg { color: var(--brand); }

.uw-url-panel { display: flex; gap: .5rem; margin-top: .9rem; flex-wrap: wrap; }
.uw-url-input { flex: 1 1 240px; }
input[type="url"], input[type="text"], .uw-url-input {
  font: inherit; padding: .6rem .75rem; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface-2); color: var(--ink);
}
input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; border-color: var(--brand); }

.uw-note { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .82rem; margin: 1rem 0 0; }

/* per-file rows */
.uw-rows { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; text-align: left; }
.uw-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem;
}
.uw-row-ico { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand-ink); font-weight: 700; font-size: .72rem; }
.uw-row-main { min-width: 0; }
.uw-row-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uw-row-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; font-size: .84rem; color: var(--muted); }
.uw-row-to { display: inline-flex; align-items: center; gap: .3rem; }
select {
  font: inherit; font-size: .85rem; padding: .3rem 1.6rem .3rem .55rem; border-radius: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center;
}
.badge { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 5px; text-transform: uppercase; letter-spacing: .02em; }
.badge-client { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success-ink); }
.badge-server { background: color-mix(in srgb, var(--warn) 16%, transparent); color: #b45309; }
.uw-row-actions { display: flex; align-items: center; gap: .5rem; }
.uw-gear { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 7px; width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; }
.uw-gear:hover { color: var(--ink); border-color: var(--border-strong); }
.uw-progress { height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.uw-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s ease; }
.uw-progress.indeterminate .uw-progress-bar { width: 40%; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.uw-status { font-size: .82rem; color: var(--muted); }
.uw-status.done { color: var(--success-ink); font-weight: 600; }
.uw-status.error { color: var(--danger); font-weight: 600; }
.uw-opts { grid-column: 1 / -1; border-top: 1px dashed var(--border); margin-top: .3rem; padding-top: .7rem; display: none; gap: .8rem; flex-wrap: wrap; }
.uw-opts.open { display: flex; }
.uw-opt { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); }
.uw-opt input[type="range"] { width: 140px; }
.uw-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.1rem; flex-wrap: wrap; }

/* ---------- Popular chips ---------- */
.popular { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; margin-top: 1.6rem; }
.popular-label { color: var(--muted); font-size: .85rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-soft);
  padding: .35rem .7rem; border-radius: 999px;
}
.chip:hover { border-color: var(--brand); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.chip-dot { color: var(--success); font-size: 1.1rem; line-height: 0; }

/* ---------- Sections ---------- */
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; text-align: center; margin-bottom: 1.6rem; }
.categories { padding: 3.5rem 0 1.5rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.cat-card {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.4rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); text-decoration: none; }
.cat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.cat-name { font-weight: 700; font-size: 1.08rem; }
.cat-blurb { font-size: .9rem; }

.trust { padding: 3.5rem 0; background: var(--bg-soft); margin-top: 2rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; }
.trust-item { text-align: center; }
.trust-ico { font-size: 2rem; margin-bottom: .4rem; }
.trust-item h3 { font-size: 1.1rem; }

.features { padding: 3rem 0 4rem; }
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.feature h3 { font-size: 1.12rem; }
.feature h3::before { content: "✓"; color: var(--success); font-weight: 800; margin-right: .45rem; }

/* ---------- Category hub ---------- */
.page-head { padding: 2.6rem 0 1rem; text-align: center; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-head .lede { color: var(--ink-soft); max-width: 640px; margin: .3rem auto 0; }
.hub-groups { padding: 2rem 0 3rem; display: grid; gap: 1.4rem; }
.hub-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; box-shadow: var(--shadow-sm); }
.hub-group h3 { font-size: 1rem; margin-bottom: .8rem; display: flex; align-items: center; gap: .5rem; }
.hub-links { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Pair landing ---------- */
.pair-hero { padding: 2.4rem 0 1rem; text-align: center; }
.pair-hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.pair-hero .lede { color: var(--ink-soft); margin-top: .3rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; margin-bottom: .8rem; }
.pill-client { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success-ink); }
.pill-server { background: color-mix(in srgb, var(--warn) 16%, transparent); color: #b45309; }
.content-section { padding: 1.5rem 0; }
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; counter-reset: step; }
.howto-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; position: relative; }
.howto-step::before { counter-increment: step; content: counter(step); position: absolute; top: -14px; left: 1.2rem; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-weight: 700; }
.howto-step h3 { font-size: 1rem; margin-top: .4rem; }
.explainer { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.explainer .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.4rem; margin-top: 1.5rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .7rem; background: var(--surface); overflow: hidden; }
.faq-q { width: 100%; text-align: left; font: inherit; font-weight: 600; padding: 1rem 1.2rem; background: transparent; border: 0; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-q::after { content: "+"; font-size: 1.4rem; color: var(--brand); transition: transform .2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 1.2rem; max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; color: var(--ink-soft); }
.faq-item.open .faq-a { padding: 0 1.2rem 1.1rem; max-height: 400px; }

/* ---------- Related links / all tools ---------- */
.related { padding: 2rem 0 3rem; }
.related h2 { font-size: 1.2rem; }
.link-farm { display: flex; flex-wrap: wrap; gap: .5rem; }
.tools-cat { margin-bottom: 2rem; }
.tools-cat h2 { font-size: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: 1rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }

/* ---------- Error ---------- */
.error-page { padding: 5rem 0; text-align: center; }
.error-code { font-size: clamp(4rem, 12vw, 8rem); font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Footer ---------- */
.site-footer {
  /* Dark footer — fixed tones so it reads the same regardless of page theme. */
  --footer-fg:    rgba(255, 255, 255, .72);
  --footer-head:  rgba(255, 255, 255, .5);
  --footer-line:  rgba(255, 255, 255, .1);
  --footer-hover: #a5b4fc;
  background: #12151e;
  color: var(--footer-fg);
  border-top: 1px solid var(--footer-line);
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid { display: grid; grid-template-columns: minmax(220px, 1.7fr) repeat(auto-fit, minmax(130px, 1fr)); gap: 2rem 1.6rem; }
.footer-brand .brand-text { color: #fff; }
.footer-brand p { max-width: 280px; font-size: .9rem; color: var(--footer-fg); margin-top: .6rem; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--footer-head); margin-bottom: .8rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.footer-col a { color: var(--footer-fg); font-size: .9rem; }
.footer-col a:hover { color: var(--footer-hover); text-decoration: none; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.3rem; border-top: 1px solid var(--footer-line); font-size: .85rem; }
.footer-bottom .muted { color: var(--footer-head); }

/* toast */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 9px; font-size: .9rem; box-shadow: var(--shadow-md); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-nav { position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--border); padding: .8rem; gap: .2rem; transform: translateY(-120%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .site-nav.open { transform: translateY(0); }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .explainer { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .uw { padding: 1rem; }
  .uw-row { grid-template-columns: 1fr; }
  .uw-row-ico { display: none; }
}
