:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --border: #e7e5e4;
  --accent: #4338ca;
  --accent-text: #ffffff;
  --error: #b91c1c;
  --success: #15803d;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --border: #292524;
    --accent: #818cf8;
    --accent-text: #0c0a09;
    --error: #f87171;
    --success: #4ade80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main, .site-header, .site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--accent); }

.site-header { padding-top: 20px; padding-bottom: 4px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }

h1 { font-size: 2.2rem; line-height: 1.2; margin: 24px 0 8px; }
h2 { font-size: 1.45rem; margin: 40px 0 8px; }
h3 { font-size: 1.1rem; margin: 24px 0 4px; }
.lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; }

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

.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin: 24px 0 8px;
}

.uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .uploads { grid-template-columns: 1fr; }
}

.upload {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
}

.upload-title { font-weight: 650; }
.upload-hint { font-size: 0.9rem; color: var(--muted); }
.upload input { font-size: 0.95rem; max-width: 100%; }

.preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
}

.options { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; }
select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; margin: 12px 0; }
.consent input { margin-top: 5px; flex-shrink: 0; }

.turnstile { min-height: 66px; margin: 8px 0; }

button {
  font: inherit;
  font-weight: 650;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

.tries { font-size: 0.95rem; color: var(--muted); margin: 10px 0 0; }
.message { min-height: 1.6em; margin: 6px 0 0; }
.message[data-kind="error"] { color: var(--error); }
.message[data-kind="success"] { color: var(--success); }

.result { margin-top: 18px; text-align: center; }
.result img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.button-secondary { display: inline-block; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 10px; text-decoration: none; }
.note { font-size: 0.9rem; color: var(--muted); }

.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { font-weight: 600; cursor: pointer; }

.site-footer { margin-top: 48px; padding-bottom: 32px; font-size: 0.9rem; color: var(--muted); border-top: 1px solid var(--border); }

.fixes dt { font-weight: 600; margin-top: 14px; }
.fixes dd { margin: 4px 0 0; }
