/* =====================================================================
   SR&C design system — shared by public site, field app and admin.
   Soft Solomon Islands-inspired palette: ocean blue, natural green and warm gold.
   All text/background pairs listed here pass WCAG AA (4.5:1+).
   ===================================================================== */
:root {
  /* Color tokens */
  --c-lagoon: #356B8C;        /* softened ocean blue — primary actions and links */
  --c-lagoon-dark: #294F68;   /* deeper muted blue — headings and hover */
  --c-lagoon-tint: #EAF1F4;   /* soft blue backgrounds */
  --c-sunset: #E7C96F;        /* warm, muted gold — accent */
  --c-sunset-tint: #FBF6E8;   /* pale gold backgrounds */
  --c-sunset-text: #7A5A00;   /* dark gold for TEXT — gold itself is too light to read (1.6:1); this is 5.6:1+ */
  --c-navy: #01122f;           /* the logo's wordmark navy — brand bars, admin sidebar */
  --c-ink: #1b2629;           /* body text — 15:1 on white */
  --c-muted: #4d5c60;         /* secondary text — 6.9:1 on white */
  --c-line: #cfdadb;          /* borders */
  --c-sand: #f6f3ec;          /* page background */
  --c-surface: #ffffff;
  --c-ok: #3F7050;   --c-ok-tint: #EAF2EC; /* natural flag-inspired green */
  --c-warn: #7a4f00; --c-warn-tint: #fff3d6;
  --c-bad: #a3231b;  --c-bad-tint: #fbe7e5;
  --c-focus: #D5AD3F;         /* warm gold focus ring */

  /* Type: system fonts by default (zero download). The public site adds
     one web font for headings unless low-data mode is on. */
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --f-head: var(--f-body);

  /* Spacing & shape */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --tap: 44px;                /* minimum tap target (WCAG 2.2) */
}

/* ---------- Reset & base ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--f-body); color: var(--c-ink); background: var(--c-sand); }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }   /* components with display:flex must still hide */
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.2; color: var(--c-lagoon-dark); margin: 0 0 var(--s-3); }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 var(--s-4); }
a { color: var(--c-lagoon); text-underline-offset: 2px; }
a:hover { color: var(--c-lagoon-dark); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--c-ink); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--c-ink); color: #fff; padding: var(--s-3) var(--s-4); z-index: 100; }
.skip-link:focus { left: var(--s-2); }

/* ---------- Layout helpers ---------------------------------------- */
.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2rem); margin-inline: auto; }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.section { padding-block: var(--s-7); }
.muted { color: var(--c-muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- Buttons ------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5); border-radius: var(--radius);
  font: 600 1rem/1 var(--f-body); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; background: var(--c-lagoon); color: #fff;
}
.btn:hover { background: var(--c-lagoon-dark); color: #fff; }
.btn-secondary { background: var(--c-surface); color: var(--c-lagoon-dark); border-color: var(--c-lagoon); }
.btn-secondary:hover { background: var(--c-lagoon-tint); color: var(--c-lagoon-dark); }
.btn-accent { background: var(--c-sunset); color: var(--c-ink); }
.btn-accent:hover { background: #D8B957; color: var(--c-ink); }
.btn-danger { background: var(--c-surface); color: var(--c-bad); border-color: var(--c-bad); }
.btn-danger:hover { background: var(--c-bad-tint); color: var(--c-bad); }
.btn-ghost { background: transparent; color: var(--c-lagoon); padding-inline: var(--s-3); }
.btn-ghost:hover { background: var(--c-lagoon-tint); color: var(--c-lagoon-dark); }
.btn-lg { min-height: 56px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 var(--s-3); font-size: .9rem; }   /* desktop admin only */

/* ---------- Cards & panels ---------------------------------------- */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-5); box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }

/* ---------- Forms (every input has a visible label) --------------- */
.field { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: var(--s-4); }
.field label, .field legend, .label { font-weight: 600; }
.field .hint { color: var(--c-muted); font-size: .9rem; }
.req { color: var(--c-bad); font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=file], select, textarea {
  font: inherit; color: inherit; width: 100%; min-height: var(--tap);
  padding: var(--s-2) var(--s-3); border: 2px solid #8b9a9d; border-radius: 8px; background: #fff;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--c-lagoon); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s-4); }
.check { display: flex; gap: var(--s-3); align-items: flex-start; min-height: var(--tap); padding-block: var(--s-2); }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--c-lagoon); }
.field-error { color: var(--c-bad); font-weight: 600; }
.hp-field { position: absolute; left: -9999px; }   /* spam honeypot: humans never see it */

