/* FormFit Image – mobile-first styles. No framework. */
:root {
  --blue: #1d4ed8; --blue-dark: #1e40af; --bg: #f5f7fb; --card: #fff;
  --text: #111827; --muted: #6b7280; --border: #d1d5db;
  --ok: #15803d; --err: #b91c1c; --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--blue); }
[hidden] { display: none !important; }

.site-header { background: var(--card); border-bottom: 1px solid var(--border); padding: 12px 16px; }
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.brand span { color: var(--blue); }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.hero h1 { font-size: 1.35rem; line-height: 1.3; margin: 4px 0 8px; }
.privacy-note { margin: 0 0 16px; font-size: .9rem; color: var(--ok); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.field-group { border: 0; margin: 0 0 20px; padding: 0; }
.field-group legend { font-weight: 700; margin-bottom: 10px; padding: 0; }

/* Segmented radio buttons */
.segmented { display: flex; gap: 8px; }
.segmented label {
  flex: 1; text-align: center; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 8px; min-height: 48px; cursor: pointer; font-weight: 600; user-select: none;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { border-color: var(--blue); background: #eff6ff; color: var(--blue); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.segmented.small { margin-top: 12px; }
.segmented.small label { padding: 10px 6px; min-height: 44px; font-size: .9rem; }

/* Preset chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 10px 14px; min-height: 44px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--text);
}
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Inputs */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; font-size: .9rem; font-weight: 600; gap: 4px; }
.field small { font-weight: 400; color: var(--muted); }
.field input {
  font: inherit; font-size: 16px; /* prevents iOS zoom */
  padding: 10px 12px; min-height: 46px; border: 1px solid var(--border); border-radius: 10px; width: 100%;
}
.field input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }

/* File picker */
.file-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--blue); border-radius: var(--radius); background: #eff6ff;
  padding: 24px 16px; min-height: 110px; cursor: pointer; text-align: center; font-weight: 600; color: var(--blue-dark);
}
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.file-drop-icon { font-size: 1.8rem; }

.preview { margin: 14px 0 0; text-align: center; }
.preview img { max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.preview figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }

.btn-primary {
  display: block; width: 100%; margin-top: 16px; min-height: 52px; border: 0; border-radius: var(--radius);
  background: var(--blue); color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
}
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.error { color: var(--err); font-size: .9rem; margin: 10px 0 0; }
.muted { color: var(--muted); font-size: .9rem; }

.result { border-top: 1px solid var(--border); padding-top: 16px; }
.result-title { font-size: 1.15rem; margin: 0 0 12px; }
.result-preview { margin: 0 0 12px; text-align: center; }
.result-preview img { max-width: 100%; max-height: 280px; border: 1px solid var(--border); border-radius: 8px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; font-size: .92rem; }
.checklist li { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; }
.checklist li.pass { background: #f0fdf4; }
.checklist li.fail { background: #fef2f2; color: var(--err); }
.btn-link { text-align: center; text-decoration: none; line-height: 52px; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-secondary {
  flex: 1; min-height: 46px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
}
.small { font-size: .82rem; }
.spinner {
  display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.guide { margin-top: 24px; }
.guide h2 { font-size: 1.15rem; }
.guide ol { padding-left: 20px; }

.guide details { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; margin-bottom: 8px; }
.guide summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
.guide details p { margin: 0 0 12px; }
.spec-box { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: .92rem; }
.spec-box h2 { font-size: 1rem; margin: 0 0 6px; }
.spec-box p { margin: 6px 0; }
.page-content { max-width: 640px; margin: 0 auto; padding: 16px; }
.page-content h1 { font-size: 1.35rem; }

.site-footer { text-align: center; padding: 24px 16px; color: var(--muted); font-size: .85rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-bottom: 8px; }
.footer-nav a { display: inline-block; padding: 8px 0; }

@media (min-width: 640px) {
  .hero h1 { font-size: 1.7rem; }
  .card { padding: 24px; }
}
