/* ============================================================
   UpScan — shared identity. The design-token source of truth.

   Loaded after Bootstrap on the pages that use it, so it reskins those
   components rather than fighting them. upscan-theme.css mirrors these
   values for the auth pages that load it alone; the landing page and the
   marketing content pages still carry their own copies inline (folding
   those in is BACKLOG C2). If you retune a colour, this file is the one
   to change.
   ============================================================ */

:root{
  color-scheme:light only;
  --ink:#17191F;         /* black-cab charcoal */
  --paper:#FBFAF7;       /* Portland stone white */
  --slate:#34373E;       /* body text */
  --mist:#6E7178;        /* muted */
  --line:#E5E1D8;        /* warm hairlines */
  --scan:#1F5137;        /* British racing green (upscan-theme.css calls it --green) */
  --brass:#4F9B72;       /* racing green, fills on dark */
  --clear:#1DB56C;       /* verdict: clean */
  --threat:#D6453D;      /* verdict: infected */
  --caution:#B7791F;     /* verdict: injection found */
  --card:#FFFFFF;
  --radius:10px;
}

*{box-sizing:border-box}

html{
  /* Anchor targets clear the sticky header instead of hiding beneath it. */
  scroll-padding-top:76px;
}

body{
  font-family:'IBM Plex Sans',system-ui,-apple-system,sans-serif;
  background:var(--paper);
  color:var(--slate);
  font-size:16.5px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  margin:0;
}

h1,h2,h3,h4{
  font-family:'Inter Tight',system-ui,sans-serif;
  color:var(--ink);
  line-height:1.15;
  letter-spacing:-0.022em;
  font-weight:700;
}