/* ---------- Status: ALWAYS icon/word + color, never color alone ---- */
.badge {
  display: inline-flex; align-items: center; gap: .35em; padding: .15em .6em; border-radius: 999px;
  font-size: .85rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap;
  background: var(--c-surface); color: var(--c-muted);
}
.badge-ok   { color: var(--c-ok);   background: var(--c-ok-tint); }
.badge-warn { color: var(--c-warn); background: var(--c-warn-tint); }
.badge-bad  { color: var(--c-bad);  background: var(--c-bad-tint); }
.badge-info { color: var(--c-lagoon-dark); background: var(--c-lagoon-tint); }

.alert { padding: var(--s-4); border-radius: var(--radius); border-left: 6px solid; margin-bottom: var(--s-4); background: var(--c-surface); }
.alert-ok   { border-color: var(--c-ok);   background: var(--c-ok-tint); }
.alert-warn { border-color: var(--c-warn); background: var(--c-warn-tint); }
.alert-bad  { border-color: var(--c-bad);  background: var(--c-bad-tint); }
.alert-info { border-color: var(--c-lagoon); background: var(--c-lagoon-tint); }
.alert > :last-child { margin-bottom: 0; }

/* ---------- Tables ------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--c-surface); }
th, td { text-align: left; padding: var(--s-3); border-bottom: 1px solid var(--c-line); vertical-align: top; }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); background: #fbfaf7; }

/* ---------- Placeholder images (spec: label placeholders) --------- */
.ph-img {
  display: grid; place-items: center; text-align: center; color: var(--c-lagoon-dark);
  background: repeating-linear-gradient(45deg, var(--c-lagoon-tint), var(--c-lagoon-tint) 12px, #d6eaea 12px, #d6eaea 24px);
  border-radius: var(--radius); font-weight: 600; font-size: .9rem; padding: var(--s-4); aspect-ratio: 16/9;
}

/* ---------- Brand mark (placeholder wordmark + icon) -------------- */
.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--c-navy); font-weight: 700; }
.brand img { width: 36px; height: 36px; }
.brand img.brand-logo { width: min(240px, 70vw); height: auto; }   /* full logo (heart + name) */
.brand-name { font-family: var(--f-head); font-size: 1.1rem; line-height: 1.1; }

/* ---------- Simple version of the new look (field app, admin, logins) ----
   Same colours and square corners as the public site, but no web font, no
   photos and no layout changes: the field app must stay light for slow,
   costly data. Headings use Georgia, which is already on every phone/PC. */
.admin, .field-app, .auth-page {
  --c-navy: #14294b;
  --c-navy-ink: #14294b;
  --c-lagoon: #1d4f91;        /* links & primary buttons — 8:1 on white */
  --c-lagoon-dark: #14294b;   /* headings — 13:1 on white */
  --c-lagoon-tint: #e9eef6;
  --c-ok: #1f6b3a;  --c-ok-tint: #e8f0e6;
  --c-sunset: #f2b705;        /* gold fills only, with dark text (9:1) */
  --c-sunset-tint: #fbf3dc;
  --c-sand: #f6f1e7;
  --c-line: #d9d1c0;
  --c-muted: #4f5866;         /* 7:1 on white */
  --f-head: Georgia, "Times New Roman", serif;
  --radius: 2px;
  --shadow: none;
}
.admin h1, .admin h2, .admin h3, .field-app h1, .field-app h2, .field-app h3, .auth-page h1, .auth-page h2 { font-weight: 600; letter-spacing: -.005em; }
.admin .btn, .field-app .btn, .auth-page .btn { border-radius: 2px; }
.admin .btn-accent, .field-app .btn-accent, .auth-page .btn-accent { color: var(--c-navy-ink); }
.admin .btn-accent:hover, .field-app .btn-accent:hover, .auth-page .btn-accent:hover { background: #dba500; color: var(--c-navy-ink); }
.admin :is(input:not([type=radio]):not([type=checkbox]), select, textarea), .field-app :is(input:not([type=radio]):not([type=checkbox]), select, textarea), .auth-page :is(input:not([type=radio]):not([type=checkbox]), select, textarea) { border-radius: 2px; }
.admin .card, .field-app .card, .auth-page .card { box-shadow: none; }
