/* ══════════════════════════════════════════
   PNG to JPG Converter – Stylesheet
══════════════════════════════════════════ */

#pjc {
  --c-primary:   #f97316;
  --c-primary-d: #ea6c0a;
  --c-primary-l: #ffedd5;
  --c-border:    #e2e8f0;
  --c-surface:   #f8fafc;
  --c-text:      #1e293b;
  --c-muted:     #64748b;
  --c-success:   #16a34a;
  --c-error:     #dc2626;
  --radius:      20px;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 680px;
  margin: 2.5rem auto;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 20px 50px -10px rgba(0,0,0,.13);
  overflow: hidden;
  color: var(--c-text);
}

/* ── Header ─────────────────────────────── */
.pjc__header {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  padding: 2.5rem 2rem 2.2rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.pjc__header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(255,255,255,.12) 0%, transparent 60%);
}
.pjc__icon {
  width: 62px; height: 62px;
  background: rgba(255,255,255,.2);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  position: relative;
}
.pjc__icon svg { width: 30px; height: 30px; }
.pjc__title {
  font-size: 1.65rem; font-weight: 800;
  letter-spacing: -.5px; margin-bottom: .35rem;
  position: relative;
}
.pjc__sub { font-size: .92rem; opacity: .88; position: relative; }

/* ── Steps ──────────────────────────────── */
.pjc__step { padding: 2rem; }

/* ── Drop zone ──────────────────────────── */
.pjc__drop {
  border: 2.5px dashed #fed7aa;
  border-radius: 16px;
  background: #fff7ed;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .1s ease;
  margin-bottom: 1.4rem;
}
.pjc__drop:hover, .pjc__drop.over {
  border-color: var(--c-primary);
  background: #ffedd5;
  transform: scale(1.005);
}
.pjc__drop-body {
  padding: 2.8rem 2rem;
  display: flex; flex-direction: column;
  align-items: center; gap: .9rem; text-align: center;
}
.pjc__drop-icon svg { width: 80px; height: 80px; display: block; }
.pjc__drop-title { font-size: 1.12rem; font-weight: 700; color: var(--c-text); }
.pjc__drop-or    { font-size: .85rem; color: var(--c-muted); }

/* ── Quality box ────────────────────────── */
.pjc__quality-box {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 14px;
  padding: 1.2rem 1.4rem 1rem;
}
.pjc__quality-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .85rem;
}
.pjc__quality-label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .88rem; font-weight: 600; color: var(--c-muted);
}
.pjc__quality-label svg { color: var(--c-primary); }
.pjc__quality-val {
  font-size: 1rem; font-weight: 800; color: var(--c-primary);
  min-width: 42px; text-align: right;
}
.pjc__slider {
  -webkit-appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--c-border); outline: none; cursor: pointer;
  transition: background .1s;
}
.pjc__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(249,115,22,.5);
  cursor: pointer; transition: transform .1s;
}
.pjc__slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.pjc__slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-primary); border: 3px solid #fff; cursor: pointer;
}
.pjc__slider-ends {
  display: flex; justify-content: space-between;
  font-size: .73rem; color: var(--c-muted); margin-top: .5rem;
}

/* ── Converting ─────────────────────────── */
.pjc__converting {
  display: flex; flex-direction: column;
  align-items: center; gap: 1.3rem;
  padding: 3rem 2rem;
}
.pjc__spinner { width: 64px; height: 64px; }
.pjc__spin-svg { animation: pjc-spin .9s linear infinite; width: 100%; height: 100%; }
@keyframes pjc-spin { to { transform: rotate(360deg); } }
.pjc__cvt-title { font-size: 1.05rem; font-weight: 700; color: var(--c-primary); }
.pjc__cvt-file  { font-size: .82rem; color: var(--c-muted); max-width: 300px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Done ───────────────────────────────── */
.pjc__done { display: flex; flex-direction: column; gap: 1.5rem; }

.pjc__cards {
  display: flex; align-items: center; gap: 1rem;
}
.pjc__card {
  flex: 1; border-radius: 14px;
  border: 1.5px solid var(--c-border);
  overflow: hidden; background: var(--c-surface);
}
.pjc__card-badge {
  display: block; padding: .4rem 1rem;
  font-size: .72rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
}
.pjc__card-badge--png { background: #dbeafe; color: #1d4ed8; }
.pjc__card-badge--jpg { background: #ffedd5; color: #9a3412; }

.pjc__card-img {
  display: flex; align-items: center; justify-content: center;
  min-height: 150px; padding: .8rem;
}
.pjc__card-img--checker {
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}
.pjc__card-img img {
  max-width: 100%; max-height: 150px;
  object-fit: contain; display: block; border-radius: 6px;
}
.pjc__card-meta {
  padding: .4rem 1rem;
  font-size: .74rem; color: var(--c-muted);
  border-top: 1px solid var(--c-border); background: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Arrow between cards */
.pjc__mid-arrow {
  display: flex; align-items: center; flex-shrink: 0; gap: 0;
}
.pjc__arrow-line {
  width: 28px; height: 2.5px;
  background: var(--c-primary); border-radius: 999px;
}
.pjc__arrow-head { width: 12px; height: 20px; }

/* Saving badge */
.pjc__saving {
  border-radius: 12px; padding: .7rem 1.1rem;
  font-size: .86rem; font-weight: 600;
  display: flex; align-items: center; gap: .5rem;
}
.pjc__saving--good {
  background: #f0fdf4; border: 1.5px solid #bbf7d0; color: #15803d;
}
.pjc__saving--neutral {
  background: #fefce8; border: 1.5px solid #fef08a; color: #92400e;
}

/* Actions */
.pjc__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────── */
.pjc__btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.6rem; border-radius: 11px;
  font-size: .92rem; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none; border: none;
  transition: all .15s ease;
}
.pjc__btn--primary {
  background: var(--c-primary); color: #fff;
  box-shadow: 0 4px 14px rgba(249,115,22,.4);
}
.pjc__btn--primary:hover { background: var(--c-primary-d); transform: translateY(-2px); color: #fff; box-shadow: 0 6px 20px rgba(249,115,22,.45); }
.pjc__btn--primary:active { transform: translateY(0); }
.pjc__btn--outline {
  background: #fff; color: var(--c-primary);
  border: 2px solid var(--c-primary);
}
.pjc__btn--outline:hover { background: var(--c-primary); color: #fff; }
.pjc__btn--ghost {
  background: transparent; color: var(--c-muted);
  border: 1.5px solid var(--c-border);
}
.pjc__btn--ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ── Error ──────────────────────────────── */
.pjc__error {
  display: flex; align-items: center; gap: .75rem;
  margin: 0 2rem 1.5rem; padding: .95rem 1.2rem;
  background: #fef2f2; border: 1.5px solid #fecaca;
  border-radius: 12px; color: var(--c-error); font-size: .88rem;
}
.pjc__error span { flex: 1; }
.pjc__error button {
  background: none; border: none; color: var(--c-primary);
  font-size: .82rem; font-weight: 700; cursor: pointer;
  font-family: inherit; padding: 0; white-space: nowrap;
}
.pjc__error button:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 540px) {
  .pjc__step   { padding: 1.5rem 1rem; }
  .pjc__cards  { flex-direction: column; }
  .pjc__mid-arrow { transform: rotate(90deg); margin: .25rem 0; }
  .pjc__actions { flex-direction: column; }
  .pjc__btn { width: 100%; justify-content: center; }
  .pjc__drop-body { padding: 2rem 1rem; }
}
