/* CiteSure pages. Colours are shared with the report (report.html.j2). */
:root {
  --ink: #18203a; --muted: #5d6680; --line: #e3e6f0; --bg: #ffffff; --panel: #f6f7fb;
  --brand: #4f46e5; --brand-2: #7c3aed; --teal: #0ea5a4; --pink: #db2777; --amber: #d97706;
  --ok: #15803d; --ok-bg: #e7f6ec; --err: #c0262d; --err-bg: #fdeced;
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 55%, var(--pink) 100%);
  --shadow: 0 1px 2px rgba(24, 32, 58, .06), 0 8px 24px rgba(24, 32, 58, .08);
  --shadow-lg: 0 2px 4px rgba(24, 32, 58, .05), 0 20px 48px rgba(79, 70, 229, .16);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column;
       font: 16px/1.55 Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
       -webkit-font-smoothing: antialiased; }
main { flex: 1; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; }

/* ---------------------------------------------------------------- header / footer */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .78);
       backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
       border-bottom: 1px solid rgba(227, 230, 240, .8); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 19px; }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center;
        box-shadow: 0 4px 12px rgba(124, 58, 237, .35); }
.logo svg { width: 18px; height: 18px; }
.top .tag { color: var(--muted); font-size: 14px; margin-left: auto; }
footer.site { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 13.5px; }
footer.site .wrap { padding-top: 20px; padding-bottom: 28px; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; padding: 64px 0 12px; isolation: isolate; }
/* The coloured blobs fade out downwards instead of ending in a hard edge. */
.blobs { position: absolute; inset: 0 0 -160px; z-index: -1; overflow: hidden; pointer-events: none;
         -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent); mask-image: linear-gradient(to bottom, #000 45%, transparent); }
.blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55; }
.blob.a { width: 420px; height: 420px; background: #c7d2fe; top: -140px; left: -80px; animation: drift 18s ease-in-out infinite alternate; }
.blob.b { width: 360px; height: 360px; background: #f5d0fe; top: -60px; right: -60px; animation: drift 22s ease-in-out infinite alternate-reverse; }
.blob.c { width: 320px; height: 320px; background: #a5f3fc; top: 260px; left: 45%; animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 30px) scale(1.12); } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--brand);
           background: rgba(79, 70, 229, .08); border: 1px solid rgba(79, 70, 229, .18); padding: 5px 12px; border-radius: 999px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(14, 165, 164, .6); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(14, 165, 164, .55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(14, 165, 164, 0); } }
.hero h1 { font-size: clamp(32px, 5vw, 52px); margin: 18px 0 14px; max-width: 760px; font-weight: 800; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 18.5px; color: var(--muted); max-width: 660px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink); background: #fff;
        border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; box-shadow: 0 1px 2px rgba(24, 32, 58, .04); }
.chip svg { width: 15px; height: 15px; color: var(--ok); }

/* ---------------------------------------------------------------- upload card */
.upload { margin: 30px 0 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
          padding: 26px; display: grid; gap: 20px; position: relative; }
.upload::before { content: ""; position: absolute; inset: -1px; border-radius: 22px; padding: 1px; z-index: -1;
                  background: var(--grad); opacity: .35; }
.drop { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer;
        padding: 34px 20px; border: 2px dashed #c9cde0; border-radius: var(--radius); background: var(--panel);
        transition: border-color .2s, background .2s, transform .2s; }
.drop:hover, .drop.over { border-color: var(--brand); background: #f1f0ff; }
.drop.over { transform: scale(1.01); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop .icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: #fff;
              box-shadow: var(--shadow); color: var(--brand); margin-bottom: 6px; transition: transform .3s; }
.drop:hover .icon { transform: translateY(-3px); }
.drop .icon svg { width: 26px; height: 26px; }
.drop strong { font-size: 17px; }
.drop .browse { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.picked { display: none; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ok-bg);
          border: 1px solid #bfe5cb; animation: rise .35s ease both; }
.picked.show { display: flex; }
.picked.bad { background: var(--err-bg); border-color: #f5c2c5; }
.picked .ficon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 800;
                 color: #fff; background: var(--grad); flex: none; }
.picked .fname { font-weight: 600; word-break: break-all; }
.picked .fmeta { font-size: 13px; color: var(--muted); }

.option { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 44px; height: 26px; border-radius: 999px; background: #cfd3e3; position: relative; transition: background .25s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
                        box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.3, 1.5, .6, 1); }
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 2px; }
.switch .label { font-weight: 600; display: block; }
.option .more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.option .more > div { overflow: hidden; }
.option.on .more { grid-template-rows: 1fr; }
.option .row { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-top: 14px; font-size: 15px; align-items: center; }
.option input[type=number] { width: 5.6em; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.option input[type=number]:focus { outline: 2px solid rgba(79, 70, 229, .4); border-color: var(--brand); }

.btn { font: inherit; font-weight: 650; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
       padding: 13px 24px; border-radius: 12px; border: 0; color: #fff; background: var(--grad); background-size: 160% 160%;
       cursor: pointer; text-decoration: none; box-shadow: 0 6px 18px rgba(124, 58, 237, .32);
       transition: transform .15s, box-shadow .2s, background-position .4s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(124, 58, 237, .38); background-position: 100% 0; }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; transition: transform .2s; }
.btn:hover svg { transform: translateX(3px); }
.btn[disabled] { opacity: .75; cursor: progress; }
.btn .spin { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn.busy .spin { display: inline-block; } .btn.busy svg { display: none; }
.btn.wide { width: 100%; }
.btn.ghost { background: #fff; color: var(--err); box-shadow: none; border: 1px solid var(--line); font-weight: 550; font-size: 15px; padding: 10px 18px; }
.btn.ghost:hover { background: var(--err-bg); border-color: #f5c2c5; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- sections */
.section { padding: 56px 0 8px; }
.section h2 { font-size: 28px; margin: 0 0 8px; font-weight: 780; }
.section .sub { color: var(--muted); margin: 0 0 26px; max-width: 640px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; padding: 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.step .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--grad); margin-bottom: 12px; }
.step h3 { font-size: 17px; margin: 0 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 20px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(24, 32, 58, .04);
           transition: transform .2s, box-shadow .2s, border-color .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d5d9ea; }
.feature .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; }
.feature .ic svg { width: 21px; height: 21px; }
.feature h3 { font-size: 16px; margin: 0 0 4px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }
.c1 { background: #eef2ff; color: var(--brand); } .c2 { background: #f5f3ff; color: var(--brand-2); }
.c3 { background: #fdf2f8; color: var(--pink); } .c4 { background: #ecfeff; color: var(--teal); }
.c5 { background: #fffbeb; color: var(--amber); } .c6 { background: #f0fdf4; color: var(--ok); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 56px; }
.fact { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.fact .ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.fact .ic svg { width: 19px; height: 19px; }
.fact h3 { font-size: 15.5px; margin: 0 0 3px; }
.fact p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------------------------------------------------------------- job page */
.center { max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
.center h1 { font-size: 30px; margin: 0 0 6px; font-weight: 800; }
.center .sub { color: var(--muted); margin: 0 0 26px; }
.job { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: center; background: #fff; border: 1px solid var(--line);
       border-radius: 22px; box-shadow: var(--shadow-lg); padding: 28px; }
.ring { position: relative; width: 190px; height: 190px; justify-self: center; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bg { fill: none; stroke: #eceef6; stroke-width: 12; }
.ring .fg { fill: none; stroke: url(#ringGrad); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4, 0, .2, 1); }
.ring .orbit { position: absolute; inset: 0; border-radius: 50%; animation: spin 2.4s linear infinite; }
.ring .orbit::after { content: ""; position: absolute; top: 2px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
                      background: #fff; border: 3px solid var(--brand-2); box-shadow: 0 0 12px rgba(124, 58, 237, .7); }
.ring .glow { position: absolute; inset: 22px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 58, 237, .12), transparent 70%); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .6; } }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .big { font-size: 40px; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ring .small { font-size: 13px; color: var(--muted); margin-top: 4px; }
.job.queued .orbit::after { border-color: var(--teal); box-shadow: 0 0 12px rgba(14, 165, 164, .7); }
.job.done .orbit, .job.done .glow { display: none; }
.stage { font-size: 18px; font-weight: 700; margin: 0 0 4px; min-height: 1.4em; }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.elapsed { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; background: var(--panel);
           border-radius: 999px; padding: 3px 10px; margin-bottom: 14px; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stepper li { display: flex; align-items: center; gap: 12px; padding: 5px 0; color: var(--muted); font-size: 14.5px; position: relative; transition: color .3s; }
.stepper li:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 29px; bottom: -7px; width: 2px; background: var(--line); transition: background .4s; }
.stepper .b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
              background: #fff; border: 2px solid var(--line); color: var(--muted); position: relative; z-index: 1; transition: all .35s; }
.stepper .b svg { width: 13px; height: 13px; display: none; }
.stepper li.done { color: var(--ink); }
.stepper li.done::before { background: linear-gradient(var(--brand), var(--brand-2)); }
.stepper li.done .b { background: var(--grad); border-color: transparent; color: #fff; }
.stepper li.done .b svg { display: block; animation: pop .35s ease; } .stepper li.done .b span { display: none; }
.stepper li.active { color: var(--ink); font-weight: 650; }
.stepper li.active .b { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .15); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); } }
@keyframes pop { from { transform: scale(.3); } 70% { transform: scale(1.2); } }
.job-foot { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; margin-top: 22px; }
.job-foot p { margin: 0; flex: 1 1 320px; }
.job-foot form { margin: 0; }

/* ---------------------------------------------------------------- message page */
.msg { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 40px 28px; }
.msg .ic { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: #eef2ff; color: var(--brand); }
.msg .ic svg { width: 28px; height: 28px; }
.msg.ok .ic { background: var(--ok-bg); color: var(--ok); }
.msg.bad .ic { background: var(--err-bg); color: var(--err); }
.msg h1 { margin-bottom: 10px; }
.msg p { color: var(--muted); max-width: 520px; margin: 0 auto 24px; font-size: 16.5px; }

/* ---------------------------------------------------------------- entrance animation */
.rise { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .24s; } .d4 { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* Scroll reveal only once the script runs (the "js" class), so nothing stays hidden without it. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.seen { opacity: 1; transform: none; }

@media (max-width: 820px) {
  .steps, .features, .facts { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; }
  .top .tag { display: none; }
  .hero { padding-top: 40px; }
  .upload { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
