/* /demo: the role picker, the phone with the app (drawn by js/demo.js) and the steps next to it. */

.demo-page .nav__actions .btn--ghost { display: inline-flex; white-space: nowrap; }
/* small phones: the logo already leads back to the site */
@media (max-width: 480px) { .demo-page .nav__actions .demo-back { display: none; } }
.demo-lang { min-width: 48px; justify-content: center; }

.demo { padding: 120px 0 40px; }
.demo__head { text-align: center; }
.demo__head h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 800; margin-top: 14px; }
.demo__lead { max-width: 620px; margin: 16px auto 0; color: var(--ink-2); }

.demo__roles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.demo__role {
    font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
    padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--paper); color: var(--ink-2);
    transition: background .2s, color .2s, border-color .2s;
}
.demo__role:hover { border-color: var(--brand-2); }
.demo__role[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.demo__stage {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 56px; align-items: start;
    margin-top: 48px;
}
.demo__phone-box { width: 340px; }
.demo__panel { padding-top: 12px; }
.demo__title { font-size: 30px; }
.demo__intro { margin-top: 8px; }

.demo__steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 6px; counter-reset: step; }
.demo__steps button {
    position: relative; overflow: hidden; width: 100%; text-align: left; cursor: pointer;
    font: inherit; font-size: 16px; line-height: 1.45; color: var(--muted);
    display: flex; gap: 14px; padding: 12px 16px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: transparent;
    transition: background .2s, color .2s, border-color .2s;
}
.demo__steps button::before {
    counter-increment: step; content: counter(step);
    flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    font-size: 13px; font-weight: 800; background: var(--line); color: var(--ink-2);
}
.demo__steps button:hover { color: var(--ink); }
.demo__steps .is-done button::before { background: var(--brand-soft); color: var(--brand); }
.demo__steps .is-current button { background: var(--paper); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }
.demo__steps .is-current button::before { background: var(--brand); color: #fff; }

.demo__controls { display: flex; gap: 10px; margin-top: 20px; }
.demo__controls .btn { cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; }

.demo__cta { text-align: center; margin-top: 96px; }
.demo__cta h2 { font-size: clamp(28px, 3.4vw, 40px); }
.demo__cta p { margin-top: 10px; }
.demo__cta-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }

@media (max-width: 900px) {
    .demo { padding-top: 104px; }
    .demo__stage { grid-template-columns: minmax(0, 1fr); gap: 28px; justify-items: center; }
    .demo__phone-box { width: min(340px, 100%); }
    .demo__panel { width: 100%; padding-top: 0; }
    /* on a phone only the current step is shown under the film */
    .demo__steps li:not(.is-current) { display: none; }
}

/* ---- the phone: 340 x 700 drawn at this size, scaled down by js on small screens ---- */

.ph {
    --ph-bg: #f2f2f7; --ph-card: #fff; --ph-ink: #111827; --ph-muted: #6b7280; --ph-line: #e5e5ea;
    --ph-teal: #0d7a67; --ph-teal-soft: #e3f3ee; --ph-grey: #e9e9ee;
    --ph-bad: #c62828; --ph-bad-soft: #fde3e4; --ph-warn: #b45309; --ph-warn-soft: #fff0d2; --ph-ok: #1f8a4c; --ph-ok-soft: #dcf5e7;
    position: relative; width: 340px; height: 700px; transform-origin: top left;
    border-radius: 52px; padding: 12px; background: #0b1119;
    box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a3442;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, var(--font-text), sans-serif;
    color: var(--ph-ink); font-size: 14px; line-height: 1.35;
}
.ph__notch { position: absolute; z-index: 5; top: 22px; left: 50%; width: 96px; height: 28px; margin-left: -48px; border-radius: 20px; background: #0b1119; }
.ph__screen { position: relative; height: 100%; border-radius: 40px; overflow: hidden; background: var(--ph-bg); }

.ph-view { position: absolute; inset: 0; display: flex; flex-direction: column; animation: ph-in .3s var(--ease); }
@keyframes ph-in { from { opacity: 0; } }
.ph-scroll { flex: 1; overflow: hidden; padding: 58px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.ph-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.ph-sub { color: var(--ph-muted); font-size: 13px; margin-top: 2px; }
.ph-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ph-muted); margin: 4px 4px -6px; }

