/* ============================================================
   "Real calls, real judgment" section  ·  css/use-cases.css

   Each case is a row: explanatory TITLE + DESCRIPTION on one side, and
   a DESKTOP SCENE on the other — the user's screen with an Askpilot
   popup that pops over it (exactly like the How It Works Step 2 "On a
   call" / approvals window). The desktop, menubar, wireframe browser,
   dock and popup chrome all reuse the .hiw-* classes from
   css/how-it-works.css; this file only sizes things for the column and
   styles the popup's inner content (message, options, approve, confirm).
   js/use-cases.js pops the window in, dims the desktop, then plays the
   human response (select an option / press Approve) + a confirm line.
   ============================================================ */

#use-cases { --uc-accent: #4c6cff; }

/* Row layout + copy reuse the site's Tailwind utilities and
   .hiw-step-eyebrow, so the section lines up to the same width as
   How It Works. This file only handles the demo scene. */
.uc-demo { display: flex; justify-content: center; min-width: 0; }
.uc-desktop { width: 100%; min-height: 360px; }
@media (min-width: 640px) { .uc-desktop { min-height: 380px; } }

/* The Askpilot popup that pops over the desktop. Inherits .hiw-callwin
   (absolute-centred, scale-in transition, drop shadow). We just size it
   for these scenes and let it show its body content. */
.uc-popup.hiw-callwin {
    width: min(340px, 86%);
    top: 50%;
}
.uc-popup.hiw-callwin.is-in { pointer-events: auto; }
/* Dim the wireframe + dock once the popup is up, so Askpilot is the
   only saturated thing on screen (mirrors .hiw-desktop.is-call). */
