/* Feature: Check anything (the analyser): one input for any file or message, the checking
   steps, and the results for messages, voice, screenshots and documents.
   Owner: Aydan (screenshots and documents: Yan Lin's checker, shown with these same styles).
   Styles for this feature only. Uses the Clarity variables (var(--red), var(--surface) ...),
   never new colour codes. Every risk level and result shows an icon and words, not just a colour.
   Hover and press effects are short, and turn off for people who switch off animation
   (see the reduced-motion rule at the end of css/base.css). */

.an-screen h1 { text-wrap: balance; }
.an-screen .panel { margin-bottom: 1rem; }
.an-screen .verdict h1 { font-size: 1.75rem; }
/* Taps act straight away on phones (no double-tap zoom on these controls) */
.an-screen .chip, .an-flag, .an-pick, .an-drop { touch-action: manipulation; }

/* ---------- Adding something: the drop box, the message box and the samples ---------- */

.an-drop {
  position: relative; display: grid; justify-items: center; gap: .375rem; margin-top: 1.25rem;
  padding: 1.75rem 1rem; cursor: pointer; text-align: center;
  background: var(--surface); border: 2.5px dashed var(--slate); border-radius: var(--radius-lg);
  transition: border-color .15s, background-color .15s;
}
.an-drop:hover, .an-drop.is-dragover { border-color: var(--red); background: var(--red-tint); }
.an-drop:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.an-drop .icon { width: 2.75rem; height: 2.75rem; color: var(--red-dark); transition: transform .15s; }
.an-drop:hover .icon { transform: translateY(-3px); }
.an-drop strong { font-size: 1.1875rem; }
.an-drop span { color: var(--muted); font-size: 1rem; }

/* "or" with a line either side */
.an-or { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--muted); font-weight: 700; }
.an-or::before, .an-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.an-screen .field { margin-bottom: .25rem; }
.an-count { margin: 0 0 .5rem; color: var(--muted); font-size: 1rem; text-align: right; font-variant-numeric: tabular-nums; }
.an-count--over { color: var(--red-dark); font-weight: 700; }

.an-chips { display: flex; flex-wrap: wrap; gap: .5rem; padding-bottom: .875rem; }

.an-privacy { display: flex; align-items: center; gap: .5rem; margin: 1.25rem 0 0; color: var(--muted); font-size: .9375rem; }
.an-privacy .icon { width: 1.25rem; height: 1.25rem; }

/* ---------- "We found: ..." ---------- */

.an-detected {
  display: flex; align-items: center; gap: .875rem; margin-bottom: 1rem; padding: .875rem 1rem;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.an-detected .icon { width: 2rem; height: 2rem; color: var(--red-dark); }
.an-detected small { display: block; color: var(--muted); font-size: 1rem; overflow-wrap: anywhere; }
.panel .an-detected { box-shadow: none; background: var(--surface-2); }

/* ---------- The result card ---------- */

.an-result { display: grid; gap: 1.25rem; }
.an-result h2 { margin: 0; font-size: 1.5rem; }
.an-result h3 { margin: 0 0 .625rem; font-size: 1.125rem; }
.an-result-body { display: grid; gap: 1.25rem; }
.an-result-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }

/* Risk level: icon + words. High is solid dark red, medium light red, low grey. */
.an-risk {
  display: inline-flex; align-items: center; gap: .5rem; padding: .375rem .875rem;
  border: 2px solid var(--slate); border-radius: 999px;
  font-size: 1.125rem; font-weight: 800; line-height: 1.3; white-space: nowrap;
}
.an-risk .icon { width: 1.375rem; height: 1.375rem; }
.an-risk--low { background: var(--slate-tint); color: var(--charcoal); }
.an-risk--medium { background: var(--red-tint); border-color: var(--red); color: var(--red-dark); }
.an-risk--high { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }
.an-risk--small { padding: .125rem .625rem; font-size: .9375rem; }
.an-risk--small .icon { width: 1.125rem; height: 1.125rem; }