.ph-card { background: var(--ph-card); border-radius: 14px; padding: 12px 14px; }
.ph-card--list { padding: 0 14px; }
.ph-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--ph-line); }
.ph-row:first-child { border-top: 0; }
.ph-row__main { flex: 1; min-width: 0; }
.ph-row__main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-row__main small { display: block; color: var(--ph-muted); font-size: 12px; }
.ph-chev { width: 16px; height: 16px; color: #c4c4c7; flex: none; }
.ph-ic { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--ph-teal); color: #fff; }
.ph-ic svg { width: 17px; height: 17px; }
.ph-ic--grey { background: #8e8e93; }

.ph-plate { display: inline-flex; align-items: stretch; flex: none; border: 1.5px solid #111827; border-radius: 5px; overflow: hidden; font-weight: 800; font-size: 13px; letter-spacing: .06em; background: #fff; }
.ph-plate i { font-style: normal; font-size: 7px; display: grid; place-items: end center; padding: 2px 3px; background: #1d4ed8; color: #fff; }
.ph-plate span { padding: 2px 7px; }

.ph-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.ph-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.is-bad { color: var(--ph-bad); }
.is-warn { color: var(--ph-warn); }
.is-ok { color: var(--ph-ok); }
.is-muted { color: var(--ph-muted); }

.ph-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph-tile { background: var(--ph-card); border-radius: 14px; padding: 10px 12px; transition: background .3s; }
.ph-tile b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.ph-tile small { color: var(--ph-muted); font-size: 11.5px; }
.ph-tile.is-changed { background: var(--ph-teal-soft); }

.ph-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border-radius: 14px; background: var(--ph-teal); color: #fff; font-weight: 700; }
.ph-btn svg { width: 18px; height: 18px; }
.ph-btn--soft { background: var(--ph-teal-soft); color: var(--ph-teal); }
.ph-link { color: var(--ph-teal); font-weight: 600; }
.ph-gap { margin-top: 10px; }

/* the tab bar along the bottom, + in the middle */
.ph-tabs { display: flex; align-items: center; padding: 6px 6px 22px; background: rgba(249, 249, 249, .96); border-top: 1px solid var(--ph-line); }
.ph-tabs__half { flex: 1; display: flex; }
.ph-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: #8e8e93; position: relative; }
.ph-tab svg { width: 22px; height: 22px; }
.ph-tab.is-on { color: var(--ph-teal); }
.ph-tab em { position: absolute; top: -3px; left: 50%; margin-left: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-style: normal; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.ph-plus { flex: none; width: 50px; height: 50px; margin: -6px 6px 0; border-radius: 50%; background: var(--ph-teal); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(13, 122, 103, .7); }
.ph-plus svg { width: 24px; height: 24px; }

/* a form or a menu over the screen */
.ph-sheet { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(0, 0, 0, 0); transition: background .3s; }
.ph-sheet.is-open { background: rgba(0, 0, 0, .3); }
.ph-sheet__body { background: var(--ph-bg); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .35s var(--ease); max-height: 92%; display: flex; flex-direction: column; }
.ph-sheet.is-open .ph-sheet__body { transform: none; }
.ph-sheet--full .ph-sheet__body { height: 94%; }
.ph-sheet__inner { padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.ph-bar { display: flex; justify-content: space-between; font-size: 15px; color: var(--ph-teal); }
.ph-bar b { font-weight: 700; }
.ph-bar .is-off { color: #8e8e93; }
.ph-form-title { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.ph-field { background: var(--ph-card); border-radius: 12px; padding: 10px 12px; min-height: 40px; }
.ph-field:empty::before { content: attr(data-placeholder); color: #a1a1aa; }
.ph-field.is-typing::after { content: ""; display: inline-block; width: 1.5px; height: 15px; margin-left: 1px; vertical-align: -2px; background: var(--ph-teal); animation: ph-caret .8s steps(1) infinite; }
@keyframes ph-caret { 50% { opacity: 0; } }
.ph-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-seg { display: flex; padding: 2px; border-radius: 10px; background: var(--ph-grey); }
.ph-seg span { flex: 1; text-align: center; padding: 6px; border-radius: 8px; font-size: 13px; }
.ph-seg .is-on { background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ph-photo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-photo span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; border-radius: 12px; border: 1.5px dashed #c7c7cc; color: var(--ph-teal); font-weight: 600; font-size: 13px; }
.ph-photo svg { width: 20px; height: 20px; }
.ph-shot { height: 120px; border-radius: 12px; background: linear-gradient(160deg, #fdfcf8, #ece8dc); display: grid; place-items: center; color: #8a8270; font-size: 12px; position: relative; overflow: hidden; animation: ph-flash .5s; }
.ph-shot::before { content: ""; position: absolute; inset: 14px 30px; border-radius: 4px; background: repeating-linear-gradient(#fff 0 9px, #e7e2d6 9px 11px); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.ph-shot span { position: relative; font-weight: 700; color: #333; background: #fff; padding: 2px 8px; border-radius: 4px; }
@keyframes ph-flash { from { filter: brightness(3); } }
.ph-menu .ph-row { padding: 13px 0; }

.ph-switch { width: 42px; height: 25px; flex: none; border-radius: 13px; background: #e9e9ea; position: relative; transition: background .25s; }
.ph-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s; }
.ph-switch.is-on { background: var(--ph-ok); }
.ph-switch.is-on::after { transform: translateX(17px); }

/* the notification from the top, the toast at the bottom, the "no signal" strip */
.ph-push { position: absolute; z-index: 4; top: 46px; left: 10px; right: 10px; padding: 10px 12px; border-radius: 18px; background: rgba(245, 245, 247, .97); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); display: flex; gap: 10px; transform: translateY(-160%); opacity: 0; transition: transform .45s var(--ease), opacity .3s; }
.ph-push.is-in { transform: none; opacity: 1; }
.ph-push__icon { width: 34px; height: 34px; flex: none; border-radius: 9px; background: linear-gradient(#1388e6, #062d7d); }
.ph-push b { display: block; font-size: 13px; }
.ph-push small { display: block; font-size: 12.5px; color: #333; }
.ph-toast { position: absolute; z-index: 4; left: 50%; bottom: 96px; transform: translate(-50%, 20px); opacity: 0; padding: 9px 16px; border-radius: 999px; background: #111827; color: #fff; font-size: 13px; white-space: nowrap; transition: opacity .3s, transform .3s; }
.ph-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.ph-offline { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--ph-warn-soft); color: var(--ph-warn); font-size: 12.5px; font-weight: 600; }
.ph-offline.is-sent { background: var(--ph-ok-soft); color: var(--ph-ok); }
.ph-offline svg { width: 16px; height: 16px; }

/* where the film "taps" */
.ph__finger { position: absolute; z-index: 6; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(15, 27, 45, .22); border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: left .45s var(--ease), top .45s var(--ease), opacity .25s, transform .15s; }
.ph__finger.is-on { opacity: 1; }
.ph__finger.is-down { transform: scale(.75); }
.ph .is-pressed { filter: brightness(.9); }

@media (prefers-reduced-motion: reduce) {
    .ph-view, .ph-shot { animation: none; }
    .ph-sheet__body, .ph-push, .ph__finger, .ph-toast { transition: none; }
}