.uc-desktop.is-asking .hiw-wf {
    opacity: 0.5; transform: scale(0.985); filter: saturate(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}
.uc-desktop.is-asking .hiw-dock { opacity: 0.55; }

/* popup identity + tag in the title bar (sits after the traffic lights) */
.uc-win-id { display: inline-flex; align-items: center; gap: 7px; margin-left: 4px; }
.uc-win-id img { width: 15px; height: 15px; display: block; }
.uc-win-id span { font-size: 12px; font-weight: 600; color: #0f172a; }
.uc-win-tag {
    margin-left: auto;
    font-size: 10px; font-weight: 600; letter-spacing: 0.01em;
    border-radius: 9999px; padding: 3px 8px;
    color: var(--uc-accent); background: rgba(101,131,255,0.12);
}
.uc-win-tag.is-warn { color: #b45309; background: rgba(217,119,6,0.14); }

/* popup body */
.uc-win-body { padding: 13px; }
.uc-msg-context {
    font-size: 11.5px; line-height: 1.5; color: #6b7280;
    padding: 8px 10px; background: #f8f9fb;
    border: 1px solid #eef0f4; border-radius: 9px; margin: 0 0 10px;
}
.uc-msg-context b { color: #374151; font-weight: 600; }
.uc-msg { font-size: 13px; line-height: 1.55; color: #1f2937; margin: 0 0 12px; }
.uc-msg strong { color: #0f172a; font-weight: 600; }

/* options (radio style) */
.uc-opts { display: flex; flex-direction: column; gap: 7px; }
.uc-opt {
    display: flex; align-items: center; gap: 9px;
    text-align: left; width: 100%;
    border: 1px solid #e5e7eb; background: #fff;
    border-radius: 10px; padding: 8px 10px; font: inherit; cursor: default;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.uc-opt-radio {
    width: 15px; height: 15px; flex: 0 0 auto; border-radius: 9999px;
    border: 1.6px solid #cbd5e1; position: relative; transition: border-color 0.3s ease;
}
.uc-opt-radio::after {
    content: ''; position: absolute; inset: 3px; border-radius: 9999px;
    background: var(--uc-accent); transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.22,0.61,0.36,1);
}
.uc-opt-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.uc-opt-title { font-size: 12px; font-weight: 600; color: #0f172a; }
.uc-opt-meta { font-size: 10.5px; color: #6b7280; }
.uc-opt.is-picked {
    border-color: rgba(101,131,255,0.6); background: rgba(101,131,255,0.06);
    box-shadow: 0 8px 22px -14px rgba(101,131,255,0.6);
}
.uc-opt.is-picked .uc-opt-radio { border-color: var(--uc-accent); }
.uc-opt.is-picked .uc-opt-radio::after { transform: scale(1); }

/* approve action */
.uc-actions { display: flex; align-items: center; gap: 9px; }
.uc-req {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9.5px; color: #b45309; background: #fff7ed;
    border: 1px solid #fed7aa; border-radius: 6px; padding: 3px 7px;
}
.uc-btn-approve {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 6px;
    border: 0; background: var(--uc-accent); color: #fff;
    font-size: 12px; font-weight: 600; border-radius: 8px; padding: 7px 13px;
    cursor: default; transition: transform 0.12s ease, background 0.3s ease;
}
.uc-btn-approve svg { width: 13px; height: 13px; }
.uc-btn-default { display: inline-flex; align-items: center; gap: 6px; }
.uc-btn-done { display: none; align-items: center; gap: 6px; }
.uc-btn-approve.is-pressed { transform: scale(0.93); background: #3f59d6; }
.uc-btn-approve.is-done { background: #10b981; }
.uc-btn-approve.is-done .uc-btn-default { display: none; }
.uc-btn-approve.is-done .uc-btn-done { display: inline-flex; }

/* confirmation strip that drops in after the response */
.uc-confirmed {
    display: flex; align-items: flex-start; gap: 7px;
    margin-top: 11px; padding-top: 11px; border-top: 1px solid #eef0f4;
    font-size: 12px; line-height: 1.45; color: #047857;
    opacity: 0; max-height: 0; overflow: hidden;
    transition: opacity 0.45s ease, max-height 0.45s ease, margin 0.45s ease, padding 0.45s ease;
}
.uc-confirmed svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: #10b981; }
.uc-popup.is-confirmed .uc-confirmed { opacity: 1; max-height: 90px; }

@media (prefers-reduced-motion: reduce) {
    .uc-opt, .uc-opt-radio::after, .uc-confirmed, .uc-btn-approve { transition: none; }
    .uc-desktop.is-asking .hiw-wf { transition: none; }
}

/* ============================================================
   FEATURED first case spacing (intelligent data logging demo).
   The demo itself reuses the hero .hsd-* styles; this only spaces the row.
   ============================================================ */
.uc-feature { margin-top: 0; }
/* the --hiw-* vars are scoped to #how-it-works; set the eyebrow accent
   explicitly here so the featured eyebrow renders blue inside #use-cases. */
.uc-feature .hiw-step-eyebrow .hiw-step-num { color: #6583FF; }

/* ---- Compliance checklist screen (2nd screen in the featured demo) ----
   Askpilot recognises a new letting and logs the required-docs checklist.
   Items start hidden; JS reveals them one by one (.is-on). Covered items
   tick green; outstanding ones show a flagged status chip. */
.feat-cl-head { margin-bottom: 14px; }
.feat-cl-head-title { display: block; font-size: 15px; font-weight: 700; color: #0f172a; }
.feat-cl-head-meta { display: block; margin-top: 3px; font-size: 12px; color: #6b7280; }
.feat-cl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feat-cl-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border: 1px solid #eef0f4; border-radius: 11px; background: #fff;
    opacity: 0; transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22,0.61,0.36,1), border-color 0.4s ease, background 0.4s ease;
}
.feat-cl-item.is-on { opacity: 1; transform: none; }
.feat-cl-check {
    width: 19px; height: 19px; flex: 0 0 auto; border-radius: 9999px;
    border: 1.6px solid #d4d8e0; background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.35s ease, border-color 0.35s ease;
}
.feat-cl-check svg { width: 11px; height: 11px; color: #fff; opacity: 0; transform: scale(0.5); transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16,1,0.3,1); }
.feat-cl-name { font-size: 13px; font-weight: 500; color: #1f2937; flex: 1 1 auto; min-width: 0; }
/* done state (covered by the call) */
.feat-cl-item.is-done { border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.05); }
.feat-cl-item.is-done .feat-cl-check { background: #10b981; border-color: #10b981; }
.feat-cl-item.is-done .feat-cl-check svg { opacity: 1; transform: none; }
/* outstanding state (flagged + logged, not actioned) */
.feat-cl-item.is-todo .feat-cl-check { border-style: dashed; border-color: #cbd5e1; background: #f8fafc; }
.feat-cl-item.is-target { box-shadow: 0 10px 26px -16px rgba(101,131,255,0.7); border-color: rgba(101,131,255,0.5); }
.feat-cl-foot {
    margin-top: 14px; display: flex; align-items: center; gap: 8px;
    font-size: 11.5px; color: #6b7280;
    padding-top: 12px; border-top: 1px solid #eef0f4;
}
.feat-cl-foot svg { width: 14px; height: 14px; flex: 0 0 auto; color: #4c6cff; }
.feat-cl-foot b { color: #374151; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    .feat-cl-item { opacity: 1; transform: none; transition: none; }
    .feat-cl-check svg { transition: none; }
}

/* ============================================================
   BLOCK 02 — uncertain data logging (#unc-demo).
   Left: hsd-style live transcript (reuses .hsd-* from the hero CSS).
   Right: a desktop (.unc-desk) with the call pill (.unc-win) that
   EXPANDS into an Askpilot question popup when the ambiguity is hit.
   Connectors draw from transcript phrases to the recommended option.
   Driven by js/uncertain-demo.js.
   ============================================================ */
#unc-demo .hsd-connectors { z-index: 6; }

/* The popup reuses .hiw-btn-* from how-it-works.css, whose colours come
   from custom properties declared on #how-it-works — redeclare them here
   so the buttons resolve the same palette inside this section. */
#use-cases {
    --hiw-accent: #4c6cff;
    --hiw-accent-2: #6583FF;
    --hiw-ok: #10b981;
    --hiw-ok-deep: #047857;
    --hiw-ink: #1f2937;
    --hiw-muted: #6b7280;
    --hiw-border: #e5e7eb;
}

/* unc's right side IS the desktop — flatten the inherited white
   .hsd-right card (border, shadow, white fill) so we don't render
   a frame behind a frame. */
#unc-demo .hsd-right {
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}
/* mobile: the right panel must be tall enough for the desk to CONTAIN the
   ask popup (which floats centred over it), or the popup overflows above/
   below the backdrop. */
@media (max-width: 899px) { #unc-demo .hsd-right { height: 560px; } }

/* the desktop frame on the right (mirrors .hiw-desktop) */
.unc-desk {
    position: relative;
    height: 100%;
    min-height: 560px;   /* tall enough to contain the ask popup on mobile */
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8faff 0%, #f3f5fb 100%);
    box-shadow: 0 25px 50px -12px rgba(17, 24, 39, 0.12);
    overflow: hidden;
}
@media (min-width: 900px) { .unc-desk { min-height: 440px; } }
.unc-desk .hiw-menubar { border-radius: 18px 18px 0 0; }
.unc-desk-body {
    position: absolute; inset: 30px 0 0 0;
    padding: 16px 18px;
    display: flex; flex-direction: column; gap: 10px;
}
.unc-desk .hiw-wf { flex: 1; min-height: 0; transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease; }
/* dim the wireframe once the question is up */
.unc-desk.is-asking .hiw-wf { opacity: 0.5; transform: scale(0.985); filter: saturate(0.8); }
.unc-desk.is-asking .hiw-dock { opacity: 0.55; }

/* ---- the call pill → question popup (.unc-win) ----
   Mirrors the Step 2 approvals window exactly: opens as the compact
   "on a call" pill top-right, then EXPANDS into the question form
   when the ambiguity is hit (.is-asking). Same sizes, radii and
   easing as .hiw-approvewin in how-it-works.css. */
.unc-win.hiw-callwin {
    left: auto; right: 16px; top: 16px;
    transform-origin: top right;
    width: min(300px, 82%);
    border-radius: 14px;
    box-shadow: 0 12px 32px -14px rgba(17, 24, 39, 0.18), 0 2px 6px rgba(17, 24, 39, 0.06);
    transform: translateY(-8px) scale(0.96);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.3, 1),
                border-radius 0.5s ease,
                opacity 0.45s ease,
                transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.unc-win.hiw-callwin.is-in { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.unc-win.hiw-callwin.is-out { opacity: 0; transform: translateY(-6px) scale(0.97); }
.unc-win.hiw-callwin.is-asking { width: min(380px, 88%); border-radius: 16px; }

/* title bar — hidden during the pill, slides in on expand (same
   metrics as .hiw-ap-bar in Step 2; title stays centred like there).
   Scoped under .unc-win: how-it-works.css loads after this file, so a
   bare .unc-bar would lose the padding override to .hiw-callwin-bar
   and leave an 18px empty strip above the pill. */
.unc-win .unc-bar {
    overflow: hidden; height: 0;
    padding-top: 0; padding-bottom: 0;
    border-bottom-color: transparent; opacity: 0;
    transition: height 0.4s ease, opacity 0.35s ease, padding 0.4s ease;
}
.unc-win.is-asking .unc-bar {
    height: 38px; padding-top: 9px; padding-bottom: 9px;
    border-bottom-color: #f1f3f7; opacity: 1;
}

.unc-stack { display: flex; flex-direction: column; }

/* live pill body (mirrors step-1/2 compact pill) */
.unc-callbody {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; overflow: hidden;
    transition: opacity 0.3s ease, transform 0.35s ease, height 0.4s ease, padding 0.4s ease;
}
.unc-win.is-asking .unc-callbody { height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; transform: scale(0.95); pointer-events: none; }
.unc-callbody .hiw-callpill-mark { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.unc-callbody .hiw-callpill-mark img { width: 26px; height: 26px; }
.unc-callbody .hiw-callwin-caption { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 12px; font-weight: 400; line-height: 1.25; color: var(--hiw-ink, #1f2937); text-align: left; }
.unc-callbody .hiw-callwin-caption strong { display: block; margin-top: 1px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.unc-callbody .hiw-wave { flex: 0 0 auto; width: auto; margin: 0; height: 22px; gap: 3.5px; justify-content: center; padding: 0 6px; }
.unc-callbody .hiw-wave span { width: 3.5px; height: 6px; border-radius: 2px; }
.unc-callbody .hiw-wave span:nth-child(n+10) { display: none; }
/* Live waveform. Declare the FULL animation shorthand here (not just the
   name) so it reliably runs in the .unc-callbody context, then vary the
   duration + phase per bar so it reads as speech (mirrors the Step 03 pill). */
.unc-win.is-live .unc-callbody .hiw-wave span {
    animation: hiw-wave-bounce-sm 0.9s ease-in-out infinite alternate;
}
.unc-win.is-live .unc-callbody .hiw-wave span:nth-child(2n) { animation-duration: 0.7s;  animation-delay: 0.10s; }
.unc-win.is-live .unc-callbody .hiw-wave span:nth-child(3n) { animation-duration: 1.05s; animation-delay: 0.25s; }
.unc-win.is-live .unc-callbody .hiw-wave span:nth-child(4n) { animation-duration: 0.8s;  animation-delay: 0.40s; }
.unc-win.is-live .unc-callbody .hiw-wave span:nth-child(5n) { animation-duration: 0.6s;  animation-delay: 0.15s; }
.unc-win.is-live .unc-callbody .hiw-wave span:nth-child(7n) { animation-duration: 1.15s; animation-delay: 0.55s; }

/* question body (revealed on expand) */
.unc-askbody {
    max-height: 0; opacity: 0; overflow: hidden; pointer-events: none;
    padding: 0 13px; 
    transition: max-height 0.55s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.4s ease 0.15s, padding 0.45s ease;
}
.unc-win.is-asking .unc-askbody { max-height: 460px; opacity: 1; pointer-events: auto; padding: 13px; }

/* Mobile: the pill spans the desktop edge-to-edge, exactly like the
   Step 1 and Step 2 pills (see .hiw-callpill's 640px media block). */
@media (max-width: 640px) {
    .unc-win.hiw-callwin { left: 12px; right: 12px; width: auto; top: 12px; }
    .unc-win.hiw-callwin.is-asking { width: auto; }
    .unc-callbody { padding: 13px 14px; gap: 10px; }
    .unc-callbody .hiw-callwin-caption { font-size: 14px; }
    .unc-callbody .hiw-callwin-caption strong { font-size: 15.5px; }
    .unc-callbody .hiw-wave { width: 64px; }
}
.unc-q-title { font-size: 14px; font-weight: 700; color: #0f172a; margin: 0 0 4px; }
.unc-msg { font-size: 12.5px; line-height: 1.55; color: #4b5563; margin: 0 0 11px; }
.unc-msg strong { color: #0f172a; font-weight: 600; }

/* New-contact form: Name / Phone / Email fields Askpilot pre-fills by
   typing in, plus a "New applicant" type chip. */
.unc-form { display: flex; flex-direction: column; gap: 8px; }
.unc-field { display: flex; flex-direction: column; gap: 3px; }
.unc-field-label { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #6b7280; }
.unc-field-input {
    display: flex; align-items: center; min-height: 30px; padding: 6px 10px;
    border: 1px solid #e5e7eb; border-radius: 9px; background: #fff;
    font-size: 12.5px; color: #0f172a;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.unc-field-input.is-filled { border-color: #dbe3fb; background: #fbfcff; }
.unc-field-val { white-space: nowrap; overflow: hidden; }
.unc-type-chip {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border: 1px solid #dbe3fb; border-radius: 9999px; background: #eef1ff;
    font-size: 11.5px; font-weight: 600; color: #3552cc;
}
.unc-type-chip svg { width: 12px; height: 12px; }

/* Skip / Create row — same button language as the Step 2 approvals. */
.unc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }


/* connector lines (reuse hsd connector look) */
#unc-connectors path { fill: none; stroke: url(#unc-line-grad); stroke-width: 2; stroke-linecap: round; }
#unc-connectors circle { fill: #6583FF; }
@media (max-width: 899px) { #unc-connectors { display: none; } }

@media (prefers-reduced-motion: reduce) {
    .unc-win, .unc-bar, .unc-callbody, .unc-askbody, .unc-field-input, .unc-desk .hiw-wf { transition: none; }
    #unc-connectors { display: none; }
}
