/*
 * Bergstreme design tokens and page shell — Poppins, ink header, navy actions, matching
 * bergstreme.co.za.
 *
 * Taken from bergstreme-snag-portal's styles.css, which is the same shell, then cut down to what
 * this app actually renders: the snag cards, photo tiles, lightbox, client dashboard and progress
 * bars went with it. 114 of its 138 classes were another project's UI, and a stylesheet that
 * describes screens this app does not have is the kind of thing someone later reads as a spec.
 * The grid itself is in grid.css.
 */

:root {
  --ink: #121212;
  --navy: #08336C;
  --navy-deep: #062754;
  --text: #2E2E2E;
  --muted: #6B6B6B;
  --grey: #D6D3D1;
  --light: #F1F1F1;
  --sky: #62A5CF;
  --pale: #E2EDF4;
  --white: #FFFFFF;
  --danger: #B3261E;
  --danger-bg: #FBEDEC;
  --amber: #D9822B;
  --green: #2E8B57;
  --radius-card: 12px;
  --radius-input: 10px;
  --radius-pill: 30px;
  --shadow: 0 1px 2px rgba(18, 18, 18, 0.04), 0 4px 14px rgba(18, 18, 18, 0.06);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bar-h: 88px;
}

* { box-sizing: border-box; }

html { color-scheme: light; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--light);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.has-bar main { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 24px); }

img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ---------- header ---------- */
.topbar {
  background: var(--ink);
  color: var(--white);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.topbar__logo { width: 150px; height: auto; }
.topbar__tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}
@media (max-width: 339px) { .topbar__tag { display: none; } }

/* ---------- layout & type ---------- */
main { padding-top: 28px; padding-bottom: 48px; }

h1 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 8px;
}
.lede { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
p { margin: 0 0 12px; }

.stack > * + * { margin-top: 12px; }

/* ---------- cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--grey);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn--primary:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.btn--secondary { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn--secondary:hover { background: var(--pale); }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn:focus-visible, .linkbtn:focus-visible {
  outline: 2px solid var(--sky); outline-offset: 2px;
}

.linkbtn {
  background: none;
  border: 0;
  padding: 10px 0;
  min-height: 44px;
  color: var(--navy);
  font-weight: 500;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(8, 51, 108, 0.35);
}
.linkbtn:hover { text-decoration-color: var(--navy); }

.iconbtn {
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.iconbtn:hover { background: var(--light); color: var(--danger); }
.iconbtn svg { width: 20px; height: 20px; }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
}
.label .opt { font-weight: 400; color: var(--muted); }
.field-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-size: 16px;
  border: 1.5px solid var(--grey);
  border-radius: var(--radius-input);
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: #9A9A9A; }
.input:focus { border-color: var(--navy); }
.input.is-invalid { border-color: var(--danger); }
textarea.input { resize: none; line-height: 1.45; min-height: 72px; overflow: hidden; }

.field-error { color: var(--danger); font-size: 13px; margin: 8px 0 0; font-weight: 500; }

/* honeypot: hidden from humans, visible to bots */

/* ---------- notices ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--pale);
  color: var(--navy);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  margin: 14px 0 0;
}
.notice .spinner { flex: none; }

.alert {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 14px;
}
.alert ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }
.alert li + li { margin-top: 3px; }

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(8, 51, 108, 0.2);
  border-top-color: var(--navy);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  background: var(--ink); color: var(--white);
  border-radius: var(--radius-pill);
  padding: 10px 10px 10px 18px;
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(18, 18, 18, 0.25);
  z-index: 30;
  max-width: calc(100% - 40px);
  animation: rise 0.2s ease;
}
body:not(.has-bar) .toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.toast button {
  background: rgba(255, 255, 255, 0.14); color: var(--white);
  border: 0; border-radius: var(--radius-pill);
  min-height: 36px; padding: 0 14px; font-weight: 600; font-size: 13px; letter-spacing: 0.02em;
}
@keyframes rise { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .progress.is-indeterminate .progress__bar { width: 100%; opacity: 0.5; }
  .spinner { border-top-color: var(--navy); border-color: var(--navy); opacity: 0.6; }
}

@media (min-width: 600px) {
  main { padding-top: 40px; }
  h1 { font-size: 30px; }
  .card { padding: 24px; }
}
