/* /v2/send — web drop-a-hint wizard. Scoped under .hint-v2, tokens only.
   Shared vocabulary (btn/card/field/input/textarea/eyebrow/text roles) comes from
   components.css + forms.css; this file holds only the flow's page-unique structure
   (progress dots, business logo tile, fullscreen composer — all consumer-app parity). */

/* ---------- Frame ---------- */

.hint-v2 .send-wrap {
    width: 100%;
    max-width: 34rem;
    margin-inline: auto;
    padding: var(--space-6) var(--space-4) var(--space-10);
}

/* ---------- Flow header: eyebrow left, progress dots right ---------- */

.hint-v2 .send-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

/* Progress dots (consumer-app onboarding ProgressDot parity): 10px pills, 8px gap;
   done dots fill purple, the ACTIVE dot widens to 2x — the app's spring, as a width
   transition here (finite, so the global reduced-motion reset covers it). Step names
   stay for screen readers via .visually-hidden + aria-current in the markup. */
.hint-v2 .send-dots {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.hint-v2 .send-dot {
    width: var(--size-dot);
    height: var(--size-dot);
    border-radius: var(--radius-pill);
    background: var(--border);
    transition: width var(--dur-base) var(--ease-out),
                background-color var(--dur-quick) var(--ease-out);
}

.hint-v2 .send-dot.is-active {
    width: calc(var(--size-dot) * 2);   /* the app's widened active pill (10 → 20px) */
    background: var(--primary);
}

.hint-v2 .send-dot.is-done {
    background: var(--primary);
}

/* ---------- Shared step body ---------- */

.hint-v2 .send-body {
    --stack-space: var(--space-4);
}

.hint-v2 .send-state {
    align-items: center;
    text-align: center;
    padding: var(--space-6) var(--space-5);
}

.hint-v2 .send-state-sub {
    color: var(--text-secondary);
}

.hint-v2 .send-state-actions {
    justify-content: center;
}

.hint-v2 .send-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--size-icon-xl);
    height: var(--size-icon-xl);
    color: var(--primary);
}

.hint-v2 .send-state-icon .v2-icon {
    width: 100%;
    height: 100%;
}

/* Locating pulse — a soft breathing dot (no third-party spinner). */
.hint-v2 .send-pulse {
    width: var(--size-icon-md);
    height: var(--size-icon-md);
    border-radius: var(--radius-pill);
    background: var(--primary);
    animation: send-pulse var(--dur-slow) var(--ease-in-out) infinite alternate;
}

@keyframes send-pulse {
    from { opacity: 0.35; transform: scale(0.8); }
    to   { opacity: 1;    transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .hint-v2 .send-pulse { animation: none; }
}

/* ---------- Business list ---------- */

.hint-v2 .send-biz-list {
    --stack-space: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.hint-v2 .send-biz-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-surface);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--dur-hover) var(--ease-out),
                background-color var(--dur-hover) var(--ease-out);
}

.hint-v2 .send-biz-row:hover,
.hint-v2 .send-biz-row:focus-visible {
    border-color: var(--primary);
    background: var(--bg-elevated);
}

.hint-v2 .send-biz-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
    flex: 1 1 auto;
    min-width: 0;
}

.hint-v2 .send-biz-name {
    font-size: var(--text-body);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.hint-v2 .send-biz-addr {
    font-size: var(--text-label);
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.hint-v2 .send-biz-dist {
    flex: 0 0 auto;
    font-size: var(--text-label);
    color: var(--primary);   /* app LocationHeader colors the distance purple */
    white-space: nowrap;
}

/* ---------- Business logo (app LocationHeader parity: 60px rounded square) ---------- */

.hint-v2 .send-logo {
    flex: 0 0 auto;
    width: 60px;    /* app LocationHeader logo size — deliberate off-scale pair */
    height: 60px;
    border-radius: var(--radius-button);   /* 10px, matches the app tile */
    border: 1px solid var(--border-logo);
    object-fit: cover;
    background: var(--bg-surface);         /* letterbox behind transparent PNGs */
}

/* No uploaded logo: the app's tinted first-letter square (NOT the legacy "?" mark). */
.hint-v2 .send-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tint);
    color: var(--text-brand);
    font-weight: var(--fw-bold);
    font-size: var(--text-heading);        /* 22px — the app's fallback letter */
}

.hint-v2 .send-biz-go {
    flex: 0 0 auto;
    display: inline-flex;
    color: var(--text-muted);
}

.hint-v2 .send-biz-go .v2-icon {
    width: var(--size-icon-sm);
    height: var(--size-icon-sm);
}

.hint-v2 .send-empty {
    color: var(--text-secondary);
    text-align: center;
    padding-block: var(--space-4);
}

/* ---------- Composer ---------- */

.hint-v2 .send-target {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
}

.hint-v2 .send-textarea {
    min-height: 11rem;
    resize: vertical;
}

