/* Beagle Trucking product demos shared by Home (/) and Job Portal (/jobs).
   Markup lives in includes/demo-*.php; data in includes/demo-data.php.
   Convention: DriverLanding's UI is dark; screens that belong to someone else (the carrier's
   website, the driver's phone, the recruiter's Tenstreet) are light. */
.demo-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.demo-muted { color: var(--text-faint); font-size: 12px; }
.demo-icon { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-raised); color: var(--accent-text); font-size: 20px; font-variation-settings: 'FILL' 0, 'wght' 400; }
.demo-link-arrow { font-size: 18px; line-height: 1; vertical-align: middle; flex: none; }
.demo-icon-issue, .home-icon-issue { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }

/* ---------- Carrier website (light browser frame) ---------- */
.demo-browser { margin: 0; }
.demo-browser-bar, .demo-ts-chrome { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #dfe3e8; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.demo-browser-bar i, .demo-ts-chrome i { width: 9px; height: 9px; border-radius: 50%; background: #b9c0c9; }
.demo-browser-bar span, .demo-ts-chrome span { margin-left: 10px; flex: 1; font-size: 11.5px; color: #4b5563; background: #fff; border-radius: 4px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-portal { background: #fbf8f2; color: #2a2118; padding: 20px; border-radius: 0 0 var(--radius-md) var(--radius-md); font-family: Montserrat, system-ui, sans-serif; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.demo-portal-logo { display: block; width: 150px; height: auto; margin-bottom: 14px; }
.demo-portal-search { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e4dccd; border-radius: 6px; padding: 10px 12px; font-size: 13px; color: #5a4b3b; }
.demo-portal-search .material-symbols-outlined { font-size: 18px; color: #a0522d; }
.demo-portal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-portal-chips span { font-size: 12px; padding: 5px 14px; border: 1px solid #e4dccd; border-radius: 999px; background: #fff; color: #5a4b3b; }
.demo-portal-chips .is-on { background: #a0522d; border-color: #a0522d; color: #fff; }
.demo-portal-job { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid #ece4d6; border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.demo-portal-job b { display: block; font-size: 14px; color: #2a2118; }
.demo-portal-job small { display: block; font-size: 11.5px; color: #7a6a58; }
.demo-portal-job > strong { color: #8a4420 !important; /* beats the pages' #page strong rule */ font-size: 14px; text-align: right; white-space: nowrap; }
.demo-browser figcaption { font-size: 12.5px; color: var(--text-faint); margin-top: 12px; text-align: center; }

/* ---------- Phone beside Tenstreet ---------- */
.demo-handoff { margin: 0; }
.demo-handoff-stage { display: grid; grid-template-columns: 250px 88px minmax(0, 1fr); align-items: center; }
.demo-phone { background: #fff; color: #1f2937; border: 9px solid #1c2433; border-radius: 34px; padding: 18px 16px 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); font-family: Montserrat, system-ui, sans-serif; }
.demo-phone-notch { width: 70px; height: 6px; border-radius: 3px; background: #1c2433; margin: -8px auto 12px; }
.demo-phone img { display: block; width: 120px; height: auto; margin: 0 auto 10px; }
.demo-phone-job { display: block; font-size: 15px; text-align: center; color: #111827; }
.demo-phone-meta { display: block; font-size: 11px; text-align: center; color: #6b7280; margin-bottom: 12px; }
.demo-phone-field { border: 1px solid #d9dee5; border-radius: 6px; padding: 5px 9px; margin-bottom: 7px; transition: border-color .3s, background-color .3s; }
.demo-phone-field label { display: block; font-size: 9.5px; color: #6b7280; }
.demo-phone-field span { display: block; font-size: 13px; color: #111827; min-height: 19px; }
.demo-phone-btn { display: block; text-align: center; background: var(--action); color: var(--text-on-action); font-weight: 700; font-size: 13px; border-radius: 6px; padding: 10px; margin-top: 10px; transition: transform .15s, filter .15s; }
.demo-phone-next { display: block; text-align: center; font-size: 10.5px; color: #6b7280; margin-top: 8px; }
.demo-handoff-arrow { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--action-text); text-align: center; }
.demo-handoff-arrow .material-symbols-outlined { font-size: 30px; }
.demo-handoff-arrow small { font-size: 11px; color: var(--text-muted); line-height: 1.3; }

/* Recruiter's view: condensed from the full demo's Tenstreet recreation. */
.demo-ts { font-family: Arial, Helvetica, sans-serif; color: #222; font-size: 12.5px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); border-radius: var(--radius-md); min-width: 0; }
.demo-ts-top { background: #fff; padding: 12px 16px 0; display: flex; justify-content: space-between; gap: 16px; }
.demo-ts-name { font-size: 21px; color: #222; }
.demo-ts-sub { font-size: 12px; color: #555; padding: 2px 0 10px; }
.demo-ts-sub b { color: #333; margin-right: 10px; }
.demo-ts-tabs { display: flex; background: #164a85; color: #fff; font-size: 12.5px; overflow: hidden; }
.demo-ts-tabs span { padding: 8px 14px; border-right: 1px solid rgba(255, 255, 255, .18); white-space: nowrap; }
.demo-ts-body { background: #efefef; padding: 12px; border-radius: 0 0 var(--radius-md) var(--radius-md); }
.demo-ts-sec { background: #fff; border: 1px solid #c9c9c9; margin-bottom: 10px; }
.demo-ts-sec h4 { margin: 0; padding: 6px 10px; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(#3d7fca, #2b67ad); }
.demo-ts-sec dl { margin: 0; }
.demo-ts-sec dl > div { display: grid; grid-template-columns: 44% 1fr; border-top: 1px solid #e3e3e3; }
.demo-ts-sec dt, .demo-ts-sec dd { margin: 0; padding: 5px 8px; line-height: 1.4; }
.demo-ts-sec dt { color: #333; }
.demo-ts-sec .from-visit dd { background: #fff6c2; }
.demo-ts-key { font-size: 11.5px; color: #6b5a00 !important; margin: 0; }
.demo-ts-key i { display: inline-block; width: 10px; height: 10px; background: #fff6c2; border: 1px solid #e8d77a; vertical-align: -1px; margin-right: 5px; }

/* ---------- Rich handoff (Job Portal page) ---------- */
.demo-play-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 24px; }
.demo-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-muted); }
.demo-steps li { display: flex; align-items: center; gap: 8px; transition: color .3s; }
.demo-steps b { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--border); color: var(--text-muted); transition: background-color .3s, color .3s, border-color .3s; }
.demo-steps li.is-on { color: var(--text); }
.demo-steps li.is-on b { background: var(--action); border-color: var(--action); color: var(--text-on-action); }
.demo-play { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 12px; border: 1px solid var(--action-border); border-radius: var(--radius-pill); background: var(--action-bg); color: var(--action-text); font: 600 13px Montserrat, system-ui, sans-serif; cursor: pointer; }
.demo-play:hover { background: color-mix(in srgb, var(--action) 25%, transparent); }
.demo-play[disabled] { opacity: .6; cursor: default; }
.demo-play .material-symbols-outlined { font-size: 20px; }
.demo-phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.demo-handoff-rich .demo-phone { width: 250px; min-height: 470px; }
.demo-screen-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-ground); }
.demo-screen-toggle button { border: 0; background: none; color: var(--text-muted); font: 600 11.5px Montserrat, system-ui, sans-serif; padding: 6px 12px; border-radius: var(--radius-pill); cursor: pointer; }
.demo-screen-toggle [aria-pressed=true] { background: var(--surface-raised-high); color: var(--text); }
.demo-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-right: 5px; vertical-align: 0; }
.demo-ts-icons { display: flex; gap: 8px; padding-bottom: 12px; }
.demo-ts-icons span { width: 44px; text-align: center; font-size: 9.5px; color: #666; }
.demo-ts-icons i { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 2px; border-radius: 8px; background: linear-gradient(#4f86c6, #2f62a3); color: #fff; font-style: normal; font-size: 20px; }
.demo-ts-icons .is-red i { background: linear-gradient(#ef4b3f, #c72a20); }
.demo-ts-side { margin: 0; min-width: 150px; }
.demo-ts-side div { margin-bottom: 6px; }
.demo-ts-side dt { font-size: 10.5px; font-weight: 700; color: #555; letter-spacing: .3px; text-transform: uppercase; }
.demo-ts-side dd { margin: 1px 0 0; border: 1px solid #bbb; border-radius: 3px; padding: 3px 6px; font-size: 12.5px; display: flex; justify-content: space-between; }
.demo-ts-side dd::after { content: '\25BE'; color: #555; }
/* Play-through states, set by assets/product-demos.js. Without JS everything shows filled in. */
.demo-playing [data-type].is-blank { color: transparent; }
.demo-playing [data-type].is-typing::after { content: ''; display: inline-block; width: 1px; height: 14px; background: #111827; vertical-align: -2px; margin-left: 1px; animation: demo-caret .6s steps(1) infinite; }
@keyframes demo-caret { 50% { opacity: 0; } }
.demo-phone-btn.is-pressed { transform: scale(.96); filter: brightness(.92); }
.demo-handoff-arrow.is-sending .material-symbols-outlined { animation: demo-send .7s ease-in-out 2; }
@keyframes demo-send { 50% { transform: translateX(10px); } }
.demo-playing .demo-ts [data-row].is-pending { opacity: 0; }
.demo-ts [data-row]:not(.is-pending) { transition: opacity .35s; } /* hide instantly, fade in */
.demo-ts .from-visit.is-new dd { animation: demo-flash 1.2s ease-out; }
@keyframes demo-flash { 0% { background: #ffe066; } 100% { background: #fff6c2; } }
.demo-playing .demo-ts-name.is-pending, .demo-playing .demo-ts-sub.is-pending { opacity: .15; }

/* Full application screen, styled after Tenstreet's IntelliApp (gray fields, red asterisks,
   carrier header and progress pill). The screen scrolls off the bottom like a real phone. */
.demo-ia { font-family: Arial, Helvetica, sans-serif; position: relative; max-height: 418px; overflow: hidden; margin: -6px -4px 0; }
.demo-ia::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 75%); pointer-events: none; }
.demo-ia-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 10px; }
.demo-ia-head img { width: 70px !important; margin: 0 !important; }
.demo-ia-head address { font-style: normal; font-size: 7px; line-height: 1.3; color: #333; text-align: left; }
.demo-ia-head address b { display: block; font-size: 7.5px; }
.demo-ia-progress { background: #ececec; border-radius: 4px; text-align: center; font-size: 8.5px; color: #222; padding: 4px; margin-bottom: 10px; }
.demo-ia h5 { margin: 4px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #cfcfcf; font-size: 13px; font-weight: 400; color: #222; }
.demo-ia-field { margin-bottom: 7px; }
.demo-ia-field label { display: block; font-size: 9.5px; color: #333; margin-bottom: 2px; }
.demo-ia-field label i { color: #c00; font-style: normal; }
.demo-ia-field > span { display: block; min-height: 21px; padding: 3px 7px; border-radius: 3px; background: #dcdfe3; font-size: 11.5px; color: #333; }
.demo-ia-field.is-filled > span { box-shadow: inset 3px 0 0 var(--success); }
.demo-ia-dob { display: flex !important; gap: 4px; padding: 0 !important; background: none !important; }
.demo-ia-dob em, .demo-ia-dob span { height: 21px; border-radius: 3px; background: #dcdfe3; }
.demo-ia-dob em { width: 42px; position: relative; }
.demo-ia-dob em::after { content: ''; position: absolute; right: 6px; top: 8px; border: 4px solid transparent; border-top-color: #999; }
.demo-ia-dob span { width: 54px; }
.demo-ia-note { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 1; text-align: center; font-size: 10px; color: #14532d; }

/* Speech bubbles: the opener you want vs. the one you don't. */
.demo-quote { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.demo-bubble { position: relative; display: inline-flex; align-items: center; gap: 8px; margin: 0 !important; padding: 10px 16px; border-radius: 18px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.demo-bubble::after { content: ''; position: absolute; bottom: -7px; width: 14px; height: 14px; background: inherit; border: inherit; border-top: 0; border-left: 0; transform: rotate(45deg); }
.demo-bubble .material-symbols-outlined { font-size: 19px; }
/* Use one opaque composite so the tail overlaps without double-tinting the green. */
.demo-bubble.is-good { background: color-mix(in srgb, var(--success) 15%, var(--surface-raised)); border: 1px solid var(--success-border); color: var(--text) !important; }
.demo-bubble.is-good::after { left: 22px; }
.demo-bubble.is-good .material-symbols-outlined { color: var(--success-text); }
.demo-bubble.is-meh { background: var(--surface-raised); border: 1px solid var(--border); color: var(--text-muted) !important; font-weight: 500; }
.demo-bubble.is-meh::after { right: 22px; }
.demo-bubble.is-meh .material-symbols-outlined { color: var(--danger-text); }
.demo-beats { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }

/* Interactive portal filters (Job Portal page). */
.demo-portal-filters { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 12px 0 10px; }
.demo-portal-filters .demo-portal-chips { margin: 0; }
.demo-portal-chips button { font: 500 12px Montserrat, system-ui, sans-serif; padding: 6px 14px; min-height: 32px; border: 1px solid #e4dccd; border-radius: 999px; background: #fff; color: #5a4b3b; cursor: pointer; }
.demo-portal-chips button:hover { border-color: #a0522d; }
.demo-portal-chips button[aria-pressed=true] { background: #a0522d; border-color: #a0522d; color: #fff; }
.demo-portal-chips button:focus-visible, .demo-portal-exp select:focus-visible { outline: 2px solid #a0522d; outline-offset: 2px; }
.demo-portal-exp { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: #7a6a58; }
.demo-portal-exp select { font: 500 12px Montserrat, system-ui, sans-serif; color: #2a2118; background: #fff; border: 1px solid #e4dccd; border-radius: 6px; padding: 6px 8px; min-height: 32px; }
.demo-portal-exp.is-static { font-size: 12px; color: #2a2118; background: #fff; border: 1px solid #e4dccd; border-radius: 6px; padding: 5px 6px 5px 10px; gap: 2px; }
.demo-portal-exp.is-static .material-symbols-outlined { font-size: 16px; color: #7a6a58; }
.demo-portal-count { font-size: 11.5px; color: #7a6a58 !important; margin: 0 !important; }
.demo-portal-list { min-height: 0; }
.demo-browser-live .demo-portal-list { min-height: 214px; }
.demo-portal-req { color: #a0522d !important; }
.demo-portal-job[hidden] { display: none !important; }
.demo-portal-empty { font-size: 13px; color: #5a4b3b !important; background: #fff; border: 1px dashed #e4dccd; border-radius: 8px; padding: 14px; margin: 10px 0 0 !important; }

/* ---------- Fit tiles ---------- */
.demo-fit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.demo-fit li { display: grid; gap: 8px; align-content: start; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface-raised) 60%, transparent); }
.demo-fit li strong { font-size: 16px; color: var(--text); }
.demo-fit li span:not(.demo-icon) { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* ---------- Analytics tiles ---------- */
.demo-tile { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 26px; border-radius: var(--radius-lg); }
.demo-tile-head { display: flex; gap: 12px; align-items: center; }
.demo-tile-head h3 { margin: 0; font-size: 19px; line-height: 1.35; }
.demo-tile-take { margin: auto 0 0; font-size: 14.5px; color: var(--text-muted); }
.demo-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.demo-table th, .demo-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); font-weight: 400; color: var(--text-muted); vertical-align: middle; }
.demo-table thead th { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
.demo-table tbody th { color: var(--text); font-weight: 600; }
.demo-cph td:last-child { width: 46%; }
.demo-cph td:last-child b { color: var(--text); font-weight: 600; margin-left: 8px; }
.demo-bar { display: inline-block; vertical-align: middle; height: 8px; width: calc(var(--w) * .55); min-width: 6px; border-radius: 4px; background: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .demo-handoff-stage { grid-template-columns: 230px 64px minmax(0, 1fr); } }
@media (max-width: 960px) { .demo-fit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .demo-handoff-stage { grid-template-columns: 1fr; justify-items: center; gap: 4px; }
  .demo-phone { width: 250px; }
  .demo-handoff-arrow { flex-direction: row; padding: 10px 0; }
  .demo-handoff-arrow .material-symbols-outlined { transform: rotate(90deg); }
  .demo-ts { width: 100%; }
  .demo-ts-top { flex-direction: column; gap: 0; }
  .demo-ts-side { display: none; }
}
@media (max-width: 600px) {
  .demo-m-hide { display: none !important; }
  .demo-portal { padding: 14px; }
  .demo-portal-job { flex-direction: column; align-items: flex-start; gap: 4px; }
  .demo-portal-job > strong { text-align: left; }
  .demo-phone { padding: 14px 14px 12px; }
  .demo-handoff-rich .demo-phone { min-height: 0; }
  .demo-phone img { width: 100px; margin-bottom: 6px; }
  .demo-ts-sec dl > div { grid-template-columns: 1fr; }
  .demo-ts-sec dt { padding-bottom: 0; font-size: 11px; color: #666; }
  .demo-ts-tabs span:nth-child(n+3) { display: none; }
  .demo-ts-icons { display: none; }
  .demo-steps { gap: 6px 12px; font-size: 12px; }
  .demo-fit { grid-template-columns: 1fr 1fr; gap: 10px; }
  .demo-fit li { gap: 6px; padding: 14px; }
  .demo-fit li .demo-icon { width: 32px; height: 32px; font-size: 18px; }
  .demo-fit li strong { font-size: 15px; }
  .demo-fit li span:not(.demo-icon) { font-size: 13px; }
  .demo-tile { gap: 14px; padding: 20px; }
  .demo-table th, .demo-table td { padding: 7px 4px; font-size: 13px; }
  .demo-table thead th { font-size: 10.5px; }
}
@media (max-width: 360px) {
  .demo-fit { grid-template-columns: 1fr; }
  .demo-phone, .demo-handoff-rich .demo-phone { width: 100%; max-width: 250px; }
  .demo-cph td:last-child { width: auto; }
  .demo-bar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-handoff-arrow.is-sending .material-symbols-outlined, .demo-ts .from-visit.is-new dd, .demo-playing [data-type].is-typing::after { animation: none; }
  .demo-phone-field, .demo-phone-btn, .demo-ts [data-row] { transition: none; }
}
