/* /apply customer application. Restyled 2026-11-04 (Adam and Tara: "a little ugly"). Brand color comes from .brand-hs /
   .brand-jams so the page needs no inline style under its CSP. No web fonts: the CSP allows only this site's files. */
:root { --ink: #1f2937; --muted: #6b7280; --line: #e3e7ee; --field: #cfd6e0; --soft: #f6f8fb; --bad: #c62828; }
.brand-hs { --brand: #1F5FA8; --brand-soft: #e8f0fa; }
.brand-jams { --brand: #C8202F; --brand-soft: #fbeaec; }

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eef2f7;
       font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
input, select, textarea, button { font-family: inherit; }

/* header: logo and title on a white card with a brand stripe. The contact line sits at the bottom right, on the same line
   as the title (Amanda, 2026-11-11). flex-end is the fallback for a browser without last baseline. */
header { display: flex; justify-content: space-between; align-items: flex-end; align-items: last baseline; flex-wrap: wrap; gap: 12px;
         background: #fff; border-radius: 14px; border-top: 6px solid var(--brand); padding: 20px 28px; margin-bottom: 20px;
         box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .06); }
header h2 { margin: 10px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.2px; }
header small { color: var(--muted); font-size: 13px; line-height: 1.6; text-align: right; }
.logo { max-height: 52px; max-width: 220px; display: block; }

/* sections: numbered cards */
form { counter-reset: step; }
section { background: #fff; border-radius: 14px; padding: 24px 28px; margin-bottom: 20px;
          box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .06); }
section h3 { counter-increment: step; display: flex; align-items: center; gap: 12px; margin: 0 0 20px; padding-bottom: 14px;
             border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -.1px; }
section h3::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 30px;
                     width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; }

/* fields */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 20px; margin-bottom: 8px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
label.wide { grid-column: 1 / -1; }
label span { color: #374151; font-weight: 600; }
input[type=text], input[type=email], input[type=date], select {
    width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; background: #fff;
    font-size: 15px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
         background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='2'/%3E%3C/svg%3E");
         background-repeat: no-repeat; background-position: right 12px center; }
input:hover, select:hover { border-color: #b4bdca; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input::placeholder { color: #9aa3af; }
input.bad, select.bad { border-color: var(--bad); background: #fff7f7; }
.badbox { outline: 1px solid var(--bad); outline-offset: 4px; border-radius: 6px; }
/* license copies: a file box with the allowed types under it */
input[type=file] { width: 100%; padding: 9px 12px; border: 1px dashed var(--field); border-radius: 8px; background: var(--soft);
                   font-size: 14px; color: var(--ink); cursor: pointer; }
input[type=file].bad { border-color: var(--bad); background: #fff7f7; }
label.file small { color: var(--muted); font-size: 12.5px; }
.err { color: var(--bad); font-size: 12.5px; font-weight: 500; }
.err:empty { display: none; }
input[type=radio], input[type=checkbox] { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; flex: 0 0 18px; }

/* yes/no and choice questions: the question, with the answers right under it. They used to sit at the far right edge,
   up to 550px from a short question (Amanda, 2026-11-10: "can we make the yes or no buttons closer to the question"). */
.radio { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 0;
         border-bottom: 1px solid var(--line); font-size: 14px; }
.radio > span { color: #374151; }
.radio > div { display: flex; flex-wrap: wrap; gap: 8px; }
.radio .err { grid-column: 1 / -1; color: var(--bad); }   /* ".radio > span" above would turn it grey */
.opt { flex-direction: row; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--field); border-radius: 999px;
       background: #fff; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--brand); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* principals */
.note { font-size: 14px; color: #374151; margin: 20px 0 8px; }
table.principals { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
table.principals th { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: .4px; }
table.principals td { padding: 0 6px; vertical-align: top; }
table.principals td input { width: 100%; }

/* terms, agreement and signatures */
ol.terms { font-size: 12.5px; line-height: 1.55; color: #374151; max-height: 300px; overflow: auto; margin: 0 0 16px;
           padding: 14px 18px 14px 36px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
ol.terms li { margin-bottom: 6px; }
section > p { line-height: 1.55; color: #374151; }
.check { flex-direction: row; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; margin: 12px 0;
         padding: 14px 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check span { font-weight: 500; }
.check input { margin-top: 2px; }
.g-recaptcha { margin-top: 16px; }

/* signature boxes: the printed name with the box to sign in under it (apply.js draws; touch-action stops a finger scrolling the page) */
.sigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px 24px; margin: 16px 0 8px; }
.sigs > div { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sigpad { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sigpad > span:first-child { color: #374151; font-weight: 600; }
.sigpad canvas { display: block; width: 100%; max-width: 600px; aspect-ratio: 600 / 160; background: #fff; border: 1px solid var(--field);
                 border-radius: 8px; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.sigpad.badbox canvas { border-color: var(--bad); background: #fff7f7; }
.sigrow { display: flex; justify-content: space-between; align-items: center; max-width: 600px; color: var(--muted); }
.sigrow small { font-size: 12.5px; }
button.sigclear { min-width: 0; height: auto; padding: 2px 0; background: none; color: var(--brand); border: 0; border-radius: 0; box-shadow: none;
                  font-size: 13px; font-weight: 600; text-decoration: underline; }

/* submit */
button { display: inline-flex; align-items: center; justify-content: center; min-width: 280px; height: 52px; padding: 0 32px;
         background: var(--brand); color: #fff; border: 0; border-radius: 10px; font-size: 17px; font-weight: 600; cursor: pointer;
         box-shadow: 0 4px 14px rgba(31, 95, 168, .25); transition: filter .15s, transform .05s; }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: default; filter: none; }
.banner { background: #fff7f7; border: 1px solid #f3c7c7; color: var(--bad); padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }

/* thank-you page */
.box { max-width: 640px; margin: 48px auto; background: #fff; border-top: 6px solid var(--brand); border-radius: 14px; padding: 32px;
       box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .06); }
.box h2 { color: var(--brand); margin-top: 0; }
.box p { line-height: 1.6; }

.hide { display: none; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 640px) {
    .wrap { padding: 12px 12px 32px; }
    header, section { padding: 18px 16px; border-radius: 12px; }
    header small { text-align: left; }
    button { width: 100%; min-width: 0; }
    button.sigclear { width: auto; }
    table.principals, table.principals tbody, table.principals tr, table.principals td { display: block; }
    table.principals tr:first-child { display: none; }
    table.principals tr { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
    table.principals td { padding: 4px 0; }
}
