/* Compress PDF — app-specific styles. Shared tokens/components come from ../styles.css
   (dropped beside this app by the build). Reuses the shared .grid/.card/.ic vocabulary
   for the benefit strip so it stays visually identical to the landing pages. */

/* Wide working-tool layout (restored per owner request — this fills a real
   monitor, not a marketing column). The header's boxed navy chrome is pinned to
   the SAME width via --sa-boxed-maxw so header and tool line up edge-to-edge,
   and the type below is scaled up to match so text fills the boxes at this
   width instead of looking tiny (the SaaS-redesign pass shrank it). */
body.shell { --sa-boxed-maxw: 1280px; }
.wrap { max-width: 1280px; padding: 20px 48px 26px; position: relative; z-index: 1; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Warm peach glow rising from the bottom-left + a faint sparkle bottom-right,
   painted behind the content (z-index:-1) over the light gray body. */
body.shell::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(65% 60% at 0% 100%, rgba(237,131,54,.55), rgba(246,181,69,.22) 45%, transparent 78%),
    radial-gradient(38% 36% at 100% 100%, rgba(246,181,69,.20), transparent 70%);
}
body.shell::after {
  content: ""; position: fixed; right: 5%; bottom: 12%; width: 46px; height: 46px; z-index: -1; pointer-events: none;
  opacity: .5;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c7cede' d='M12 0c.6 6.3 5.7 11.4 12 12-6.3.6-11.4 5.7-12 12-.6-6.3-5.7-11.4-12-12C6.3 11.4 11.4 6.3 12 0z'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* --- Tool hero --- */
.tool-hero { text-align: center; padding: 2px 0 12px; }
.tool-hero h1 { font-size: clamp(34px, 3.4vw, 44px); line-height: 1.12; }
.tool-hero-lead { color: var(--muted); font-size: 18px; margin: 6px auto 0; max-width: 640px; }
.tool-hero-trust {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  color: #23499e; background: var(--accent-soft); border: 1px solid #c7dafb;
  padding: 9px 18px; border-radius: 999px; font-size: 15px; font-weight: 600;
}
.tool-hero-trust svg { color: var(--accent); flex: none; }

/* --- Drop zone --- */
.dropzone { transition: none; }
.upload-card {
  display: grid; place-items: center; gap: 10px; text-align: center;
  padding: 24px 40px; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.dropzone.dragover .upload-card { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-hover); }
.upload-ic {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.upload-ic svg { width: 34px; height: 34px; }
.upload-card h2 { font-size: 25px; font-weight: 700; }
.upload-card p { color: var(--muted); font-size: 17px; max-width: 500px; }
#pick-file { background: linear-gradient(135deg, #4a84f5, #2f6df0); box-shadow: 0 6px 22px rgba(47,109,240,.35); margin-top: 6px; font-size: 18px; padding: 17px 34px; }

/* --- Trust group (benefit cards + status line) — a plain layout wrapper only.
   No background/border of its own: the cards sit directly on the page's gray
   background, not inside a second boxed panel. --- */
.info-panel { margin-top: 14px; }
.info-panel .benefits.grid { margin: 0; gap: 22px; }
/* Scale the benefit cards up from the small shared defaults so their type fills
   the boxes at this wider layout (shared .card is h3 17 / p 14.5 / pad 24). */
.info-panel .card { padding: 18px 22px; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.info-panel .card h3 { font-size: 20px; margin-bottom: 9px; }
.info-panel .card p { font-size: 16.5px; line-height: 1.5; }
.info-panel .card .ic { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 16px; }
.info-panel .card .ic svg { width: 24px; height: 24px; }
.info-panel .card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--line-strong); }
/* Colored icon tiles — white glyph on a solid brand color, matching the hub cards. */
.info-panel .card .ic { color: #fff; }
.info-panel .card .ic-blue  { background: var(--accent); }
.info-panel .card .ic-amber { background: var(--amber); }
.info-panel .card .ic-green { background: var(--good); }

/* --- File list --- */
.filelist-section { margin-top: 34px; }
.filelist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.filelist-head .num { font-size: 14px; font-weight: 600; color: var(--muted); }
.filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.file-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--shadow); animation: rise .22s ease both;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.file-card:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.file-card-icon {
  width: 42px; height: 54px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg);
  display: grid; place-items: center; color: var(--accent); flex: none;
}
.file-card-body { flex: 1; min-width: 0; }
.file-card-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 16px; }
.file-card-meta { color: var(--muted); font-size: 14px; margin-top: 3px; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  background: transparent; border: 1px solid var(--line); color: var(--text); cursor: pointer; flex: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* --- Compression level selector --- */
.mode-section { margin-top: 30px; }
.mode-fieldset { border: none; padding: 0; margin: 0; }
.mode-fieldset legend { font-weight: 700; font-size: 19px; padding: 0 0 14px; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.mode-opt {
  position: relative; display: flex; flex-direction: column; gap: 4px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 16px 18px; cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease, transform .12s ease;
}
.mode-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-opt-label { font-weight: 600; font-size: 16.5px; color: inherit; }
.mode-opt-hint { color: var(--muted); font-size: 14px; }
.mode-opt:not(:has(input:checked)):hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); transform: translateY(-1px); }
.mode-opt:has(input:checked) {
  color: #fff; background: linear-gradient(160deg, #4a84f5, #2f6df0); border-color: transparent;
  box-shadow: 0 0 0 3px rgba(47,109,240,.28);
}
.mode-opt:has(input:checked) .mode-opt-hint { color: rgba(255,255,255,.85); }
.mode-opt:has(input:focus-visible) { outline: none; box-shadow: 0 0 0 3px rgba(47,109,240,.28); border-color: #2f6df0; }

.level-warning {
  display: flex; align-items: flex-start; gap: 9px; margin: 16px 0 0; padding: 12px 14px;
  background: #fffaeb; border: 1px solid #fde68a; border-radius: 10px; color: #92400e; font-size: 15px;
}
.level-warning svg { flex: none; margin-top: 2px; }

.mode-error { color: #b91c1c; font-size: 13px; font-weight: 600; min-height: 18px; margin-top: 10px; }
.mode-action { margin-top: 18px; }

/* Compress PDF button in Tip Jar amber, matching Merge/Split PDF's action button. */
#btn-compress { background: linear-gradient(135deg, #f6b545, var(--amber)); color: #2a1500; box-shadow: 0 6px 22px rgba(237,131,54,.35); }

/* --- Progress --- */
.progress { margin-top: 30px; }
.progress-stage { font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.progress-bar { height: 9px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .2s ease; }

/* --- Results --- */
.results { margin-top: 30px; }
.resbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.resbar .num { font-size: 14px; font-weight: 600; color: var(--muted); }
.results-list { display: flex; flex-direction: column; gap: 8px; }
.result-row {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; flex-wrap: wrap;
  box-shadow: var(--shadow); animation: rise .22s ease both;
}
.result-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 16px; }
.result-size { color: var(--muted); font-size: 14.5px; flex: none; }
.result-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex: none; }
.result-badge.saved { background: rgba(28,164,99,.14); color: var(--good); }
.result-badge.kept { background: rgba(102,102,119,.14); color: var(--muted); }
.btn-sm {
  background: var(--surface); color: var(--accent); border: 1px solid var(--accent);
  border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; flex: none;
  transition: background .12s ease, transform .12s ease;
}
.btn-sm:hover { background: rgba(47,109,240,.08); }
.result-row .btn-sm { background: #2f6df0; color: #fff; border: 2px solid #2f6df0; border-radius: 999px; }
.result-row .btn-sm:hover { background: #2159cf; border-color: #2159cf; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
#download-all { background: #fff; color: #2f6df0; border: 2px solid #2f6df0; border-radius: 999px; box-shadow: none; }
#download-all:hover { background: rgba(47,109,240,.06); transform: translateY(-2px); }
/* .btn's `display: inline-flex` outranks the UA [hidden] rule (author vs user-agent origin),
   so a hidden .btn stays visible unless overridden explicitly here. */
#download-all[hidden] { display: none; }

/* --- Privacy status line — sits at the bottom of the grouped trust panel,
   flush with the card grid above it (no left/right offset of its own). --- */
.privacy {
  margin: 14px 0 0; display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 15.5px;
}
.privacy .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.privacy .dot.good { background: var(--good); box-shadow: 0 0 0 3px rgba(28,164,99,.18); }

/* --- Toast --- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- Mobile: sticky compress action --- */
@media (max-width: 640px) {
  .mode-action {
    position: sticky; bottom: 0; margin: 16px -24px 0; padding: 12px 24px;
    background: linear-gradient(180deg, rgba(238,241,246,0), var(--bg) 30%);
  }
  .mode-action .btn { width: 100%; justify-content: center; }
  .result-row { flex-wrap: wrap; }
  .upload-card { padding: 40px 20px; }
}