a{color:var(--scan);text-decoration:none}
a:hover{color:#17402B}
/* --scan is dark enough to clear 3:1 against the page on either theme; the
   2px offset puts the ring on the page, not on a coloured button. */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,
textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible{
  outline:3px solid var(--scan);outline-offset:2px;border-radius:4px;
}

.mono,code,pre{font-family:'IBM Plex Mono',ui-monospace,monospace}
.wrap{max-width:1080px;margin:0 auto;padding:0 24px}
.text-muted{color:var(--mist) !important}

/* Keyboard bypass — first focusable thing on every page. */
.skip-link{
  position:absolute;left:12px;top:-48px;z-index:200;
  background:var(--scan);color:#fff;padding:9px 16px;border-radius:0 0 8px 8px;
  font-weight:600;font-size:.92rem;transition:top .15s ease;
}
.skip-link:focus{top:0}

/* ── The stamp: UpScan's signature verdict mark ────────────── */
.stamp{
  display:inline-block;
  font-family:'IBM Plex Mono',monospace;font-weight:600;
  letter-spacing:.16em;text-transform:uppercase;font-size:.82rem;
  padding:.35em .8em;border:2.5px solid currentColor;border-radius:6px;
  transform:rotate(-2deg);
}
.stamp.clean{color:var(--clear)}
.stamp.infected{color:var(--threat)}
.stamp.caution{color:var(--caution)}

/* ── Shared nav ────────────────────────────────────────────── */
.us-nav{
  position:sticky;top:0;z-index:50;
  background:rgba(251,250,247,.97);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.us-nav-inner{
  max-width:1080px;margin:0 auto;padding:0 24px;
  display:flex;align-items:center;justify-content:space-between;height:64px;
}
.us-brand{
  font-family:'Inter Tight',sans-serif;font-weight:800;font-size:1.25rem;
  color:var(--ink);display:flex;align-items:center;gap:.5rem;letter-spacing:-0.01em;
}
.us-brand:hover{color:var(--ink)}
.us-brand svg{width:26px;height:26px;color:var(--scan)}
.us-nav-links{display:flex;gap:1.6rem;align-items:center}
.us-nav-links a{color:var(--slate);font-weight:500;font-size:.95rem}
.us-nav-links a:hover{color:var(--ink)}
/* The buttons carry their own colour — beat the link rule above. */
.us-nav-links a.btn-primary,.us-nav-links a.btn-primary:hover{color:#fff}
.us-nav-links a.btn-ghost,.us-nav-links a.btn-ghost:hover{color:var(--ink)}

/* ── Signed-in app header (chrome.js renders this when a session exists) ──── */
.us-nav[data-variant=app] .us-nav-inner{height:60px}
.us-tabs{gap:.35rem}
.us-tab{
  display:inline-flex;align-items:center;min-height:38px;
  font-weight:600;font-size:.93rem;color:var(--mist);
  padding:.5em .85em;border-radius:8px;line-height:1;
}
.us-tab:hover{color:var(--ink);background:rgba(23,25,31,.05)}
.us-tab[aria-current="page"]{color:var(--scan);background:rgba(31,81,55,.10)}
/* Leaves the app rather than moving inside it, so it is deliberately not a
   .us-tab: no active state, lighter weight, and pushed to the right-hand end
   next to Log out. margin-left:auto is what separates the tab group from the
   leave-the-app group. */
.us-backlink{
  margin-left:auto;display:inline-flex;align-items:center;gap:.35rem;
  min-height:38px;padding:.5em .6em;font-weight:500;font-size:.9rem;
  color:var(--mist);white-space:nowrap;
}
.us-backlink:hover{color:var(--ink)}
.us-logout{
  margin-left:.4rem;min-height:38px;font-weight:600;font-size:.9rem;color:var(--slate);
  background:none;border:1px solid var(--line);border-radius:8px;
  padding:.5em .95em;cursor:pointer;font-family:'IBM Plex Sans',sans-serif;
}
.us-logout:hover{border-color:var(--ink);color:var(--ink)}

/* ── Buttons (also reskins Bootstrap) ──────────────────────── */
.btn,.us-btn{
  display:inline-block;font-weight:600;font-size:.98rem;
  padding:.72em 1.4em;border-radius:8px;border:none;cursor:pointer;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
  font-family:'IBM Plex Sans',sans-serif;
}
.btn-primary,.us-btn-primary{background:var(--scan);color:#fff;border:none}
.btn-primary:hover,.us-btn-primary:hover{
  background:#17402B;color:#fff;transform:translateY(-1px);
  box-shadow:0 5px 16px rgba(31,81,55,.35);
}
.btn-primary:disabled{background:#7C9A89;transform:none;box-shadow:none}
.btn-ghost,.us-btn-ghost,.btn-outline-light{
  background:transparent;color:var(--ink);border:1.5px solid var(--line);
}
.btn-ghost:hover,.us-btn-ghost:hover,.btn-outline-light:hover{
  border-color:var(--ink);background:transparent;color:var(--ink);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:none;
}
.card-body{padding:26px}
.card-title{font-family:'Inter Tight',sans-serif;color:var(--ink);font-weight:700}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group{margin-bottom:18px}
label,.form-label{
  display:block;font-size:.86rem;font-weight:600;
  color:var(--ink);margin-bottom:6px;letter-spacing:.01em;
}
.form-control,input[type=text],input[type=email],input[type=password]{
  width:100%;padding:.75em .9em;
  border:1.5px solid var(--line);border-radius:8px;
  font-size:1rem;font-family:'IBM Plex Sans',sans-serif;
  background:#fff;color:var(--ink);
  transition:border-color .15s ease;
}
.form-control:focus,input:focus,select:focus,textarea:focus{
  border-color:var(--brass);
  box-shadow:0 0 0 3px rgba(79,155,114,.28);
  outline:none;
}
/* Keyboard focus keeps a solid, high-contrast ring on top of the glow. */
.form-control:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--scan);outline-offset:2px;
}
.form-control::placeholder,input::placeholder{color:#75787E}

/* ── Alerts ────────────────────────────────────────────────── */
.alert{
  border-radius:8px;border:1px solid transparent;
  padding:.85em 1em;font-size:.95rem;
}
.alert-danger{background:#FDECEA;border-color:#F3C9C6;color:#8E2B25}
.alert-success{background:#E9F6EE;border-color:#C3E4D1;color:#14603C}
.alert-info{background:#EDF2F7;border-color:#D3DDE6;color:#31465A}
.alert-warning{background:#FDF3E2;border-color:#EFDCB4;color:#7A5310}

/* ── Auth pages ────────────────────────────────────────────── */
.auth-container,.us-auth{
  min-height:calc(100vh - 64px);
  min-height:calc(100dvh - 64px);   /* mobile: exclude the URL bar */
  display:flex;align-items:center;justify-content:center;
  padding:40px 20px;
  background:
    radial-gradient(680px 380px at 78% 110%, rgba(79,155,114,.16), transparent 65%),
    var(--paper);
}
.auth-card,.us-auth-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:40px;
  width:100%;max-width:420px;
  box-shadow:0 18px 44px rgba(23,25,31,.07);
}
.auth-title,.us-auth-card h1{
  font-family:'Inter Tight',sans-serif;font-size:1.55rem;
  color:var(--ink);text-align:center;margin:0 0 6px;
}
.us-auth-sub{
  text-align:center;color:var(--mist);font-size:.95rem;margin:0 0 26px;
}
.toggle-auth{
  text-align:center;margin-top:20px;font-size:.93rem;color:var(--mist);
}
.toggle-auth a{color:var(--scan);font-weight:600;cursor:pointer}
.w-100{width:100%}

/* ── Dashboard shell ───────────────────────────────────────── */
.navbar.bg-dark{
  background:var(--ink) !important;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.navbar .navbar-brand{
  font-family:'Inter Tight',sans-serif;font-weight:800;
  color:var(--paper) !important;letter-spacing:-0.01em;
}
.navbar .navbar-brand i{color:var(--brass)}
.navbar .btn-outline-light{
  color:var(--paper);border-color:rgba(251,250,247,.35);
}
.navbar .btn-outline-light:hover{
  color:var(--ink);background:var(--paper);border-color:var(--paper);
}
.container-main{max-width:1080px;margin:0 auto;padding:32px 24px 64px}
.container-main .header{
  background:transparent;border:none;padding:0;margin-bottom:28px;box-shadow:none;
}
.container-main .header h1{font-size:2rem;margin-bottom:6px}
.container-main .header p{color:var(--mist);margin:0}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state{text-align:center;padding:56px 20px;color:var(--mist)}
.empty-state-icon{font-size:2.4rem;color:var(--line);margin-bottom:14px}

/* ── Verdict badges ────────────────────────────────────────── */
.badge{
  font-family:'IBM Plex Mono',monospace;font-weight:600;
  letter-spacing:.08em;text-transform:uppercase;font-size:.72rem;
  padding:.4em .7em;border-radius:6px;
}
.badge-clean{background:#E9F6EE;color:#14603C;border:1px solid #C3E4D1}
.badge-malicious{background:#FDECEA;color:#8E2B25;border:1px solid #F3C9C6}
.badge-suspicious{background:#FDF3E2;color:#7A5310;border:1px solid #EFDCB4}

/* ── Footer ────────────────────────────────────────────────── */
.us-footer{
  border-top:1px solid var(--line);
  padding:30px 0;margin-top:60px;
  font-size:.9rem;color:var(--mist);
}
.us-footer-inner{
  max-width:1080px;margin:0 auto;padding:0 24px;
  display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;
}
.us-footer a{color:var(--mist)}
.us-footer a:hover{color:var(--ink)}

/* ── Motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.01ms !important;transition-duration:.01ms !important}
  html{scroll-behavior:auto}
}

/* ── Small screens ─────────────────────────────────────────── */
@media (max-width:760px){
  .us-nav-links{gap:1rem}
  /* Both navs wrap their links under the brand rather than hiding them — the
     app tabs are the only way between signed-in surfaces, and the marketing
     links (How it works, Pricing, …) shouldn't vanish on a phone either. */
  .us-nav .us-nav-inner{
    height:auto;flex-wrap:wrap;padding-top:8px;padding-bottom:8px;gap:6px 12px;
  }
  .us-nav:not([data-variant=app]) .us-nav-links{
    width:100%;flex-wrap:wrap;gap:.5rem 1.1rem;font-size:.92rem;
  }
  .us-nav[data-variant=app] .us-nav-inner{
    height:auto;flex-wrap:wrap;padding-top:8px;padding-bottom:8px;gap:6px;
  }
  .us-tabs{flex-wrap:wrap;gap:.3rem;width:100%}
  .us-tab{min-height:40px;padding:.5em .8em;font-size:.9rem}
  /* The row wraps here, so the desktop margin-left:auto would fight the one on
     .us-logout and strand the back link on a line of its own. */
  .us-backlink{margin-left:0;min-height:40px;font-size:.9rem}
  .us-logout{min-height:40px;margin-left:auto}
  .auth-card,.us-auth-card{padding:30px 24px}
  .container-main{padding:24px 18px 48px}
  .us-footer-inner{flex-direction:column}
}
