/* CatchCheck website styles — shared by the home page, privacy, and terms. */

:root {
  --navy: #14324f;
  --green: #3e7a4c;
  --green-dark: #2f6039;
  --green-tint: #e8f1ea;
  --bg: #f4f5f1;
  --card: #ffffff;
  --line: #e1e4dd;
  --line-strong: #c4cbc0;
  --ink: #17222c;
  --muted: #5b6761;
  --amber-bg: #fef3c7;
  --amber-line: #f0d98c;
  --amber-ink: #6b3a0a;
  --red-bg: #fef2f2;
  --red-line: #f5b5b5;
  --red-ink: #a61b1b;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green); }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #fff; color: var(--navy); padding: .6rem .9rem; border-radius: 8px; z-index: 20;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- header / footer ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .inner {
  max-width: 1040px; margin: 0 auto; padding: .7rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand img { height: 44px; width: auto; display: block; }
.wordmark { font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); }
.wordmark span { color: var(--green); }
.header-tag { font-size: 14px; color: var(--muted); }
@media (max-width: 559px) { .header-tag { display: none; } }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.site-footer .inner {
  max-width: 1040px; margin: 0 auto; padding: 1.25rem 1rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--muted);
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--green-dark); }

/* ---------- page layout ---------- */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 1.5rem 1rem 2.25rem; flex: 1; }

.intro { max-width: 640px; margin-bottom: 1.5rem; }
.intro h1 {
  font-size: clamp(25px, 4.4vw, 35px); line-height: 1.15; letter-spacing: -.015em;
  color: var(--navy); font-weight: 700; text-wrap: balance;
}
.intro p { margin-top: .6rem; color: var(--muted); font-size: 17px; max-width: 58ch; }

.layout { display: grid; gap: 1rem; }
.stack { display: grid; gap: 1rem; align-content: start; }
@media (min-width: 880px) {
  .layout { grid-template-columns: minmax(360px, 440px) 1fr; gap: 1.5rem; align-items: start; }
  .side { position: sticky; top: 1rem; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.card h2 { font-size: 18px; color: var(--navy); }

/* ---------- form ---------- */
.label { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: .5rem; }
.label .hint { font-weight: 400; color: var(--muted); }

input[type="text"] {
  width: 100%; padding: .7rem .8rem; border: 1px solid var(--line-strong); border-radius: 10px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); -webkit-appearance: none; appearance: none;
}
input[type="text"]::placeholder { color: #7b867f; }
input[type="text"]:focus { border-color: var(--navy); }

.row { display: flex; flex-wrap: wrap; gap: .5rem; }
.row input { flex: 1 1 200px; min-width: 0; }

button {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .6rem 1rem; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  touch-action: manipulation;
}
button:hover { background: #f1f3ee; }
button svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  width: 100%; min-height: 52px; font-size: 17px;
  background: var(--green); border-color: var(--green); color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
.btn-primary:disabled { background: #d8dcd4; border-color: #d8dcd4; color: #5b6761; cursor: not-allowed; }

.ready-hint { font-size: 14px; color: var(--muted); text-align: center; margin-top: .6rem; min-height: 1.4em; }

.status { font-size: 13px; margin-top: .5rem; color: var(--muted); }
.status.ok { color: var(--green-dark); }
.status.err { color: var(--red-ink); }

/* photo upload */
.upload-zone {
  border: 2px dashed var(--line-strong); border-radius: 12px; padding: 1.5rem 1rem;
  text-align: center; background: #fafbf8; transition: border-color .15s, background .15s;
}
.upload-zone.dragging { border-color: var(--green); background: var(--green-tint); }
.upload-icon { width: 46px; height: 46px; margin: 0 auto .5rem; color: var(--green); }
.drop-hint { color: var(--muted); margin-bottom: .9rem; }
.photo-btns { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.photo-btn { flex: 1 1 140px; max-width: 220px; border-color: var(--green); color: var(--green-dark); }
.photo-btn:hover { background: var(--green-tint); }
.fine { font-size: 12.5px; color: var(--muted); margin-top: .75rem; }

/* Camera button only where it does something (phones/tablets). On desktop the
   browser ignores camera capture, so we show drag-and-drop instead. */
.touch-only { display: none; }
@media (pointer: coarse) {
  .touch-only { display: inline-flex; }
  .mouse-only { display: none; }
}

#preview-wrap { display: none; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
#preview-img { width: 100%; max-height: 300px; object-fit: contain; display: block; background: #eceee8; }
.preview-actions { padding: .6rem; display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; background: #fafbf8; }

/* loading / errors */
.loading { display: none; text-align: center; padding: .75rem; color: var(--muted); font-size: 15px; }
.spinner {
  display: inline-block; width: 20px; height: 20px; vertical-align: -4px; margin-right: .5rem;
  border: 3px solid #d5dbd2; border-top-color: var(--green); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.error-box {
  display: none; background: var(--red-bg); border: 1px solid var(--red-line); color: var(--red-ink);
  border-radius: 10px; padding: .75rem .9rem; font-size: 14px; line-height: 1.5;
}

/* ---------- result ---------- */
.result { display: none; }
.result, .error-box, .upload-zone { scroll-margin-top: 12px; }
.result:focus { outline: none; }
.fish-name { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.confidence {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px;
  margin-left: 8px; vertical-align: middle;
}
.conf-high { background: #d6efdf; color: #14532d; }
.conf-medium { background: #fef3c7; color: #78350f; }
.conf-low { background: #fee2e2; color: #7f1d1d; }
.fish-latin { font-size: 14px; color: var(--muted); font-style: italic; margin: 2px 0 1rem; }
.fish-latin:empty, .reg-notes:empty { display: none; }

.ai-notice {
  background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber-ink);
  border-radius: 10px; padding: .65rem .9rem; font-size: 14px; line-height: 1.5; margin-bottom: 1rem;
}

.reg-heading { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: .5rem; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.reg-item { background: #f6f7f3; border-radius: 10px; padding: .65rem .8rem; }
.ri-label { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: .04em; }
.ri-value { font-size: 16px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.reg-notes { font-size: 14px; color: #34413b; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 1rem; margin-bottom: .75rem; }
.disclaimer { font-size: 12px; color: var(--muted); line-height: 1.6; border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .25rem; }
.result-actions { margin-top: 1rem; }

/* ---------- how it works ---------- */
.steps { list-style: none; counter-reset: step; display: grid; gap: 1rem; margin: 1rem 0; }
.steps li { counter-increment: step; position: relative; padding-left: 2.5rem; color: var(--muted); }
.steps li strong { display: block; color: var(--ink); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--green-tint); color: var(--green-dark); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- legal pages ---------- */
.legal { width: 100%; max-width: 720px; margin: 0 auto; padding: 2rem 1rem 3rem; flex: 1; }
.legal h1 { font-size: 30px; color: var(--navy); letter-spacing: -.01em; }
.legal .date { font-size: 14px; color: var(--muted); margin: .25rem 0 1.5rem; }
.legal h2 { font-size: 18px; color: var(--navy); margin: 1.75rem 0 .5rem; }
.legal p, .legal li { font-size: 16px; color: #2b3731; margin-bottom: .8rem; max-width: 68ch; }
.legal ul { padding-left: 1.3rem; }
.legal strong { color: var(--ink); }
