/*
 * Three awareness slides: a phishing email, a smishing text on a phone and a
 * training lesson, each with numbered markers explained beside it. Shared by
 * the marketing home page and the sign-in shell; driven by
 * static/js/awareness-slides.js, and readable without it (slide one only).
 *
 * The block sizes itself from its own width (container queries), not the
 * viewport, because it sits in a narrow login panel and a wide marketing
 * section alike.
 */

.aw-slides {
    /* CyberPoints brand by default. The marketing site belongs to no tenant;
       the sign-in shell points these at the tenant colours instead. */
    --aw-accent: #ec3013;
    --aw-dark: #201e1d;
    --aw-ink: #1c1a19;
    --aw-muted: #6b6560;
    --aw-line: #e4e0dd;
    --aw-ok: #16a34a;
    --aw-note: #a39b95;
    --aw-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    container-type: inline-size;
    display: flex;
    flex-direction: column;
    gap: 28px;
    font-family: 'Archivo', system-ui, sans-serif;
}
.aw-slides *, .aw-slides *::before, .aw-slides *::after { box-sizing: border-box; }

/* All three slides share one grid cell, so the block always takes the height
   of the tallest one and the page never jumps when a slide changes. A hidden
   slide keeps its box but is invisible and out of the accessibility tree. */
.aw-stage { display: grid; }
.aw-slide { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; align-items: center; align-content: center; }
.aw-slide[hidden] { display: grid; visibility: hidden; }
/* `translate`, not `transform`, so the specimens keep their tilt. */
.aw-specimen.aw-enter { animation: aw-rise .4s ease both; }
@keyframes aw-rise { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

/* Numbered markers on the specimen */
.aw-mark {
    position: relative;
    border-radius: 4px;
    padding: 0 2px;
    transition: background .25s ease, box-shadow .25s ease;
}
.aw-mark.block { display: inline-block; padding: 3px; border-radius: 10px; }
.aw-mark::after {
    content: attr(data-n);
    position: absolute;
    top: -10px; right: -12px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--aw-accent);
    color: #fff;
    font: 700 .65rem/18px 'Archivo', sans-serif;
    text-align: center;
    transform: scale(0);
    transition: transform .25s cubic-bezier(.3,1.6,.5,1);
    z-index: 2;
}
.aw-mark.on { background: color-mix(in srgb, var(--aw-accent) 16%, transparent); box-shadow: 0 0 0 2px var(--aw-accent); }
.aw-mark.on::after, .aw-mark.seen::after { transform: scale(1); }
.aw-mark.seen:not(.on) { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--aw-accent) 75%, transparent); }

