/* Layout shared by both styles. Colors, fonts and shapes live in each style's own page. */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:Vazirmatn,system-ui,sans-serif;-webkit-tap-highlight-color:transparent;overflow:hidden}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
img{display:block}

/* desktop: one phone in the middle of the screen */
.desk{height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.device{position:relative;width:412px;height:866px;border-radius:54px;border:11px solid #0b0b0d;overflow:hidden;flex:none;transform-origin:center;box-shadow:0 30px 80px -24px rgba(0,0,0,.45)}
.device::before{content:"";position:absolute;top:10px;left:50%;transform:translateX(-50%);width:112px;height:31px;background:#0b0b0d;border-radius:20px;z-index:50}

/* phone: the app fills the screen, no frame */
@media (max-width:560px){
  .desk{display:block;height:auto;padding:0}
  html body{background:var(--top)}
  .device{width:100vw;height:100vh;height:100dvh;border:0;border-radius:0;box-shadow:none;transform:none!important}
  .device::before{display:none}
}

/* iPhone home-screen app with a dark top bar (B): iOS 26 makes the page one top-bar height short
   (WebKit bug 301108) while the page is shorter than the screen. A taller root page stops that.
   With the "default" bar (A) the top inset is 0, so nothing changes. Fix from frappe/frappe-ui#1284. */
@media (display-mode: standalone){html{min-height:min(100lvh,calc(100% + env(safe-area-inset-top)))}}

/* one screen */
#app{position:absolute;inset:0;display:flex;flex-direction:column;overflow:hidden;isolation:isolate}
.scr{position:absolute;inset:0;display:flex;flex-direction:column;padding:56px 20px 0}
@media (max-width:560px){.scr{padding-top:max(16px,env(safe-area-inset-top))}}
/* page change: the old screen slides away while the new one slides in, then its parts rise one by one */
.scr.out{pointer-events:none;z-index:0}
.scr.in-fwd,.scr.in-back{z-index:1}
.scr.in-fwd{animation:inFwd .5s cubic-bezier(.22,1,.36,1) both}
.scr.in-back{animation:inBack .5s cubic-bezier(.22,1,.36,1) both}
.scr.out-fwd{animation:outFwd .4s cubic-bezier(.4,0,.2,1) both}
.scr.out-back{animation:outBack .4s cubic-bezier(.4,0,.2,1) both}
@keyframes inFwd{from{transform:translateX(-56px);opacity:0}}
@keyframes inBack{from{transform:translateX(56px);opacity:0}}
@keyframes outFwd{to{transform:translateX(56px);opacity:0}}
@keyframes outBack{to{transform:translateX(-56px);opacity:0}}
.in-fwd .body>*,.in-back .body>*,.in-fwd .foot,.in-back .foot{animation:rise .55s cubic-bezier(.22,1,.36,1) both}
.body>:nth-child(2){animation-delay:.05s}
.body>:nth-child(3){animation-delay:.1s}
.body>:nth-child(4){animation-delay:.15s}
.body>:nth-child(n+5){animation-delay:.2s}
.in-fwd .foot,.in-back .foot{animation-delay:.12s}
@keyframes rise{from{transform:translateY(14px);opacity:0}}
@media (prefers-reduced-motion:reduce){.scr,.scr *{animation-duration:.01s!important;animation-delay:0s!important}}
.body{flex:1;overflow-y:auto;overflow-x:hidden;padding:4px 2px 16px;margin:0 -2px;scrollbar-width:none}
.body::-webkit-scrollbar{display:none}
.foot{padding:10px 0 max(22px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px}
.hdr{display:flex;align-items:center;gap:10px;min-height:44px;flex:none}
.hdr .grow{flex:1}
.hdr .title{flex:1;text-align:center;font-weight:800;font-size:16px}
.hdr .back-ghost{width:44px;flex:none}
.prog{flex:1;position:relative}
.head{margin:20px 0 18px}
.spacer{flex:1}
.center{text-align:center}
.link{font-weight:700;text-decoration:underline;text-underline-offset:4px}

/* sign-up steps: phone, code, name */
.steps{display:flex;gap:6px;margin-bottom:14px}
.steps span{display:flex;align-items:center;gap:5px;font-size:12px;font-weight:700}
.steps i{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:11px}
.steps i svg{width:11px;height:11px}
.auth .body{display:flex;flex-direction:column}
.auth .body>:first-child{margin-top:auto} /* the card sits low; the background shows above it */
.auth-card{position:relative}
.field .ico{flex:none;display:grid;place-items:center}
.idcard{position:relative;overflow:hidden}
.id-top{display:flex;justify-content:space-between;align-items:center}
.id-top b{direction:ltr}
.id-row{display:flex;align-items:center;gap:14px}
.id-av{flex:none;display:grid;place-items:center;overflow:hidden}
.id-t{min-width:0;display:flex;flex-direction:column;gap:2px}
.id-t b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.id-t em{font-style:normal;text-align:right}

/* phone and name fields */
.field{display:flex;align-items:center;gap:10px;width:100%}
.field input{flex:1;min-width:0;border:0;outline:0;background:none;font-size:18px;padding:0}
.field .lbl{font-size:13px;white-space:nowrap}
.err{font-size:13px;margin-top:8px}

/* code boxes: one real input under five painted boxes, so phone auto-fill works */
.otp{position:relative;direction:ltr;margin-top:8px}
.otp input{position:absolute;inset:0;width:100%;height:100%;opacity:0;font-size:16px;caret-color:transparent}
.otp .boxes{display:flex;gap:10px;justify-content:center;pointer-events:none}
.otp .boxes span{width:54px;height:64px;display:grid;place-items:center;font-size:26px;font-weight:800}

/* options */
.opts{display:flex;flex-direction:column;gap:12px}
.opt{display:flex;align-items:center;gap:12px;width:100%;text-align:right}
.opt .ot{flex:1;display:flex;flex-direction:column;gap:2px}
.opt .ot small{font-weight:500;font-size:13px;opacity:.75}

/* fingerprint: the pact on top, the round button low, near the thumb */
.pledge .body{display:flex;flex-direction:column}
.press{display:flex;flex-direction:column;align-items:center;position:relative;margin-top:auto;padding-top:24px}
.pledge .foot{padding-top:6px}
.slot{display:grid;min-height:58px;align-items:center}
.slot>*{grid-area:1/1}
.slot .hint{text-align:center;transition:opacity .2s}
.sealed .slot .hint{opacity:0}
.fp-wrap{--p:0;position:relative;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.fp-wrap .ring{position:absolute;inset:0;transform:rotate(-90deg)}
.fp-wrap .ring circle{fill:none;stroke-linecap:round}
.fp-wrap .ring .bar{stroke-dasharray:540;stroke-dashoffset:540;opacity:min(1,calc(var(--p) * 40))}
.fp-wrap .fp{position:absolute;border-radius:50%;display:grid;place-items:center}
.fp svg.print path{fill:none;stroke-linecap:round}
.fp svg.print .lit{stroke-dasharray:var(--len);stroke-dashoffset:var(--len)}
.fp-wrap .pulse{position:absolute;border-radius:50%;opacity:0;animation:pulse 2.2s ease-out infinite}
.fp-wrap .pulse.p2{animation-delay:1.1s}
.fp-wrap.done .pulse{display:none}
@keyframes pulse{0%{transform:scale(.94);opacity:.7}100%{transform:scale(1.32);opacity:0}}
.sparks{position:absolute;inset:-30px;pointer-events:none}
.sparks i{position:absolute;left:50%;top:50%;opacity:0}
.fp-wrap.done .sparks i{animation:spark .85s ease-out forwards}
@keyframes spark{0%{opacity:1;transform:translate(-50%,-50%) scale(.3)}100%{opacity:0;transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) scale(1) rotate(90deg)}}
.reveal{opacity:0;pointer-events:none;transform:translateY(8px);transition:.3s}
.reveal.show{opacity:1;pointer-events:auto;transform:none}

/* app screens */
.scr.app{padding-bottom:0}
.tabbar{flex:none;display:flex;margin:0 -20px;padding:8px 8px max(10px,env(safe-area-inset-bottom))}
.tabbar button{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11.5px;font-weight:700;padding:6px 0}
.tabbar button[disabled]{opacity:.35;cursor:default}
.row{display:flex;align-items:center;gap:10px}
.days{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:4px 2px 8px;margin:0 -2px}
.days::-webkit-scrollbar{display:none}
.days button{flex:none;width:52px;padding:8px 0;display:flex;flex-direction:column;align-items:center;gap:2px}
.days button small{font-size:11px;opacity:.7}
.days button b{font-size:17px}

/* bottom sheet */
.sheet-bg{position:absolute;inset:0;z-index:30;background:rgba(0,0,0,.4);opacity:0;pointer-events:none;transition:.25s}
.sheet{position:absolute;left:0;right:0;bottom:0;z-index:31;padding:10px 20px max(22px,env(safe-area-inset-bottom));transform:translateY(105%);transition:transform .3s cubic-bezier(.2,.8,.2,1);max-height:88%;overflow:auto}
.sheet.open{transform:none}
.sheet.open+.sheet-bg,.sheet-bg.open{opacity:1;pointer-events:auto}
.sheet .grab{width:44px;height:5px;border-radius:9px;margin:0 auto 14px;opacity:.3;background:currentColor}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips button{padding:7px 13px;font-size:14px;font-weight:700}
.sheet label.t{display:block;font-size:13px;font-weight:700;margin:14px 0 8px;opacity:.8}
.times{display:flex;gap:10px}
.times input{flex:1;min-width:0;font-size:16px;padding:10px 12px;direction:ltr;text-align:center}

.toast{position:absolute;left:20px;right:20px;bottom:110px;z-index:40;padding:14px 16px;transform:translateY(20px);opacity:0;pointer-events:none;transition:.3s}
.toast.show{transform:none;opacity:1;pointer-events:auto}

/* new version chip (update.js): slides down from the top of the phone */
#upd{position:absolute;z-index:60;top:52px;left:50%;width:calc(100% - 28px);max-width:420px;display:flex;align-items:center;gap:10px;padding:10px 10px 10px 14px;transform:translate(-50%,-180%);transition:transform .45s cubic-bezier(.2,1.4,.4,1)}
#upd.show{transform:translate(-50%,0)}
#upd p{flex:1;margin:0;font-size:13.5px;line-height:1.6}
#upd b{display:block;font-size:15px}
#upd-go{flex:none;height:42px;padding:0 16px;font-size:15px;font-weight:800}
#upd-x{flex:none;width:32px;height:32px;border-radius:50%;font-size:18px;line-height:1}
@media (max-width:560px){#upd{position:fixed;top:max(12px,env(safe-area-inset-top))}}

/* add to home screen (update.js): covers the whole phone when the page is open in the browser */
#add{position:absolute;z-index:70;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:max(24px,env(safe-area-inset-top)) 28px max(24px,env(safe-area-inset-bottom));text-align:center}
#add img{width:96px;height:96px;border-radius:24px}
#add h2{font-size:24px;line-height:1.5}
#add p{font-size:15px;line-height:1.8;max-width:300px}
#add ol{list-style:none;display:flex;flex-direction:column;gap:10px;width:100%;max-width:340px;margin-top:8px;text-align:right}
#add li{display:flex;align-items:center;gap:12px;padding:12px 14px;font-size:15px;font-weight:700;line-height:1.6}
#add li i{flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-weight:800}
#add li svg{width:18px;height:18px;vertical-align:-3px}
#add bdi{white-space:nowrap}
#add-go{width:100%;max-width:340px;height:58px;margin-top:8px;font-size:19px;font-weight:800}
@media (max-width:560px){#add{position:fixed}}
