/* Animated sections from web-site-demos.php: family account, switching over, push notifications, calculator.
   Each demo is driven by data-phase (oppys.js) and wears --top / --bot from <body>. */

/* Family account: a parent adds two kids, signs them up, pays for both */
.fa-demo { display: flex; flex-direction: column; }
.fa-demo .ap-bar { padding: 30px 16px 12px; }
.fa-body { padding: 14px; flex: 1; }
.fa-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 11px 12px; margin-top: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.fa-av { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; background: var(--top); }
.fa-kid .fa-av { background: hsl(var(--h), 70%, 60%); }
.fa-kid { opacity: 0; transform: translateY(-8px) scale(.96); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; overflow: hidden; transition: opacity .35s ease, transform .4s cubic-bezier(.3,1.4,.5,1), max-height .35s ease, padding .35s ease, margin .35s ease; }
.fa-kid.on { opacity: 1; transform: none; max-height: 80px; padding-top: 11px; padding-bottom: 11px; margin-top: 8px; }
.fa-class { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 800; color: var(--top); background: var(--top-soft); padding: 3px 8px; border-radius: 999px; opacity: 0; transform: scale(.8); transition: opacity .3s ease, transform .35s cubic-bezier(.3,1.6,.5,1); }
.fa-class.on { opacity: 1; transform: none; }
.fa-kid + .fa-kid .fa-class { transition-delay: .25s; }
.fa-add { margin: 10px 0 2px; text-align: center; font-size: 13px; font-weight: 800; color: var(--top); border: 1.5px dashed var(--top); border-radius: 12px; padding: 10px; transition: background .2s ease; }
.fa-demo[data-phase="add1"] .fa-add, .fa-demo[data-phase="add2"] .fa-add { background: var(--top-soft); }
.fa-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 16px 20px; box-shadow: 0 -12px 30px rgba(0,0,0,.14); transform: translateY(105%); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.fa-sheet.on { transform: none; }
.fa-demo[data-phase="paid"] .fa-sheet { transform: translateY(105%); }
.fa-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #44444d; padding: 7px 0; border-bottom: 1px solid #f0f0f4; }
.fa-total { font-weight: 800; color: #1c1c22; border-bottom: 0; }
.fa-pay { margin-top: 10px; text-align: center; color: #fff; font-weight: 800; font-size: 13.5px; padding: 12px; border-radius: 12px; background: linear-gradient(90deg, var(--top), var(--bot)); }
.fa-done { position: absolute; left: 14px; right: 14px; bottom: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #1fa463; color: #fff; font-weight: 800; font-size: 14px; padding: 14px; border-radius: 14px; opacity: 0; transform: translateY(14px); transition: opacity .3s ease, transform .4s cubic-bezier(.3,1.5,.5,1); }
.fa-done.on { opacity: 1; transform: none; }
.fa-done span { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; }

/* Switching over: counters fill as the members, billing and cards move */
@property --n { syntax: '<integer>'; initial-value: 0; inherits: false; }
.mg-shot { flex: 0 0 420px; }
.mg-demo { position: relative; width: 100%; max-width: 420px; margin: 0 auto; text-align: left; background: #fff; border-radius: 20px; padding: 22px; box-shadow: 0 20px 56px rgba(0,0,0,.14); }
.mg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.mg-box { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; padding: 10px 12px; border-radius: 12px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-old { background: #ececf2; color: #6a6a76; }
.mg-new { color: #fff; background: linear-gradient(135deg, var(--top), var(--bot)); }
.mg-new .hp-icon { flex: 0 0 24px; width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }
.mg-new span:last-child { overflow: hidden; text-overflow: ellipsis; }
.mg-flow { flex: 1; position: relative; height: 10px; }
.mg-flow i { position: absolute; top: 2px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--top); opacity: 0; }
.mg-demo[data-phase="move"] .mg-flow i { animation: mgdot 1.1s linear infinite; }
.mg-flow i:nth-child(2) { animation-delay: .22s !important; } .mg-flow i:nth-child(3) { animation-delay: .44s !important; }
.mg-flow i:nth-child(4) { animation-delay: .66s !important; } .mg-flow i:nth-child(5) { animation-delay: .88s !important; }
@keyframes mgdot { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 6px); opacity: 0; } }
.mg-row { margin-top: 12px; }
.mg-label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; color: #2a2a33; margin-bottom: 6px; }
.mg-n { --n: 0; counter-reset: n var(--n); color: var(--top); font-weight: 800; }
.mg-n::after { content: counter(n); }
.mg-bar { height: 8px; border-radius: 6px; background: #ececf2; overflow: hidden; }
.mg-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--top), var(--bot)); }
.mg-demo:not([data-phase="start"]) .mg-n { animation: mgcount 2.6s cubic-bezier(.3,.7,.3,1) calc(var(--i) * .25s) forwards; }
.mg-demo:not([data-phase="start"]) .mg-bar i { animation: mgbar 2.6s cubic-bezier(.3,.7,.3,1) calc(var(--i) * .25s) forwards; }
@keyframes mgcount { to { --n: var(--to); } }
@keyframes mgbar { to { width: 100%; } }
.mg-live { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; background: #1fa463; font-weight: 800; font-size: 15px; padding: 13px; border-radius: 14px; opacity: 0; transform: scale(.92); transition: opacity .3s ease, transform .45s cubic-bezier(.3,1.6,.5,1); }
.mg-live.on { opacity: 1; transform: none; }
.mg-live span { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; }

/* Push notifications: the owner sends, the lock screens light up */
.pb-shot { flex: 0 0 470px; }
.pb-demo { position: relative; display: flex; align-items: center; gap: 22px; justify-content: center; }
.pb-owner { width: 220px; height: 476px; flex: 0 0 220px; }
.pb-owner .ap-bar { padding: 28px 12px 12px; font-size: 14px; }
.pb-body { padding: 14px; }
.pb-to { font-size: 13px; font-weight: 700; color: #2a2a33; background: #fff; border-radius: 10px; padding: 9px 10px; }
.pb-msg { min-height: 96px; font-size: 13px; line-height: 1.45; color: #2a2a33; background: #fff; border-radius: 10px; padding: 10px; }
.pb-msg .typing::after { content: '|'; color: var(--top); animation: pbblink .8s steps(1) infinite; }
@keyframes pbblink { 50% { opacity: 0; } }
.pb-send { margin-top: 12px; text-align: center; color: #fff; font-weight: 800; font-size: 13.5px; padding: 11px; border-radius: 11px; background: linear-gradient(90deg, var(--top), var(--bot)); transition: transform .15s ease; }
.pb-demo[data-phase="send"] .pb-send { transform: scale(.95); }
.pb-grid { display: grid; grid-template-columns: repeat(2, 92px); gap: 10px 12px; }
.pb-lock { position: relative; height: 152px; border-radius: 18px; background: linear-gradient(160deg, #3b3f6b, #15162a); border: 4px solid #16161a; overflow: hidden; }
.pb-time { text-align: center; color: rgba(255,255,255,.85); font-size: 18px; font-weight: 700; padding-top: 10px; }
.pb-note { position: absolute; left: 5px; right: 5px; top: 40px; display: flex; text-align: left; gap: 5px; background: rgba(250,250,252,.95); border-radius: 9px; padding: 6px; opacity: 0; transform: translateY(-14px); transition: opacity .3s ease, transform .4s cubic-bezier(.3,1.4,.5,1); transition-delay: calc(var(--i) * .16s); }
.pb-note .ap-push-icon { flex: 0 0 16px; width: 16px; height: 16px; border-radius: 5px; }
.pb-note b { display: block; font-size: 8.5px; color: #1c1c22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52px; }
.pb-note span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 8px; line-height: 1.3; color: #44444d; }
.pb-demo[data-phase="sent"] .pb-note { opacity: 1; transform: none; }
.pb-sent { position: absolute; right: 0; bottom: -18px; color: #fff; background: #1fa463; font-weight: 800; font-size: 13px; padding: 9px 14px; border-radius: 999px; opacity: 0; transform: translateY(8px); transition: opacity .3s ease .9s, transform .4s ease .9s; }
.pb-sent.on { opacity: 1; transform: none; }

/* Calculator */
.calc { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; max-width: 980px; margin: 0 auto; background: #fff; border: 1px solid var(--ml-line); border-radius: 24px; padding: 30px; box-shadow: 0 18px 44px rgba(42,20,112,.07); }
.calc-field { display: block; margin-bottom: 22px; }
.calc-field > span { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 700; color: var(--ml-ink); margin-bottom: 10px; }
.calc-field > span b { font-size: 22px; color: var(--ml-top); }
.calc input[type="range"] { width: 100%; accent-color: var(--ml-top); height: 28px; }
.calc-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calc-plans button { font: inherit; font-size: 14px; font-weight: 800; color: var(--ml-ink); background: var(--ml-alt); border: 1.5px solid transparent; border-radius: 12px; padding: 10px 6px; cursor: pointer; }
.calc-plans button small { display: block; font-size: 12px; font-weight: 700; color: var(--ml-muted); }
.calc-plans button.on { border-color: var(--ml-top); background: #f1ebff; color: var(--ml-top); }
.calc-note { font-size: 13px; color: var(--ml-muted); line-height: 1.5; }
.calc-out { background: var(--ml-alt); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; }
.calc-line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: #3a3850; padding: 9px 0; border-bottom: 1px solid var(--ml-line); }
.calc-line small { display: block; font-size: 12px; color: var(--ml-muted); }
.calc-line b { white-space: nowrap; }
.calc-keep { padding: 16px 0 6px; }
.calc-keep span { display: block; font-size: 14px; font-weight: 800; color: var(--ml-muted); text-transform: uppercase; letter-spacing: 1px; }
.calc-keep b { display: block; font-size: 40px; font-weight: 800; color: var(--ml-top); line-height: 1.1; }
.calc-keep small { font-size: 14px; color: var(--ml-muted); font-weight: 700; }
.calc-app { font-size: 14px; line-height: 1.5; color: #3a3850; margin: 8px 0 16px; }
.calc-out .btn-ml { text-align: center; margin-top: auto; }

@media (max-width: 820px) {
	.mg-shot, .pb-shot { flex: none; width: 100%; }
	.pb-demo { flex-direction: column; }
	.pb-grid { grid-template-columns: repeat(3, 88px); }
	.pb-lock { height: 150px; }
	.pb-sent { position: static; margin-top: 4px; }
	.calc { grid-template-columns: 1fr; padding: 20px; }
	.calc-plans { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
	.mg-demo .mg-n, .mg-demo .mg-bar i { animation: none !important; }
	.mg-n { --n: var(--to); }
	.mg-bar i { width: 100%; }
	.mg-demo[data-phase="move"] .mg-flow i { animation: none; }
}

/* Hero phone for businesses that run on Projects: jobs with their progress instead of classes */
.hp-job > div { flex: 1; min-width: 0; }
.hp-prog { height: 5px; border-radius: 3px; background: #ecebf2; margin-top: 7px; overflow: hidden; }
.hp-prog i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--top), var(--bot)); }
.hp-pct { font-size: 12px; font-weight: 800; color: var(--top); }
.hp-pct.done { color: #1e7a44; }
/* A project picture drawn as an icon on the brand colors (no photo) */
.pj-pic-ico { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--top), var(--bot)); }
.pj-ring .pj-pic-ico svg { position: static; inset: auto; width: 46%; height: 46%; overflow: visible; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pj-ring .pj-pic-ico svg circle { fill: none; stroke-width: 1.8; }
