/* LOGGED-OUT-CONVERSION-001 — logged-out web visitors only.
 *
 * Every rule here is scoped to body.guest-web, which updateGuestHeaderState()
 * (app.js) sets only when there is no authenticated business AND the page is
 * not the Android app shell. Signed-in users and the app shell never match any
 * of it, so their experience is exactly what it was. Colours are the existing
 * Cauldra palette (scripts/tailwind/tailwind.config.js); this is polish of the
 * current dashboard, not a new design.
 */

.guest-web-only { display: none; }

/* ---------- Hero ---------- */
body.guest-web #dynamic-welcome-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
}
body.guest-web #dynamic-welcome-banner > div:first-child { width: auto; }
body.guest-web #welcome-badge-wrap,
body.guest-web #welcome-role-badge,
body.guest-web #role-badge-title,
body.guest-web #guest-get-started-btn { display: none !important; }

/* The heading keeps its original text and size (base.css). !important only
   because base.css pins the sub-text size with !important at several
   breakpoints; scoped to logged-out web visitors as everything here. */
body.guest-web #welcome-sub-text {
    font-size: 0.875rem !important;
    line-height: 1.55;
    max-width: 36rem;
    margin-top: 0.6rem;
}

body.guest-web #guest-web-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.15rem;
}

.guest-cta-primary,
.guest-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.65rem 1.15rem;
    border-radius: 0.8rem;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.guest-cta-primary {
    background: #436BEE;
    color: #fff;
    border: 1px solid #436BEE;
    box-shadow: 0 8px 22px rgba(67, 107, 238, 0.28);
}
.guest-cta-primary:hover { background: #375BCC; border-color: #375BCC; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(67, 107, 238, 0.34); }
.guest-cta-primary:active { transform: none; }
.guest-cta-secondary {
    background: transparent;
    color: #E2E8F0;
    border: 1px solid rgba(226, 232, 240, 0.18);
    font-weight: 600;
}
.guest-cta-secondary:hover { background: #131C31; border-color: rgba(226, 232, 240, 0.32); }

/* Android download stays available but reads as secondary to the trial CTA. */
body.guest-web #android-download-row:not(.hidden) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.7rem;
    margin-top: 0.85rem;
}
body.guest-web #android-download-row > div { display: contents; }
body.guest-web #android-download-row p { margin: 0; }
body.guest-web #android-download-row p:last-child { flex-basis: 100%; }
body.guest-web #android-download-link {
    background: transparent;
    border-color: #172033;
    color: #7C8BA1;
}
body.guest-web #android-download-link:hover { color: #E2E8F0; border-color: rgba(226, 232, 240, 0.25); background: #131C31; }

/* Trust line: real facts only (company, platforms, trial, legal, contact). */
body.guest-web #guest-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.95rem;
    margin: 1rem 0 0;
    padding: 0.75rem 0 0;
    list-style: none;
    border-top: 1px solid #172033;
    font-size: 11px;
    color: #7C8BA1;
}
#guest-trust-row li { display: inline-flex; align-items: center; gap: 0.35rem; }
#guest-trust-row i { font-size: 10px; color: #7C8BA1; }
#guest-trust-row button,
#guest-trust-row a {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(124, 139, 161, 0.45);
    text-underline-offset: 3px;
    cursor: pointer;
}
#guest-trust-row button:hover,
#guest-trust-row a:hover { color: #E2E8F0; }
body.guest-web #guest-trust-row .guest-trust-links { flex-basis: 100%; gap: 0.45rem; }
body.guest-web #guest-trust-row .guest-trust-links span { color: #2A3550; }

/* Product preview: real screens from the FreshMart demo business. */
body.guest-web #guest-product-preview { display: block; }
.guest-preview {
    margin: 0;
    border: 1px solid rgba(67, 107, 238, 0.25);
    border-radius: 14px;
    overflow: hidden;
    background: #070B14;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.guest-preview:hover { transform: translateY(-2px); border-color: rgba(67, 107, 238, 0.4); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42); }
.guest-preview img { display: block; width: 100%; height: auto; }

/* ---------- Business Brain (logged out) ---------- */
body.guest-web #business-brief-dashboard .business-brief-open-btn,
body.guest-web #business-brief-dashboard .business-brief-header p { display: none; }
body.guest-web #business-brief-dashboard .business-brief-header { margin-bottom: 0.6rem; }
.guest-brain {
    grid-column: 1 / -1;
    padding: 0.35rem 0.1rem 0.15rem;
}
.guest-brain h4 { margin: 0; font-size: 0.95rem; font-weight: 700; color: #E2E8F0; }
.guest-brain p { margin: 0.35rem 0 0; max-width: 44rem; font-size: 0.75rem; line-height: 1.55; color: #7C8BA1; }

/* ---------- Stock Inventory (logged out) ----------
 * The card is the original; web visitors see its empty state
 * (guestInventoryEmptyRow in app.js) at every width, so the phone-only
 * placeholder overlay of blurred rows is not shown over it. */
body.guest-web #inventory-guest-preview { display: none !important; }
/* Only the "Stock Inventory" title in the header: no stock chips, warehouse
   filter, Export or Add Product before sign-in. */
body.guest-web #inventory-section .inventory-status-row,
body.guest-web #inventory-section #inventory-status-chip,
body.guest-web #inventory-section .inventory-filter-row { display: none !important; }
/* No real rows before sign-in, so the empty table fits the phone screen
   instead of keeping its 700px scroll width (base.css). */
body.guest-web #inventory-section .inventory-table-container table { min-width: 0 !important; }
@media (max-width: 639px) {
    body.guest-web #inventory-section thead th { padding-left: 0.4rem; padding-right: 0.4rem; }
}

/* ---------- Chat: available, but quieter than the trial CTA ---------- */
body.guest-web #chat-launcher-btn {
    background: #0D1322;
    color: #E2E8F0;
    border-color: #172033;
    padding: 0.5rem 0.9rem;
    font-size: 11px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
body.guest-web #chat-launcher-btn:hover { background: #131C31; border-color: rgba(226, 232, 240, 0.22); }
body.guest-web #chat-launcher-btn i { color: #7C8BA1; }
body.guest-web #chat-launcher-btn .chat-launcher-ping { display: none; }

/* ---------- Keyboard focus ---------- */
.guest-cta-primary:focus-visible,
.guest-cta-secondary:focus-visible,
#guest-trust-row button:focus-visible,
#guest-trust-row a:focus-visible,
body.guest-web #android-download-link:focus-visible,
body.guest-web #chat-launcher-btn:focus-visible {
    outline: 2px solid #E2E8F0;
    outline-offset: 2px;
}

/* ---------- Entrance (once, subtle) ---------- */
@keyframes guest-rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
body.guest-web #dynamic-welcome-banner > div:first-child,
body.guest-web #guest-product-preview { animation: guest-rise 360ms ease-out both; }
body.guest-web #guest-product-preview { animation-delay: 90ms; }

@media (prefers-reduced-motion: reduce) {
    body.guest-web #dynamic-welcome-banner > div:first-child,
    body.guest-web #guest-product-preview { animation: none; }
    .guest-cta-primary,
    .guest-cta-secondary,
    .guest-preview { transition: none; }
    .guest-cta-primary:hover,
    .guest-preview:hover { transform: none; }
}

/* ---------- Layout steps ---------- */
@media (min-width: 1024px) {
    body.guest-web #dynamic-welcome-banner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
        gap: 1.75rem;
    }
}
@media (max-width: 420px) {
    #guest-web-cta .guest-cta-primary, #guest-web-cta .guest-cta-secondary { flex: 1 1 auto; }
}
