:root {
  --bg: #0f172a;
  --bg-alt: #131f38;
  --panel: #1e293b;
  --panel-2: #172234;
  --border: #2b3a55;
  --text: #e6ebf5;
  --text-dim: #94a3b8;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --accent-dim: rgba(34, 197, 94, 0.15);
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.site-header {
  background: #020617;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.logo-accent { color: var(--accent); }

/* Hero */
.hero {
  text-align: center;
  padding: 48px 0 24px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.lead {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 20px;
}
.privacy-badge {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  margin: 0;
}

/* Ad placeholders */
.ad-slot {
  margin: 24px auto;
  max-width: 900px;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* Dropzone */
.tool { padding-bottom: 32px; }

.dropzone {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone:hover,
.dropzone.dragover {
  background: var(--panel);
}
.dropzone-icon { font-size: 36px; margin-bottom: 8px; }
.dropzone-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.dropzone-sub { color: var(--text-dim); font-size: 14px; margin: 0; }

.error-msg {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 14px;
}

/* Controls panel */
.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.field {
  border: none;
  margin: 0;
  padding: 0;
}
.field legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field-dims { grid-column: span 2; }
@media (max-width: 520px) {
  .field-dims { grid-column: span 1; }
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.preset-btn:hover { border-color: var(--accent); }
.preset-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.dims-row {
  display: flex;
  gap: 12px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  font-size: 13px;
  color: var(--text-dim);
}

input[type="number"],
input[type="text"],
select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: var(--radius-sm);
  width: 100%;
  font-size: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
  cursor: pointer;
}
.checkbox-row input { width: auto; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 6px 0 0;
  min-height: 16px;
}

/* Actions */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.btn {
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
  flex: 1 1 auto;
  min-width: 140px;
  max-width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #06210f;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.convert-progress {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.auto-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* File list / cards */
.file-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.file-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
}

/* Before/after compare block */
.compare {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.compare-block {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}
.compare-arrow {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}
.arrow-v { display: none; }
.file-thumb {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  display: block;
  margin: 0 auto 8px;
  image-orientation: from-image; /* dodatkowe zabezpieczenie EXIF na starszych silnikach */
}
.compare-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin: 0 0 2px;
}
.compare-dims {
  font-size: 13px;
  margin: 0;
}
.compare-size {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}

@media (max-width: 560px) {
  .compare { flex-direction: column; }
  .arrow-h { display: none; }
  .arrow-v { display: inline; }
  .file-thumb { max-width: 120px; }
}

.file-info { min-width: 0; }
.file-name {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.file-meta-row .arrow { color: var(--accent); }
.file-status {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.file-status.status-done { color: var(--accent); border-color: rgba(34,197,94,0.4); }
.file-status.status-error { color: var(--danger); border-color: rgba(248,113,113,0.4); }
.file-status.status-processing { color: #facc15; border-color: rgba(250,204,21,0.4); }

.savings {
  color: var(--accent);
  font-weight: 600;
}
.file-error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
}
.file-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.file-actions .btn {
  padding: 8px 14px;
  font-size: 13px;
}
.progress-bar {
  height: 4px;
  background: var(--panel-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 30%;
  animation: indeterminate 1.1s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { margin-left: -30%; }
  100% { margin-left: 100%; }
}

/* SEO copy */
.seo-copy {
  padding: 24px 0 48px;
  color: var(--text-dim);
  font-size: 14px;
}
.seo-copy h2 { color: var(--text); font-size: 18px; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px 0;
  opacity: 0.6;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-bar-fill { animation: none; }
  .btn, .dropzone, .preset-btn { transition: none; }
}
/* =========================
   FOOTER
   ========================= */

.site-footer {
    margin-top: 56px;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    text-align: center;
}

.footer-brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.footer-brand span {
    color: var(--accent);
}

.footer-brand:hover {
    color: var(--accent);
}

.footer-nav {
    display: flex;
    align-items: center;
}

.footer-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--accent);
}

.footer-copy {
    color: var(--text-dim);
    font-size: 13px;
}

@media (max-width: 600px) {
    .site-footer {
        margin-top: 40px;
        padding: 24px 0;
    }

    .footer-inner {
        flex-direction: column;
        gap: 10px;
    }
}
