/* TriPass Phishing Scanner: website, installable app and Outlook task pane.
   Colour has one meaning each: blue = action, red = phishing, amber = suspicious, green = no warning signs.
   No web fonts: the CSP allows only this origin, and the scanner must work offline. */
:root {
  --accent: #2E4BF2; --accent-fill: #2E4BF2; --accent-ink: #ffffff; --accent-soft: #EEF1FE;
  --bg: #ffffff; --surface: #F6F7FA; --text: #11131F; --muted: #51566B; --border: #E4E4EC; --border-strong: #CCCCDB;
  --safe: #13804F; --safe-bg: #E6F5EE;
  --warn: #8A5A07; --warn-bg: #FFF4E2;
  --bad: #C42B2B; --bad-bg: #FDECEC;
  --radius: 4px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --head: "Space Grotesk", "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #8EA0FF; --accent-fill: #3A55F5; --accent-ink: #ffffff; --accent-soft: #1A2150; /* WCAG AA contrast */
    --bg: #0E1020; --surface: #161A2E; --text: #ECEEF6; --muted: #A6ABC2; --border: #262B45; --border-strong: #353B5C;
    --safe: #5FD394; --safe-bg: #12291E;
    --warn: #F0C050; --warn-bg: #33280F;
    --bad: #FF8A84; --bad-bg: #3A1A1D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #8EA0FF; --accent-fill: #3A55F5; --accent-ink: #ffffff; --accent-soft: #1A2150; /* WCAG AA contrast */
  --bg: #0E1020; --surface: #161A2E; --text: #ECEEF6; --muted: #A6ABC2; --border: #262B45; --border-strong: #353B5C;
  --safe: #5FD394; --safe-bg: #12291E;
  --warn: #F0C050; --warn-bg: #33280F;
  --bad: #FF8A84; --bad-bg: #3A1A1D;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0; font-family: var(--head); }
button, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; background: currentColor; }

