/* Client Doc Scan — Secure Documents (PRD §10).
   Self-hosted, no third-party assets (PRD §6.7). Built from the signed-off
   with-Belle mockup (0.5g); colours/contrast tuned to WCAG AA (§10.5). */

/* Montserrat — the geometric-sans stand-in for the brand font "Nort"
   (§10.1). Self-hosted variable font (latin subset); production swaps the
   exact Nort substitute at task 3.1. No CDN — see CSP (§6.7). */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;            /* variable wght axis */
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
                 U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blue:#223267; --navy:#1A2453; --red:#D62027;
  --ink:#22305a; --muted:#525b73; --faint:#5f6884; --line:#e4e9f3;
  --bg:#eaeef7; --card:#ffffff; --ok:#1a8048;
  --focus:#1c52d0;
}

*{box-sizing:border-box;margin:0;padding:0}

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

body{
  font-family:'Montserrat',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  background:var(--bg);color:var(--ink);line-height:1.5;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}

.wrap{max-width:432px;margin:0 auto;padding:20px 16px 30px}
.card{background:var(--card);border-radius:24px;box-shadow:0 14px 44px rgba(26,36,83,.14);overflow:hidden}

[hidden]{display:none !important}

/* visually-hidden but available to screen readers */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
         clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* --- secure badge --- */
