/* =============================================================================
   FYSH — Private Offer Tracker interactive demo (public page chrome)
   CR: fysh-price-broker-demo-2026-08-27
   The session UI itself is styled by bid-session.css (reused). This file styles
   the demo wrapper: intro, role chooser, simulation bar, restart control.
============================================================================= */

.pbd-main { background: var(--surface-1, #F7F9FC); padding: clamp(1.5rem, 4vw, 3rem) 0 3rem; }

/* The hidden attribute must win over the display rules below. */
.pbd-roles[hidden], .pbd-app[hidden] { display: none !important; }

.pbd-head { max-width: 62ch; margin: 0 auto clamp(1.5rem, 4vw, 2.5rem); text-align: center; }
.pbd-tag {
    display: inline-flex; align-items: center; gap: 7px; margin-bottom: 0.8rem;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--gold-dark, #A8863A);
}
.pbd-tag i { font-size: 15px; }
.pbd-title {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: clamp(1.9rem, 5vw, 2.9rem); font-weight: 700; color: var(--navy, #0F2340);
    line-height: 1.1; margin: 0 0 0.7rem; text-wrap: balance;
}
.pbd-lead { font-size: 1.02rem; color: var(--muted, #6B7A8D); line-height: 1.7; margin: 0; }

/* ── Role chooser ─────────────────────────────────────────────────────────── */
.pbd-roles {
    display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
    max-width: 760px; margin: 0 auto;
}
@media (max-width: 620px) { .pbd-roles { grid-template-columns: 1fr; } }
.pbd-role {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    text-align: left; cursor: pointer;
    background: #fff; border: 1.5px solid var(--border, #E2E8F0); border-radius: 16px;
    padding: 1.6rem 1.5rem; font-family: inherit;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(15,35,64,.08));
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.pbd-role:hover { border-color: var(--gold, #C9A84C); transform: translateY(-3px); box-shadow: var(--shadow-md, 0 6px 20px rgba(15,35,64,.13)); }
.pbd-role:focus-visible { outline: 2px solid var(--gold, #C9A84C); outline-offset: 3px; }
.pbd-role__ico {
    width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: var(--navy, #0F2340); color: var(--gold-lt, #E8C96A); margin-bottom: 0.5rem;
}
.pbd-role__ico i { font-size: 26px; }
.pbd-role__t { font-family: var(--font-display, serif); font-weight: 700; font-size: 1.2rem; color: var(--navy, #0F2340); }
.pbd-role__d { font-size: 0.9rem; color: var(--muted, #6B7A8D); line-height: 1.55; }
.pbd-role__go { margin-top: 0.6rem; display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--blue, #1E5BA8); }
.pbd-role__go i { transition: transform .14s; }
.pbd-role:hover .pbd-role__go i { transform: translateX(4px); }

/* ── App wrapper ──────────────────────────────────────────────────────────── */
.pbd-app { max-width: 1040px; margin: 0 auto; }
.pbd-simbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--navy, #0F2340); color: #fff; border-radius: 12px 12px 0 0;
    padding: 0.7rem 1rem; margin-bottom: -1px;
}
.pbd-simbar__role { font-weight: 700; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 7px; }
.pbd-simbar__role .pbd-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold, #C9A84C); }
.pbd-simbar__note { font-size: 0.78rem; color: rgba(255,255,255,0.7); }
.pbd-restart {
    margin-left: auto; cursor: pointer; font: 600 0.78rem var(--font-body, sans-serif);
    background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px; padding: 6px 13px; display: inline-flex; align-items: center; gap: 6px;
}
.pbd-restart:hover { background: rgba(255,255,255,0.18); }

/* Session shell sits on white, framed to match the sim bar */
#pbd-session {
    background: #fff; border: 1px solid var(--border, #E2E8F0); border-top: 0;
    border-radius: 0 0 14px 14px; padding: clamp(1rem, 3vw, 1.6rem);
    box-shadow: var(--shadow-md, 0 6px 20px rgba(15,35,64,.10));
}

/* Layout of the reused session UI inside the demo */
#pbd-session .bs-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 820px) { #pbd-session .bs-layout { grid-template-columns: 1fr; } }
#pbd-session .bs-action-col { order: 2; }
#pbd-session .bs-timeline-col { order: 1; min-width: 0; }
@media (max-width: 820px) { #pbd-session .bs-action-col { order: 0; } }

/* "Other party is thinking" indicator */
.pbd-thinking {
    display: flex; align-items: center; gap: 9px; justify-content: center;
    padding: 0.8rem; margin: 0.6rem 0; border-radius: 10px;
    background: var(--surface-2, #EEF2F8); color: var(--muted, #6B7A8D); font-size: 0.85rem;
}
.pbd-thinking .pbd-spin { width: 15px; height: 15px; border: 2px solid var(--border-strong, #CBD5E1); border-top-color: var(--blue, #1E5BA8); border-radius: 50%; animation: pbd-spin 0.7s linear infinite; }
@keyframes pbd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pbd-spin { animation: none; } }

/* Toast for validation messages (mirrors gentle inline feedback) */
.pbd-toast {
    margin: 0.5rem 0 0; padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 0.82rem;
    background: #FBE9E7; color: #A32D2D; border: 1px solid #F0B4B4;
}

.pbd-foot { max-width: 62ch; margin: 1.8rem auto 0; text-align: center; font-size: 0.85rem; color: var(--muted, #6B7A8D); line-height: 1.6; }
.pbd-foot a { color: var(--blue, #1E5BA8); }

/* Restart card shown at end */
.pbd-again { text-align: center; padding: 1rem; }
.pbd-again .btn { margin-top: 0.4rem; }
