/* Safe@WorkSG website styles. Plain CSS, no build step.
   Brand (spec 4.11-logo-and-icon): navy #0F2A44, yellow #FFC20E, red #D7263D.
   Text font: the device's own system font (L10). */

:root {
  --navy: #0f2a44;
  --yellow: #ffc20e;
  --red: #d7263d;

  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5a6573;
  --line: #dfe3e8;
  --heading: var(--navy);
  --link: #0f2a44;
  --header-bg: #ffffff;
  --band-bg: var(--navy);
  --band-text: #ffffff;
  --error: #b3261e;
  --ok: #1e6b3a;

  /* The logo. To swap in the SVGs later, change only these two lines. */
  --logo: url("/brand/logo-light.png");
  --logo-on-navy: url("/brand/logo-dark.png");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1520;
    --surface: #13202e;
    --text: #e8ecf1;
    --muted: #a3adba;
    --line: #2a3a4c;
    --heading: #ffffff;
    --link: #ffc20e;
    --header-bg: var(--navy);
    --band-bg: #13202e;
    --error: #ff8a80;
    --ok: #7fd49b;
    --logo: var(--logo-on-navy);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 2px; }
a[href^="mailto:"] { overflow-wrap: anywhere; }

h1, h2, h3 { color: var(--heading); line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 7vw, 2.75rem); margin: 0 0 16px; line-height: 1.1; }
h2 { font-size: clamp(1.3rem, 5vw, 1.6rem); margin: 0 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 4px; }

p { margin: 0 0 12px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--yellow); color: var(--navy); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 16px; }

/* ---------- Header and menu ---------- */

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; min-height: 60px;
}

.brand {
  display: block;
  width: 180px; height: 28px; flex: 0 1 auto; min-width: 0;
  background: var(--logo) left center / contain no-repeat;
}
.brand span {
  /* Plain-text name kept for screen readers and if the image fails. */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

.nav-wide { display: none; }

.nav-menu summary {
  list-style: none; cursor: pointer;
  min-height: 44px; min-width: 44px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--heading); font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::before { content: "\2630"; font-size: 1.1rem; line-height: 1; }
.nav-menu[open] summary::before { content: "\2715"; }

.nav-menu ul {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5;
  margin: 0; padding: 8px 16px 16px; list-style: none;
  background: var(--header-bg); border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}
.nav-menu li a {
  display: block; padding: 12px 4px; min-height: 44px;
  color: var(--heading); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.nav-menu li:last-child a { border-bottom: 0; }
.nav-menu a[aria-current="page"], .nav-wide a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

@media (min-width: 1024px) {
  .nav-menu { display: none; }
  .nav-wide { display: block; }
  .nav-wide ul { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
  .nav-wide a { color: var(--heading); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 10px 0; display: inline-block; }
  .nav-wide a:hover { text-decoration: underline; }
  .brand { width: 200px; height: 32px; flex: none; }
}

/* ---------- Page content ---------- */

main { display: block; }

.page-title { padding: 32px 0 8px; }

.section { padding: 24px 0; }
.section + .section { border-top: 1px solid var(--line); }

.band {
  background: var(--band-bg); color: var(--band-text);
  padding: 40px 0 32px;
}
.band h1, .band h2 { color: #ffffff; }
.band a:not(.btn) { color: var(--yellow); }

.from {
  margin: 0 0 8px; font-size: 0.85rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.band .from { color: #c9d3de; }

.lead { font-size: 1.15rem; }
.strong-line { font-weight: 700; }

ul.plain, ol.steps { padding-left: 1.25rem; margin: 0 0 12px; }
ul.plain li, ol.steps li { margin: 0 0 8px; }

.cards { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px;
}
.card p:last-child { margin-bottom: 0; }

@media (min-width: 768px) {
  .cards.three { grid-template-columns: repeat(3, 1fr); }
  .cards.two { grid-template-columns: repeat(2, 1fr); }
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
}

.faq h2 { font-size: 1.15rem; margin-top: 8px; }
.faq .item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.faq .item:last-child { border-bottom: 0; }

dl.details { margin: 0 0 12px; }
dl.details div { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
dl.details dt { font-weight: 600; min-width: 6rem; }
dl.details dd { margin: 0; }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 16px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px; border-radius: 8px;
  background: var(--yellow); color: var(--navy);
  font: inherit; font-weight: 700; text-decoration: none;
  border: 2px solid var(--yellow); cursor: pointer;
}
.btn:hover { filter: brightness(0.95); }
.btn.secondary { background: transparent; color: var(--heading); border-color: currentColor; }
.band .btn.secondary { color: #ffffff; }
.wa-btn { gap: 8px; }
.wa-logo { flex: none; }
@media (max-width: 599px) {
  .actions:has(.wa-btn) .btn { width: 100%; }
}

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------- Screenshot placeholders (to be replaced by approved shots) ---------- */

.shot {
  margin: 16px auto 0; width: 100%; max-width: 200px;
  aspect-ratio: 9 / 16;
  border: 2px dashed var(--muted); border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center; color: var(--muted); font-size: 0.9rem;
  background: var(--surface);
}
.band .shot { background: transparent; border-color: #c9d3de; color: #c9d3de; }
.photo { display: block; width: 100%; max-width: 40rem; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; margin: 8px 0 16px; }
.shot-img { display: block; margin: 16px auto 0; width: 100%; max-width: 200px; height: auto; border-radius: 24px; }

/* ---------- Form ---------- */

.form { max-width: 36rem; }
.field { margin: 0 0 20px; }
.field > label, fieldset legend { display: block; font-weight: 600; margin: 0 0 6px; color: var(--heading); }
.hint { display: block; font-size: 0.9rem; color: var(--muted); margin: 0 0 6px; }
fieldset { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--muted); border-radius: 8px;
}
textarea { min-height: 120px; resize: vertical; }

.choice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; margin: 0 0 8px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  cursor: pointer; font-weight: 400;
}
.choice input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--navy); }
@media (prefers-color-scheme: dark) { .choice input { accent-color: var(--yellow); } }

/* The honeypot: hidden from people, left for bots to fill in. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.field-error { display: block; color: var(--error); font-size: 0.9rem; margin: 6px 0 0; }
.field-error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }

.notice { border-radius: 8px; padding: 12px 16px; margin: 0 0 20px; border: 2px solid; }
.notice.error { border-color: var(--error); color: var(--error); }
.notice.ok { border-color: var(--ok); }
.notice[hidden] { display: none; }

.turnstile { margin: 0 0 20px; min-height: 70px; max-width: 100%; overflow: hidden; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 40px; padding: 24px 0 32px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem;
}
.site-footer p { margin: 0 0 8px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0 0 8px; padding: 0; list-style: none; }
.site-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.wa { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.wa svg { flex: none; }

/* ---------- Maintenance page (src/index.js) ---------- */

.maintenance { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.maintenance > div { max-width: 32rem; width: 100%; }
.maintenance .mark { display: block; width: 64px; height: 64px; margin: 0 0 16px; }
.maintenance .soon, .maintenance .contact { margin: 0 0 8px; color: var(--muted); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 768px) { .shot, .shot-img { max-width: 260px; } }