.hint-v2 .send-count {
    font-size: var(--text-micro);
    color: var(--text-muted);
}

.hint-v2 .send-count.is-over {
    color: var(--danger-text);
}

/* PWA hint-strength feedback ("Hint too weak" / "Hint too powerful"). */
.hint-v2 .send-count.is-weak {
    color: var(--warning-text);
}

/* App-composer counter warm-up: past 90% of the limit, before it turns red. */
.hint-v2 .send-count.is-near {
    color: var(--warning-text);
}

/* ---------- Fullscreen composer (app FullscreenComposer parity, mobile only) ----------
   The REAL textarea expands on focus — .is-full fixes the whole composer over the page.
   No second input: the user's own tap is what raises the mobile keyboard (a programmatic
   focus after the Blazor round-trip would land outside the gesture and iOS would refuse).
   Collapsed, .send-composer is an inert wrapper and the bar is just the counter row. */

.hint-v2 .send-composer {
    display: flex;
    flex-direction: column;
}

.hint-v2 .send-composer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-2xs);
}

/* Collapsed: counter keeps its old right-aligned inline spot; Done exists only fullscreen. */
.hint-v2 .send-composer:not(.is-full) .send-composer-bar {
    justify-content: flex-end;
}

/* The app composer's Done pill (radius 20, 8x22 padding, 15px semibold white on purple —
   rounded display face, matching the app pill's MPLUS switch).
   Hidden at rest; the mobile media block below reveals it in the fullscreen bar. */
.hint-v2 .send-composer-done {
    display: none;
    border: 0;
    cursor: pointer;
    border-radius: var(--radius-3xl);
    padding: var(--space-2) 22px;   /* app literal 8x22 — deliberate off-scale inline pad */
    background: var(--primary);
    color: var(--text-on-primary);
    font-family: var(--font-display);
    font-size: 15px;                /* app Done label — deliberately between label/body roles */
    font-weight: var(--fw-semibold);
    transition: background-color var(--dur-hover) var(--ease-out);
}

.hint-v2 .send-composer-done:hover {
    background: var(--primary-hover);
}

/* The flow is phone-first (QR arrival); desktop keeps the plain inline textarea, so all
   fullscreen styling is gated to the site's mobile breakpoint. The .is-full class may
   still be set by the circuit on desktop — these rules are what make it mean anything. */
@media (max-width: 800px) {
    .hint-v2 .send-composer.is-full {
        position: fixed;
        inset: 0;
        z-index: var(--z-modal);
        height: 100dvh;                    /* fallback */
        height: var(--send-vvh, 100dvh);   /* JS-fed visible height while the keyboard is up */
        background: var(--bg-surface);
    }

    /* The same textarea becomes the writing surface: chrome off, app editor metrics on. */
    .hint-v2 .send-composer.is-full .send-textarea,
    .hint-v2 .send-composer.is-full .send-textarea:focus {
        flex: 1 1 auto;
        min-height: 0;
        resize: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;                    /* focus ring off — the surface IS the focus */
        background: var(--bg-surface);
        padding: var(--space-5) var(--space-4);
        font-size: var(--text-subhead);      /* 18px — app editor size */
        line-height: var(--leading-relaxed); /* 1.6 → 28.8px at 18px, the exact app metric */
        font-weight: var(--fw-medium);
    }

    .hint-v2 .send-composer.is-full .send-composer-bar {
        margin-top: 0;
        justify-content: space-between;
        padding: var(--space-xs) var(--space-4);
        padding-bottom: max(var(--space-xs), env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: var(--bg-surface);
    }

    .hint-v2 .send-composer.is-full .send-composer-done {
        display: inline-flex;
    }

    /* Body scroll-lock while the composer is fullscreen — same html:has() pattern as the
       nav drawer (chrome.css); html can't be .hint-v2-scoped. */
    html:has(.hint-v2 .send-composer.is-full) { /* v2lint: allow */
        overflow: hidden;
    }
}

.hint-v2 .send-fineprint {
    color: var(--text-muted);
    text-align: center;
}

/* ---------- Done / Get-the-app ---------- */

.hint-v2 .send-done {
    align-items: center;
    text-align: center;
    padding: var(--space-7) var(--space-5);
}

.hint-v2 .send-done-icon {
    display: inline-flex;
    color: var(--safe-text);
}

.hint-v2 .send-done-icon .v2-icon {
    width: var(--size-icon-xl);
    height: var(--size-icon-xl);
}

/* Badge row uses the shared .store-badges (components.css); only the caption is
   page-unique. */

.hint-v2 .send-badges-caption {
    color: var(--text-muted);
    font-size: var(--text-label);
}

.hint-v2 .send-learn {
    color: var(--text-muted);
    font-size: var(--text-label);
    text-decoration: none;
}

.hint-v2 .send-learn:hover {
    color: var(--text-primary);
    text-decoration: underline;
}