.secure{display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;font-weight:700;
        color:var(--blue);background:#e7eefb;padding:10px;letter-spacing:.04em;text-transform:uppercase}
.secure svg{width:14px;height:14px}

/* --- header --- */
.head{padding:28px 26px 4px;text-align:center}
.head img{height:44px;width:auto;margin:0 auto 20px;display:block}
h1{font-size:24px;font-weight:800;color:var(--navy);letter-spacing:-.02em;line-height:1.2}
.sub{font-size:15px;color:var(--muted);margin-top:10px;padding:0 4px}

/* --- Belle intro --- */
.belle{display:flex;gap:14px;align-items:center;margin:22px 26px 2px;padding:15px 16px;
       background:#f4f8ff;border:1px solid var(--line);border-radius:18px}
.belle img{width:62px;height:62px;border-radius:50%;object-fit:cover;object-position:center top;flex:none;
           border:2.5px solid #fff;box-shadow:0 3px 12px rgba(26,36,83,.22)}
.belle p{font-size:13.5px;color:var(--ink);line-height:1.5}
.belle b{color:var(--navy);font-weight:700}

/* --- form body --- */
.body{padding:16px 26px 6px}
label{display:block;font-size:12.5px;font-weight:700;color:var(--navy);margin:14px 2px 8px;
      text-transform:uppercase;letter-spacing:.03em}
.req{color:var(--red)}
input[type=text]{width:100%;height:56px;border:1.5px solid var(--line);border-radius:14px;padding:0 17px;
      font-size:16px;font-family:inherit;color:var(--ink);background:#fbfcff}
input[type=text]::placeholder{color:#6b7488}
input[type=text][aria-invalid="true"]{border-color:var(--red);background:#fff7f7}

.field-error{display:none;color:var(--red);font-size:13px;font-weight:600;margin:8px 2px 0}
.field-error.show{display:block}

/* --- buttons --- */
.btns{margin-top:22px;display:flex;flex-direction:column;gap:13px}
.btn{min-height:62px;border-radius:15px;font-size:16.5px;font-weight:700;font-family:inherit;
     display:flex;align-items:center;justify-content:center;gap:11px;cursor:pointer;
     border:1.5px solid transparent;width:100%;padding:0 18px}
.btn svg{width:22px;height:22px;flex:none}
.btn-primary{background:var(--blue);color:#fff;box-shadow:0 8px 20px rgba(34,50,103,.30)}
.btn-primary:hover{background:#1d2c5b}
.btn-secondary{background:#fff;color:var(--blue);border-color:var(--blue)}
.btn-secondary:hover{background:#f4f7fe}
.btn[disabled]{opacity:.5;cursor:not-allowed;box-shadow:none}

.hint{text-align:center;font-size:12.5px;color:var(--muted);margin-top:15px;line-height:1.45}

/* --- assurance + footer --- */
.assure{display:flex;gap:11px;margin:20px 26px 4px;padding:15px 16px;background:#f1f5fc;border-radius:16px}
.assure svg{width:20px;height:20px;flex:none;color:var(--blue);margin-top:1px}
.assure p{font-size:12px;color:var(--muted);line-height:1.5}
.foot{text-align:center;font-size:11px;color:var(--faint);padding:18px 26px 24px;line-height:1.6}
.foot b{color:var(--blue);font-weight:700}

/* --- queue view --- */
.qhead{padding:24px 26px 0}
.qhead h1{font-size:21px;font-weight:800;color:var(--navy);letter-spacing:-.01em}
.sending-as{font-size:13px;color:var(--muted);margin-top:6px}
.sending-as b{color:var(--ink);font-weight:700}
.qbody{padding:8px 26px 6px}

.dropzone{margin-top:16px;border:2px dashed #c3cde6;border-radius:16px;padding:26px 16px;text-align:center;
          color:var(--muted);font-size:13.5px;background:#fafcff;transition:border-color .12s,background .12s}
.dropzone svg{width:30px;height:30px;color:var(--blue);margin-bottom:8px}
.dropzone b{color:var(--navy)}
.dropzone.dragover{border-color:var(--blue);background:#eef3ff}
.dz-folder{display:block;font-size:11.5px;color:var(--faint);margin-top:6px}

.filelist{list-style:none;margin:16px 0 0;display:flex;flex-direction:column;gap:10px}
.filerow{display:flex;align-items:center;gap:12px;padding:12px 12px;border:1px solid var(--line);
         border-radius:13px;background:#fff}
.file-ico{width:34px;height:34px;flex:none;border-radius:9px;background:#eef2fb;color:var(--blue);
          display:flex;align-items:center;justify-content:center}
.file-ico svg{width:18px;height:18px}
.file-main{flex:1;min-width:0}
.file-name{font-size:13.5px;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;
           text-overflow:ellipsis}
.file-sub{display:flex;align-items:center;gap:8px;margin-top:4px}
.file-size{font-size:11.5px;color:var(--faint)}
.file-state{font-size:11.5px;font-weight:600}
.file-state.queued{color:var(--faint)}
.file-state.uploading{color:var(--blue)}
.file-state.done{color:var(--ok)}
.file-state.error{color:var(--red)}
.file-state.review{color:#9a5800}
.progress{height:6px;border-radius:6px;background:#e9eef8;margin-top:8px;overflow:hidden}
.progress-bar{height:100%;width:0;background:var(--blue);border-radius:6px;transition:width .15s ease}
.progress-bar.done{background:var(--ok)}
.progress-bar.error{background:var(--red)}
.file-remove{width:44px;height:44px;flex:none;border:none;background:transparent;color:#8a93ab;
             cursor:pointer;border-radius:10px;display:flex;align-items:center;justify-content:center}
.file-remove:hover{background:#f3f5fa;color:var(--red)}
.file-remove svg{width:18px;height:18px}

.queue-actions{margin:20px 0 4px;display:flex;flex-direction:column;gap:11px}
.btn-add{min-height:52px;background:#fff;color:var(--blue);border:1.5px solid var(--line);
         border-radius:14px;font-weight:700;font-size:15px;font-family:inherit;cursor:pointer;
         display:flex;align-items:center;justify-content:center;gap:9px}
.btn-add:hover{border-color:var(--blue);background:#f6f9ff}
.btn-add svg{width:19px;height:19px}
.q-empty{text-align:center;color:var(--muted);font-size:13.5px;padding:18px 0}

/* quiet back / "start over" link (queue header + success view) */
.backlink{background:none;border:none;font-family:inherit;color:var(--muted);font-size:13px;font-weight:600;
          cursor:pointer;padding:8px 6px;min-height:44px;display:inline-flex;align-items:center;gap:3px}
.backlink:hover{color:var(--blue)}
.qhead .backlink{margin:0 0 2px -6px}
.backlink-center{display:flex;justify-content:center;width:100%;margin-top:12px}

/* --- success view --- */
.success{padding:40px 30px 14px;text-align:center}
.success-check{width:78px;height:78px;border-radius:50%;background:#e6f6ec;color:var(--ok);
               display:flex;align-items:center;justify-content:center;margin:0 auto 20px}
.success-check svg{width:40px;height:40px}
.success h1{font-size:24px;font-weight:800;color:var(--navy);letter-spacing:-.01em}
.success p{font-size:14.5px;color:var(--muted);margin-top:10px}
.refbox{margin:24px auto 6px;background:#f4f8ff;border:1px solid var(--line);border-radius:16px;
        padding:16px;max-width:300px}
.reflabel{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.refrow{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:8px}
.refcode{font-size:22px;font-weight:800;color:var(--navy);letter-spacing:.03em}
.btn-copy{width:44px;height:44px;border:1px solid var(--line);background:#fff;border-radius:11px;
          cursor:pointer;color:var(--blue);display:flex;align-items:center;justify-content:center}
.btn-copy:hover{background:#eef3ff}
.btn-copy svg{width:18px;height:18px}
.copied-msg{font-size:12px;color:var(--ok);font-weight:600;margin-top:8px;min-height:16px}
.success-actions{margin-top:26px}

/* --- in-app browser fallback (PRD §10.3) --- */
.inapp{margin:0 16px 14px;background:#fff7e8;border:1px solid #f0dcae;border-radius:14px;
       padding:14px 16px;font-size:13px;color:#6e500f}
.inapp b{color:#553d06}
.inapp-row{display:flex;gap:8px;margin-top:10px}
.inapp-url{flex:1;min-width:0;font-size:12.5px;padding:9px 11px;border:1px solid #ead9ac;border-radius:10px;
           background:#fff;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.btn-copy-link{flex:none;min-height:44px;padding:0 14px;border:none;border-radius:10px;background:var(--blue);
               color:#fff;font-weight:700;font-size:13px;font-family:inherit;cursor:pointer}

/* --- toast (reject/error messages) --- */
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);max-width:90%;
       background:var(--navy);color:#fff;padding:13px 18px;border-radius:12px;font-size:13.5px;
       box-shadow:0 10px 30px rgba(26,36,83,.3);z-index:20;line-height:1.4}
.toast.error{background:#8f1820}

/* --- denied / revoked link page --- */
.denied{padding:44px 30px 36px;text-align:center}
.denied-ico{width:72px;height:72px;border-radius:50%;background:#fdeaea;color:var(--red);
            display:flex;align-items:center;justify-content:center;margin:0 auto 22px}
.denied-ico svg{width:34px;height:34px}
.denied h1{font-size:22px;font-weight:800;color:var(--navy)}
.denied p{font-size:14.5px;color:var(--muted);margin-top:12px}

/* --- focus visibility (a11y §10.5) --- */
:focus-visible{outline:3px solid var(--focus);outline-offset:2px;border-radius:6px}
.btn:focus-visible,.btn-add:focus-visible{outline-offset:3px}

@media (prefers-reduced-motion:reduce){
  *{transition:none !important}
}
