:root {
    --bg: #F4F1F0;            /* Drawbridge background */
    --card: #ffffff;
    --ink: #10021c;           /* Workers United navy */
    --muted: #6b6275;
    --line: #e2d9d5;
    --field: #fcfdff;
    --brand: #ff541f;         /* Workers United orange */
    --brand-dark: #10021c;
    --shade: #fbf2ee;         /* warm tint */
    --shade-bar: #fbe1d6;     /* light orange */
    --accent: #ED1459;        /* Drawbridge raspberry */
    --accent-d: #cc0f4c;
    --on-accent: #fff;
    --err: #c0392b; --ok: #0a7c3f;
    --bar: rgba(255,255,255,.82);
    --wm: .05;
  }
  html[data-theme="dark"] {
    --bg: #161d22; --card: #1f272e; --ink: #e7edf2; --muted: #9fb0bd;
    --line: #34424c; --field: #283139; --brand-dark: #f2ebe8;
    --shade: #222d35; --shade-bar: #2c3a44;
    --accent-d: #ff2e6e; --err: #ff7a6b; --ok: #4cd07d;
    --bar: rgba(22,29,34,.82); --wm: .09;
  }
  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px; line-height: 1.5; padding-bottom: 92px;
  }

  /* faint Drawbridge watermark */
  .bg-watermark {
    position: fixed; right: -50px; bottom: -40px; width: 320px; height: 188px; z-index: 0;
    pointer-events: none; opacity: var(--wm);
    background: url("drawbridge-mark.svg") no-repeat center / contain;
  }

  /* sticky frosted Drawbridge header */
  header {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; background: var(--bar);
    -webkit-backdrop-filter: blur(11px) saturate(1.3); backdrop-filter: blur(11px) saturate(1.3);
    border-bottom: 1px solid var(--line);
  }
  header .hlogo { height: 16px; width: auto; display: block; }
  .sp { flex: 1; }
  .hlink {
    display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
    color: var(--ink); font-size: .8rem; font-weight: 700;
    border: 1px solid var(--line); background: var(--card); border-radius: 9px; padding: 7px 9px; min-height: 36px;
  }
  .tbtn {
    appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
    width: 40px; height: 36px; border-radius: 9px; font-size: 17px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }

  main { padding: 14px; max-width: 640px; margin: 0 auto; position: relative; z-index: 1; }

  /* title card with the Workers United logo */
  .titlecard {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    padding: 18px 16px; text-align: center; margin: 14px 0; position: relative;
    border-top: 4px solid var(--brand);
  }
  .titlecard img { height: 46px; width: auto; margin-bottom: 10px; background: var(--logo-plate, transparent); }
  html[data-theme="dark"] .titlecard img { background: #fff; padding: 5px 8px; border-radius: 8px; }
  .titlecard .org { font-weight: 800; font-size: .82rem; color: var(--brand-dark); letter-spacing: .2px; }
  .titlecard h1 { font-size: 1.12rem; line-height: 1.3; margin: 6px 0; color: var(--ink); }
  .titlecard .reg {
    display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .5px;
    background: var(--shade-bar); color: var(--brand-dark); padding: 3px 12px; border-radius: 20px;
  }

  .altlink { text-align: center; margin: 0 0 14px; font-size: .9rem; }
  .altlink a { color: var(--accent); font-weight: 700; }

  /* section cards with the orange section-bar look */
  .card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0 14px 6px; margin: 14px 0; overflow: hidden; }
  .secbar {
    margin: 0 -14px 12px; padding: 11px 14px;
    background: linear-gradient(to bottom, var(--shade-bar), var(--shade));
    border-left: 4px solid var(--brand); border-bottom: 1px solid var(--line);
  }
  .secbar h2 { margin: 0; font-size: 1.02rem; color: var(--brand-dark); }
  .secbar p { margin: 3px 0 0; font-size: .82rem; color: var(--muted); font-style: italic; }

  .field { margin: 0 0 16px; }
  label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .9rem; }
  .req { color: var(--err); }
  .hint { font-weight: 400; color: var(--muted); font-size: .78rem; margin: 0 0 6px; }
  input, select {
    width: 100%; font-size: 16px; padding: 12px; min-height: 48px;
    border: 1.5px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink);
  }
  input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,84,31,.22); }
  a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

  fieldset { border: 1.5px solid var(--line); border-radius: 12px; margin: 0 0 16px; padding: 6px 12px 2px; }
  legend { font-weight: 700; font-size: .88rem; padding: 0 6px; color: var(--brand-dark); }
  .opt { display: flex; align-items: center; gap: 12px; padding: 9px 2px; min-height: 44px; border-bottom: 1px solid var(--line); }
  .opt:last-child { border-bottom: 0; }
  .opt input { width: 24px; height: 24px; min-height: 0; flex: 0 0 auto; accent-color: var(--brand); }
  .opt label { margin: 0; font-weight: 400; }

  .field.bad input, .field.bad select { border-color: var(--err); box-shadow: 0 0 0 3px rgba(192,57,43,.18); }
  .err { display: none; color: var(--err); font-weight: 700; font-size: .85rem; margin-top: 6px; }
  .field.bad .err { display: block; }

  details { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin: 0 0 12px; background: var(--field); }
  summary { cursor: pointer; font-weight: 700; padding: 13px 0; color: var(--brand-dark); }
  details p { font-size: .85rem; }

  .share-wrap { display: flex; align-items: center; gap: 8px; }
  .share-wrap input { max-width: 120px; }
  .consent { display: flex; gap: 12px; align-items: flex-start; }
  .consent input { width: 26px; height: 26px; min-height: 0; margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); }
  .consent label { font-weight: 400; }
  input[readonly] { background: var(--shade); }

  /* signature looks hand-written */
  #sig { font-family: "Segoe Script", "Bradley Hand", cursive; font-size: 20px; color: var(--brand-dark); }

  .submitbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: var(--bar); -webkit-backdrop-filter: blur(11px); backdrop-filter: blur(11px);
    border-top: 1px solid var(--line);
  }
  .btn {
    width: 100%; font-size: 1.05rem; font-weight: 800; padding: 15px; min-height: 54px;
    border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  }
  .btn:active { background: var(--accent-d); }
  .btn svg { width: 18px; height: 18px; }

  #summary { border-radius: 12px; padding: 12px 14px; margin: 6px 0 8px; display: none; position: relative; z-index: 1; }
  #summary.show { display: block; }
  #summary.bad { background: var(--card); border: 1px solid var(--err); border-left: 5px solid var(--err); color: var(--err); }
  #summary.good { background: var(--card); border: 1px solid var(--ok); border-left: 5px solid var(--ok); color: var(--ok); }
  #summary a { color: inherit; font-weight: 700; display: block; margin-top: 5px; }

  footer { padding: 4px 14px 30px; max-width: 640px; margin: 0 auto; color: var(--muted); font-size: .82rem; position: relative; z-index: 1; }
  .ret { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); }
  .credit { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 6px; opacity: .8; }
  .credit img { height: 14px; width: auto; }
  footer .links { text-align: center; }
  footer .links a { color: var(--accent); font-weight: 700; }

  /* printing the submitted form: drop the on-screen chrome, keep the filled content legible */
  @media print {
    header, .submitbar, .tbtn, .hlink, #summary, .bg-watermark, .altlink { display: none !important; }
    body { padding: 0 !important; }
    input, select, textarea { color: #000 !important; -webkit-text-fill-color: #000 !important; opacity: 1 !important; }
  }