/* Every placeholder result says it is a demo */
.an-demo-tag {
  padding: .125rem .625rem; color: var(--muted); font-size: .875rem; font-weight: 700; white-space: nowrap;
  border: 1px dashed var(--field-border); border-radius: 999px;
}

.an-looks { margin: 0 0 .125rem; color: var(--muted); font-weight: 600; }
.an-summary { margin: .625rem 0 0; font-size: 1.1875rem; }
.an-sure { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin: .75rem 0 0; }
.an-dots { display: inline-flex; gap: .25rem; }
.an-dots span { width: .625rem; height: .625rem; border-radius: 50%; background: var(--divider); }
.an-dots .on { background: var(--charcoal); }
/* The dots take the result's traffic-light colour (red, orange or green),
   so "very sure it is a scam" is never shown in green */
.an-dots--v-bad .on { background: var(--red-dark); }
.an-dots--v-careful .on { background: var(--amber); }
.an-dots--v-good .on { background: var(--green); }

/* The message, with the warning phrases marked */
.an-message {
  margin: 0; padding: 1rem 1.125rem;
  background: var(--surface-2); border-radius: var(--radius);
  font-size: 1.0625rem; line-height: 2; overflow-wrap: anywhere;
}
.an-flag {
  position: relative; padding: .15em .3em; cursor: help; color: var(--charcoal);
  background: var(--red-tint); border-bottom: 2px solid var(--red); border-radius: 4px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-color .15s;
}
.an-flag:hover, .an-flag:focus-visible, .an-flag[aria-expanded="true"] { background: var(--white); outline: 2px solid var(--red); outline-offset: 0; }
.an-flag:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.an-flag-n {
  display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; margin-right: .3em; padding: 0 .2em;
  border-radius: 999px; background: var(--red-dark); color: var(--white);
  font-size: .75em; font-weight: 800; line-height: 1; vertical-align: .12em;
}
/* The reason bubble above a marked phrase. JavaScript nudges it sideways (--shift) if it would
   go past the edge of the screen. */
.an-tip {
  position: absolute; left: var(--shift, 0px); bottom: calc(100% + .5rem); z-index: 5;
  display: none; width: max-content; max-width: min(18rem, calc(100vw - 2.5rem));
  padding: .5rem .75rem;
  background: var(--charcoal); color: var(--white); border-radius: 10px; box-shadow: var(--shadow);
  font-size: 1rem; font-weight: 600; line-height: 1.35; white-space: normal; text-align: left;
}
.an-flag:hover .an-tip, .an-flag:focus-visible .an-tip, .an-flag[aria-expanded="true"] .an-tip { display: block; }

/* The numbered reasons under the message. A row lights up when its phrase is hovered or focused. */
.an-reasons { display: grid; gap: .5rem; margin-top: .75rem; }
.an-reasons li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .625rem; align-items: start;
  padding: .625rem .875rem; border: 2px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, background-color .15s;
}
.an-reasons li.is-linked { border-color: var(--red); background: var(--red-tint); }
.an-reasons .an-flag-n { margin: .2em 0 0; font-size: .8125rem; }
.an-reasons strong { display: block; }
.an-reasons q { display: block; color: var(--muted); font-size: .9375rem; }

.an-none, .an-extra, .an-honesty { display: flex; gap: .625rem; align-items: flex-start; margin: 0; }
.an-none .icon, .an-extra .icon, .an-honesty .icon { flex: none; width: 1.375rem; height: 1.375rem; margin-top: .15rem; }
.an-none { margin-top: .75rem; font-weight: 600; }
.an-honesty { color: var(--muted); font-size: .9375rem; }
.an-extra { padding: .75rem 1rem; background: var(--red-tint); border-radius: var(--radius); font-weight: 600; }
.an-extra .icon { color: var(--red-dark); }

/* Numbered next steps */
.an-steps { display: grid; gap: .625rem; counter-reset: an-step; }
.an-steps li { counter-increment: an-step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .75rem; align-items: start; }
.an-steps li::before {
  content: counter(an-step); display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 50%; background: var(--surface-2); font-weight: 800;
}