/* ---------- Buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
       border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg); cursor: pointer;
       font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
       font-weight: 700; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.92); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .seg button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.link { background: none; border: none; color: var(--accent); padding: 0 4px; min-height: 32px; font-weight: 600;
            font-family: inherit; text-transform: none; letter-spacing: 0; font-size: 15px; }
label { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
input, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; background: var(--bg); color: var(--text); font-weight: 400;
                  border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 15px; text-transform: none; letter-spacing: 0;
                  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
textarea { resize: vertical; min-height: 140px; }
.error { color: var(--bad); font-size: 14px; margin: -4px 0 12px; }
label.toggle { display: flex; gap: 10px; align-items: flex-start; font-family: inherit; font-size: 13.5px; font-weight: 400; letter-spacing: 0;
               text-transform: none; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 10px 12px; }
label.toggle input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--accent-fill); }
label.toggle strong { color: var(--text); }
@media (max-width: 420px) { .score-card .mascot { width: 44px; } .score { font-size: 28px; min-width: 62px; } .verdict { font-size: 16px; } }

/* ---------- Result card (shared with the Outlook panel) ---------- */
.result { margin-top: 22px; }
.score-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid transparent; }
.score { font-family: var(--head); font-size: 34px; font-weight: 800; min-width: 84px; font-variant-numeric: tabular-nums; }
.verdict { font-family: var(--head); font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.safe { background: var(--safe-bg); color: var(--safe); }
.suspicious { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.phishing { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
/* "No warning signs" is not a promise of safety, so the card stays neutral; only the tick is green */
.score-card.safe { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.score-card.safe .score { color: var(--safe); }
.score-card .verdict-text { flex: 1; min-width: 0; }
.meter { height: 6px; background: var(--surface); border-radius: 0; margin-top: 8px; overflow: hidden; }
.meter > div { height: 100%; width: 0; transition: width .4s ease; }
.result h3, .actions h3 { font-family: var(--mono); font-size: 11.5px; font-weight: 700; margin: 20px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.result ul { margin: 0; padding-left: 20px; }
.result li { margin-bottom: 4px; }
.result ul.links { list-style: none; padding: 0; }
.result ul.links li { padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; word-break: break-all; margin-bottom: 6px; }
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 2px; margin-right: 6px; text-transform: uppercase; letter-spacing: .04em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; padding: 1px 9px; font-size: 13px; }
.privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 16px; }

/* ---------- Intent: what the email asks you to do ---------- */
.intent { border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: 12px 14px; background: var(--bg); }
.intent.risky { border-left-color: var(--bad); }
.intent.calm { border-left-color: var(--safe); }
.intent p { margin: 0; font-weight: 600; }
.intent ul.asks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.intent ul.asks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 0; }
.intent .ask-state { flex-shrink: 0; font-family: var(--mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 2px; margin-top: 2px; }
.intent .ask-state.bad { background: var(--bad-bg); color: var(--bad); }
.intent .ask-state.ok { background: var(--safe-bg); color: var(--safe); }
.intent .ask-quote { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; font-style: italic; overflow-wrap: anywhere; }
.intent .pressure { margin-top: 10px; font-size: 13px; color: var(--muted); }

.verdict-advice { font-size: 13px; color: var(--muted); }
/* ---------- Lock, the TriPass mascot: its belly is a mini device-to-server animation; its face follows the verdict ---------- */
.mascot { width: 58px; flex-shrink: 0; margin-left: auto; }
.tp-mascot { display: block; width: 100%; height: auto; overflow: visible; }
.tp-mascot .eye { fill: #3DD68C; transform-box: fill-box; transform-origin: center; animation: tp-blink 4.2s infinite; transition: fill .3s ease; }
.tp-mascot .mouth { stroke: #3DD68C; }
.tp-mascot .brow { stroke: #3DD68C; opacity: 0; }
.tp-mascot text { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 6.6px; font-weight: 600; }
.tp-mascot .pt { fill: #11131F; opacity: .7; }
.tp-mascot .ct { fill: #1FA06B; }
.tp-mascot .tape { animation: tp-tape 3.6s linear infinite; }
.mascot.state-idle .eye, .mascot.state-thinking .eye { fill: #6F86FF; }
.mascot.state-idle .mouth, .mascot.state-thinking .mouth { stroke: #6F86FF; }
.mascot.state-thinking .eye { animation: tp-blink-fast .7s infinite; }
.mascot.state-thinking .tape { animation-duration: 1.2s; }
.mascot.state-suspicious .eye { fill: #F5B83D; }
.mascot.state-suspicious .mouth, .mascot.state-suspicious .brow { stroke: #F5B83D; }
.mascot.state-suspicious .brow { opacity: 1; }
.mascot.state-phishing .eye { fill: #FF5A5F; }
.mascot.state-phishing .mouth, .mascot.state-phishing .brow { stroke: #FF5A5F; }
.mascot.state-phishing .brow { opacity: 1; }
.mascot.state-phishing > svg { animation: tp-shake .5s ease 2; }
.mascot.state-safe > svg { animation: tp-hop .6s ease 1; }
@keyframes tp-tape { from { transform: translateX(-100px); } to { transform: translateX(0); } }
@keyframes tp-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.12); } }
@keyframes tp-blink-fast { 50% { transform: scaleY(.15); } }
@keyframes tp-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px) rotate(-3deg); } 75% { transform: translateX(3px) rotate(3deg); } }
@keyframes tp-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .tp-mascot .eye, .tp-mascot .tape, .mascot > svg { animation: none !important; } }
.hero-mascot { width: 104px; flex-shrink: 0; }
.hero-mascot .mascot { width: 104px; margin: 0; }
@media (max-width: 640px) { .hero-mascot { display: none; } }
body.pane .mascot { width: 44px; }

/* ---------- Website ---------- */
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 800; font-size: 18px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 7px; }
.brand em { font-style: normal; font-weight: 600; color: var(--muted); }
.hero { padding: 40px 0 8px; display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.hero-text { max-width: 640px; }
.hero h1 { font-size: clamp(30px, 5.4vw, 52px); letter-spacing: -.02em; text-transform: uppercase; line-height: 1.02; font-weight: 800; }
.hero p { font-size: 17px; color: var(--muted); max-width: 620px; margin: 14px 0 0; }
.hero .eyebrow { font-size: 11.5px; color: var(--accent); margin: 0 0 14px; }
.card { background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 22px; margin: 26px 0; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0; margin-bottom: 18px; }
.seg button { border: 0; border-right: 1px solid var(--border-strong); background: none; padding: 9px 20px; cursor: pointer; font-family: var(--mono); font-size: 12.5px;
              font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); min-height: 40px; border-radius: 0; }
.seg button:last-child { border-right: 0; }
.seg button[aria-selected="true"] { background: var(--accent-fill); color: var(--accent-ink); box-shadow: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.step { background: var(--bg); border-radius: 0; padding: 18px; }
.step h3 { font-size: 16px; margin-bottom: 6px; text-transform: uppercase; }
.step ol { margin: 6px 0 0; padding-left: 20px; font-size: 15px; }
.grid.how { margin: 8px 0 14px; }
section.info { padding: 22px 0 8px; }
section.info > h2 { font-size: 26px; margin-bottom: 10px; text-transform: uppercase; }
footer { padding: 32px 0 48px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 24px; }

/* ---------- Outlook task pane ---------- */
body.pane { padding: 12px 14px 20px; font-size: 14px; }
body.pane .score { font-size: 30px; min-width: 70px; }
.pane-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pane-head h1 { font-size: 15px; text-transform: uppercase; letter-spacing: .01em; }
.pane-head h1 em { font-style: normal; color: var(--muted); font-weight: 600; }
.pane-head img { border-radius: 5px; }
.status { color: var(--muted); }
.status.error { color: var(--bad); margin: 0; }

.pin-tip { display: flex; flex-direction: column; gap: 4px; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0;
           padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.pin-tip p { margin: 0; }
.pin-tip .btn.link { align-self: flex-start; min-height: 28px; padding: 0; }

.checks { display: grid; gap: 6px; margin: 0; }
.check { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.check dt { color: var(--muted); }
.check dd { margin: 0; }
.pill { display: inline-block; white-space: nowrap; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 2px; text-align: right; letter-spacing: .02em; }
.pill.pass { background: var(--safe-bg); color: var(--safe); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.fail { background: var(--bad-bg); color: var(--bad); }
.pill.info, .pill.unknown { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.link-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.link-url { color: var(--muted); font-size: 12px; margin-top: 2px; }
.link-note { font-size: 12px; margin-top: 2px; color: var(--muted); }
.link-note.bad { color: var(--bad); font-weight: 600; }

.actions { margin-top: 18px; }
.action-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.action-list p { margin: 0; width: 100%; font-size: 14px; }
.copy-row { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.copy-row code { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; padding: 1px 6px; font-size: 13px; word-break: break-all; }
.settings { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 10px; font-size: 13px; }
.settings summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.settings[open] summary { margin-bottom: 10px; }
.settings .row { margin: 6px 0; }

.scanned { font-size: 13px; color: var(--muted); margin: 0 0 10px; padding: 8px 10px; background: var(--surface); border-radius: var(--radius); overflow-wrap: anywhere; }
.scanned strong { color: var(--text); }
.scanned-note { display: block; margin-top: 4px; }