/* Email specimen */
.aw-mail {
    background: #fbfaf9;
    color: var(--aw-ink);
    border-radius: 14px;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06);
    overflow: hidden;
    transform: rotate(-1.2deg);
    font-size: .85rem;
}
.aw-mail .bar { display: flex; gap: 6px; padding: 10px 14px; background: #efece9; border-bottom: 1px solid var(--aw-line); }
.aw-mail .bar i { width: 10px; height: 10px; border-radius: 50%; background: #d6d1cc; }
.aw-mail .head { padding: 16px 18px 12px; border-bottom: 1px solid var(--aw-line); }
.aw-mail .row { display: flex; gap: 8px; margin: 3px 0; flex-wrap: wrap; }
.aw-mail .k { color: var(--aw-muted); width: 54px; flex: none; }
.aw-mail .subject { font-weight: 700; font-size: 1rem; margin-top: 8px; }
.aw-mail .body { padding: 16px 18px 20px; line-height: 1.55; color: #3b3633; }
.aw-mail .body p { margin: 0 0 10px; }
.aw-mail .cta { display: inline-block; background: #2563eb; color: #fff; padding: 8px 16px; border-radius: 6px; font-weight: 600; }
.aw-peek { display: block; margin-top: 6px; font-family: var(--aw-mono); font-size: .72rem; color: var(--aw-muted); min-height: 1.1em; }

/* Phone / SMS specimen */
.aw-phone {
    justify-self: center;
    width: 250px;
    border-radius: 46px;
    padding: 10px;
    background: #0b0b0c;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), inset 0 0 0 2px #2c2c2e, 0 0 0 1px rgba(255,255,255,.08);
    transform: rotate(1.5deg);
}
.aw-phone .screen { background: #fff; border-radius: 37px; overflow: hidden; color: #000; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Archivo', sans-serif; }
.aw-phone .status { display: flex; justify-content: space-between; align-items: center; padding: 12px 26px 0; font-size: .78rem; font-weight: 600; height: 40px; position: relative; }
.aw-phone .island { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); width: 88px; height: 26px; background: #000; border-radius: 20px; }
.aw-phone .icons { display: flex; gap: 4px; align-items: center; }
.aw-phone .contact { text-align: center; padding: 6px 0 10px; border-bottom: 1px solid #ececec; background: #f7f7f7; }
.aw-phone .avatar { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 4px; background: linear-gradient(#a8aeb8, #858b95); color: #fff; display: grid; place-items: center; }
.aw-phone .number { font-size: .72rem; }
.aw-phone .thread { padding: 10px 12px 14px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; }
.aw-phone .when { text-align: center; font-size: .62rem; color: #8e8e93; }
.aw-phone .when b { font-weight: 600; }
.aw-phone .junk { font-size: .62rem; color: #8e8e93; text-align: center; line-height: 1.35; }
.aw-phone .junk a { color: #0a7aff; text-decoration: none; }
.aw-phone .bubble { align-self: flex-start; max-width: 88%; background: #e9e9eb; border-radius: 18px; padding: 8px 12px; font-size: .8rem; line-height: 1.35; }
.aw-phone .bubble .url { color: #0a7aff; text-decoration: underline; word-break: break-all; }
.aw-phone .input { display: flex; align-items: center; gap: 8px; padding: 8px 12px 14px; }
.aw-phone .input span { flex: 1; border: 1px solid #d1d1d6; border-radius: 18px; padding: 6px 12px; font-size: .72rem; color: #c7c7cc; }

/* Training specimen */
.aw-course {
    background: #fff;
    color: var(--aw-ink);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06);
    transform: rotate(-.8deg);
    font-size: .85rem;
}
.aw-course .top { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--aw-dark); color: #fff; }
.aw-course .top small { display: block; opacity: .7; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.aw-course .top strong { font-size: .95rem; }
.aw-course .prog { margin: 0; padding: 12px 18px 0; }
.aw-course .prog .lbl { display: flex; justify-content: space-between; font-size: .72rem; color: var(--aw-muted); margin-bottom: 6px; }
.aw-course .track { display: block; height: 6px; border-radius: 6px; background: #eeeae7; overflow: hidden; }
.aw-course .track i { display: block; height: 100%; width: 40%; background: var(--aw-accent); border-radius: 6px; }
.aw-course .q { padding: 14px 18px 18px; }
.aw-course .q h4 { margin: 0 0 12px; font-size: 1rem; letter-spacing: -.01em; }
.aw-course .opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--aw-line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-family: var(--aw-mono); font-size: .74rem; word-break: break-all; }
.aw-course .opt .dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #cfc9c4; flex: none; display: grid; place-items: center; font-family: 'Archivo', sans-serif; font-size: .6rem; color: #fff; }
.aw-course .opt.good { border-color: var(--aw-ok); background: color-mix(in srgb, var(--aw-ok) 7%, #fff); }
.aw-course .opt.good .dot { background: var(--aw-ok); border-color: var(--aw-ok); }
.aw-course .feedback { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: .78rem; color: var(--aw-muted); }
.aw-course .pts { flex: none; font-weight: 800; color: var(--aw-accent); background: color-mix(in srgb, var(--aw-accent) 10%, #fff); border-radius: 999px; padding: 4px 10px; font-size: .8rem; }

/* Numbered explanations next to the specimen. Hovering one lights its marker. */
.aw-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.aw-flags li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04);
    transition: border-color .25s, background .25s;
}
.aw-flags li:hover { border-color: color-mix(in srgb, var(--aw-accent) 70%, transparent); background: color-mix(in srgb, var(--aw-accent) 12%, transparent); }
.aw-flags .n { width: 22px; height: 22px; border-radius: 50%; background: var(--aw-accent); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.aw-flags strong { display: block; font-size: .88rem; margin-bottom: 2px; }
.aw-flags .d { font-size: .78rem; color: var(--aw-note); line-height: 1.4; }
.has-bg .aw-flags .d { color: #cfc8c3; }

/* Carousel dots */
.aw-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: .78rem; color: var(--aw-note); flex-wrap: wrap; }
.aw-foot .dots { display: flex; gap: 8px; }
.aw-foot .dots button {
    all: unset;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 32px;
    height: 5px; /* content-box: all: unset resets box-sizing, so 21px with the padding */
    padding: 8px 0;
    background: rgba(255,255,255,.18);
    background-clip: content-box;
    border-radius: 5px;
}
.aw-foot .dots button:focus-visible { outline: 2px solid var(--aw-accent); outline-offset: 4px; }
.aw-foot .dots button.done { background-color: color-mix(in srgb, var(--aw-accent) 55%, transparent); }
.aw-foot .dots button.on::before {
    content: "";
    position: absolute; inset: 8px 0;
    border-radius: 5px;
    background: var(--aw-accent);
    transform-origin: left;
    /* SLIDE_MS in static/js/awareness-slides.js. */
    animation: aw-fill 8s linear forwards;
}
.aw-slides.paused .aw-foot .dots button.on::before { animation-play-state: paused; }
@keyframes aw-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@container (max-width: 640px) {
    .aw-slide { grid-template-columns: 1fr; gap: 18px; }
    .aw-flags { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .aw-flags li { padding: 10px 12px; }
    .aw-flags .d { font-size: .72rem; }
}
@container (max-width: 460px) {
    .aw-flags { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .aw-slides *, .aw-slides *::before, .aw-slides *::after { animation: none !important; transition: none !important; }
}