/* Buttons under a result: side by side only when the result card itself is wide enough
   (it is narrow when it sits next to the form), otherwise one under the other */
.an-result { container-type: inline-size; }
.an-actions { display: grid; gap: .75rem; }
@container (min-width: 36rem) {
  .an-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-actions .btn-link { grid-column: 1 / -1; }
}
/* 19px bold is "large text", so white on OCBC red (4.4:1) still passes WCAG AA. Don't go smaller. */
.an-actions .btn { font-size: 1.1875rem; }
.an-actions .btn-link { justify-self: center; }
.an-actions .btn-link:hover { color: var(--text); }

/* Something went wrong */
.an-error-icon {
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem;
  border-radius: 50%; background: var(--red-tint); color: var(--red-dark);
}
.an-error-icon .icon { width: 2rem; height: 2rem; }


/* ---------- Voice clip: the result ---------- */

.an-voice .badge { font-size: 1.0625rem; padding: .375rem .75rem; }
.an-chance { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin: 1rem 0 .5rem; }
.an-chance-num { font-family: var(--font-head); font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.an-chance-none { margin: 1rem 0 .5rem; font-weight: 600; }
.an-meter { height: .75rem; overflow: hidden; background: var(--surface-2); border-radius: 999px; }
.an-meter span { display: block; width: var(--w); height: 100%; background: var(--slate); border-radius: 999px; }
.an-voice--partial .an-meter span, .an-voice--uncertain .an-meter span { background: var(--red); }
.an-voice--likely .an-meter span { background: var(--red-dark); }

.an-why { display: grid; gap: .375rem; margin: 0 0 1rem; padding-left: 1.25rem; list-style: disc; }

/* The clip in six 5-second pieces; the AI-sounding pieces are dark red with white text */
.an-timeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.an-timeline li {
  display: grid; place-items: center; height: 2.5rem;
  background: var(--slate-tint); color: var(--muted); border-radius: 8px;
  font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.an-timeline li.is-ai { background: var(--red-dark); color: var(--white); }
.an-key { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; font-size: .9375rem; }
.an-key-swatch { width: 1rem; height: 1rem; border-radius: 4px; background: var(--red-dark); }

/* ---------- Easier reading for older customers ---------- */

/* "It looks like: a fake delivery message" under the big headline */
.verdict .an-kind { margin-top: .375rem; font-size: 1.125rem; font-weight: 600; }
/* "Tap a part to see why" above the marked message */
.an-tap-hint { margin: .75rem 0 .25rem; }
/* "More details": the technical points, folded away */
.an-more { margin: .5rem 0 1rem; padding: .25rem 1rem; border: 1px solid var(--field-border); border-radius: var(--radius); }
.an-more summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 700; }
.an-more summary:hover { color: var(--red-dark); }
.an-more-list { display: grid; gap: .5rem; margin: 0 0 .875rem; padding-left: 1.25rem; list-style: disc; color: var(--muted); }
.an-more .an-timeline-box { margin-bottom: .875rem; }

/* ---------- Demo-only controls (folded away) ---------- */

.an-demo { margin-top: 1rem; padding: .25rem 1rem; border: 1px dashed var(--field-border); border-radius: var(--radius); }
.an-demo summary {
  display: flex; align-items: center; min-height: 48px; cursor: pointer;
  color: var(--muted); font-size: 1rem; font-weight: 700;
}
.an-demo summary:hover { color: var(--text); }
.an-demo-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0 0 .875rem; border: 0; }
.an-pick {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: .25rem .75rem .25rem .5rem; cursor: pointer;
  border: 2px solid var(--border); border-radius: 999px; transition: border-color .15s, background-color .15s;
}
.an-pick:hover { border-color: var(--field-border); background: var(--surface); }
.an-pick:has(input:checked) { border-color: var(--charcoal); background: var(--surface); }
.an-pick:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.an-pick input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--red-dark); }

