#authModal .auth-card{width:min(460px,calc(100vw - 32px));max-height:90vh;overflow-y:auto;border-radius:20px}#authModal .auth-header{padding:22px 28px 8px;border:0}#authModal .auth-body{padding:18px 28px 28px}#authModal .auth-brand{display:block;width:190px;max-width:80%;height:auto;margin:0 auto 22px}#authModal .auth-social{display:grid;gap:12px;margin-bottom:22px}#authModal .oauth-button{display:flex;align-items:center;justify-content:center;gap:12px;background:#fff;border:1px solid #cbd5e1;border-radius:10px;padding:13px;color:#0f172a;cursor:pointer}#authModal .oauth-button svg{width:22px;height:22px}#authModal .oauth-button:disabled{opacity:.6;cursor:wait}#authModal .auth-divider{display:flex;align-items:center;gap:12px;color:#64748b;font-size:13px;margin:20px 0}#authModal .auth-divider:before,#authModal .auth-divider:after{content:"";height:1px;background:#dce5ed;flex:1}#authModal .auth-note{font-size:12px;line-height:1.6;text-align:center;color:#64748b;margin-top:20px}#authModal .auth-note a{color:#2563eb}#authModal .auth-feedback{color:#b91c1c;font-size:13px;line-height:1.6}#authModal input{box-sizing:border-box;width:100%}#authModal .auth-switch span{cursor:pointer}
/* v163 login / sign-up redesign */
#authModal .auth-card{width:min(440px,calc(100vw - 24px));border-radius:22px;padding:0;overflow-x:hidden;box-shadow:0 24px 70px rgb(15 23 42 / 35%)}
#authModal .auth-header{padding:20px 24px;background:linear-gradient(135deg,#1e40af,#2563eb 60%,#3b82f6);color:#fff;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:2}
#authModal .auth-header h3{margin:0;color:#fff;font-size:20px;font-weight:800}
#authModal .btn-close-modal{background:rgb(255 255 255 / 18%);color:#fff;border:0;width:34px;height:34px;border-radius:50%;font-size:15px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
#authModal .btn-close-modal:hover{background:rgb(255 255 255 / 30%)}
#authModal .auth-body{padding:22px 26px 26px;background:#fff}
#authModal .auth-brand{width:150px;margin:0 auto 18px}
#authModal .auth-social{grid-template-columns:1fr 1fr;gap:10px;margin-bottom:0}
#authModal .oauth-button{padding:11px 8px;font-size:14px;border:1.5px solid #dbe5ef;border-radius:12px;transition:.15s}
#authModal .oauth-button:hover:not(:disabled){border-color:#93b4f0;background:#f8fbff}
#authModal .oauth-button span{white-space:nowrap}
#authModal .oauth-button svg{width:20px;height:20px}
@media(max-width:400px){#authModal .auth-social{grid-template-columns:1fr}}
#authModal .auth-divider{margin:18px 0}
#authModal .form-group{margin-bottom:14px}
#authModal .form-group label{display:block;font-size:13px;font-weight:700;color:#334155;margin-bottom:6px}
#authModal input{padding:12px 14px;border:1.5px solid #dbe5ef;border-radius:12px;font-size:15px;background:#f8fafc;transition:.15s}
#authModal input:focus{outline:0;border-color:#2563eb;background:#fff;box-shadow:0 0 0 4px rgb(37 99 235 / 14%)}
#authModal .btn-auth-primary{width:100%;padding:13px;border:0;border-radius:12px;background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;font-size:16px;font-weight:800;cursor:pointer;box-shadow:0 6px 16px rgb(37 99 235 / 28%)}
#authModal .btn-auth-primary:hover{filter:brightness(1.07)}
#authModal .btn-auth-primary:disabled{opacity:.6;cursor:wait}
#authModal .auth-switch{margin-top:16px;padding:12px;border-radius:12px;background:#f1f5f9;text-align:center;font-size:14px;color:#475569}
#authModal .auth-switch span{color:#2563eb;font-weight:800}
#authModal .auth-note{margin-top:14px}

/* v163b – Google above Facebook, roomy Forgot Password link */
#authModal .auth-social{grid-template-columns:1fr!important;gap:12px}
#authModal .oauth-button{padding:13px 16px;font-size:15px}
#authModal #loginView div[style*="text-align: right"]{text-align:center!important;margin:16px 0 4px!important}
#authModal #loginView div[style*="text-align: right"] a{font-size:13px!important}
#authModal .auth-switch{margin-top:14px}

/* v234: login and register as a full page with a picture (same popup, same handlers) */
#authModal.modal-backdrop{padding:0;background:#fff;backdrop-filter:none;align-items:stretch;justify-content:stretch;overflow:hidden;z-index:2000}
#authModal .auth-card{position:relative;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);grid-template-rows:auto 1fr;width:100%;max-width:none;height:100%;max-height:none;border-radius:0;box-shadow:none;overflow-x:hidden;overflow-y:auto;background:#fff}
#authModal .auth-card::before{content:"";grid-column:1;grid-row:1/3;position:sticky;top:0;height:100vh;background:#1d4ed8 url(../images/auth-login.webp) 42% center/cover no-repeat;clip-path:polygon(0 0,100% 0,84% 100%,0 100%);margin-right:-8%;z-index:1}
#authModal .auth-header{grid-column:2;grid-row:1;position:static;background:transparent;padding:44px 32px 0;width:100%;max-width:440px;margin:0 auto;box-sizing:border-box;justify-content:flex-start;z-index:2}
#authModal .auth-header h3{color:#0f172a;font-size:26px;font-weight:800}
#authModal .btn-close-modal{position:absolute;top:18px;right:20px;background:#f1f5f9;color:#334155;width:38px;height:38px;z-index:5}
#authModal .btn-close-modal:hover{background:#ef4444;color:#fff}
#authModal .auth-body{grid-column:2;grid-row:2;align-self:center;width:100%;max-width:440px;margin:0 auto;padding:12px 32px 40px;box-sizing:border-box;z-index:2}
#authModal .auth-brand{display:block;width:150px;margin:0 auto 16px}
#authModal .btn-auth-primary{border-radius:999px;padding:14px}
#authModal input{border-radius:14px}
@media (max-width:900px){
  #authModal .auth-card{display:block}
  #authModal .auth-card::before{display:block;position:relative;height:230px;margin:0;background-position:30% center;clip-path:polygon(0 0,100% 0,100% 72%,0 100%)}
  #authModal .auth-header{position:absolute;top:0;left:0;right:0;max-width:none;margin:0;width:auto;padding:14px 64px 0 18px}
  #authModal .auth-header h3{color:#fff;font-size:17px;text-shadow:0 1px 6px rgb(0 0 0 / 35%)}
  #authModal .btn-close-modal{top:10px;right:12px;background:rgb(255 255 255 / 85%);color:#0f172a}
  #authModal .auth-body{max-width:none;margin:-14px 0 0;padding:0 20px 36px;position:relative}
  #authModal .auth-brand{display:block;margin:0 auto 12px;width:120px}
}

/* v235: no visible scrollbar on the login page (it still scrolls), page behind stays still */
#authModal .auth-card{scrollbar-width:none;-ms-overflow-style:none}
#authModal .auth-card::-webkit-scrollbar{display:none;width:0;height:0}
#authModal.modal-backdrop{scrollbar-width:none}
#authModal.modal-backdrop::-webkit-scrollbar{display:none}
html:has(#authModal:not(.hidden)),body:has(#authModal:not(.hidden)){overflow:hidden}
@media (max-width:900px){#authModal .btn-close-modal:hover{background:#ef4444;color:#fff}}
@media (max-width:900px){#authModal .auth-header h3{display:inline-block;background:rgb(15 23 42 / 62%);padding:6px 14px;border-radius:999px;text-shadow:none}}

/* v236: phone login - whole picture on top, title below it on white, picture folds away while typing */
@media (max-width:900px){
  #authModal .auth-card::before{height:min(75vw,300px);background-position:center;background-size:cover;clip-path:polygon(0 0,100% 0,100% 92%,0 100%);transition:height .2s ease}
  #authModal .auth-card:has(input:focus)::before{height:0}
  #authModal .auth-header{position:static;padding:10px 20px 12px;width:auto}
  #authModal .auth-header h3{display:block;background:none;color:#0f172a;font-size:21px;padding:0;text-shadow:none}
  #authModal .btn-close-modal{position:fixed;top:10px;right:12px;z-index:10;box-shadow:0 2px 8px rgb(15 23 42 / 25%)}
  #authModal .auth-body{margin:0;padding:6px 20px 36px}
  #authModal .auth-brand{display:none}
}

/* v237: phone login - show the complete picture (no cut edges) and bring the logo back */
@media (max-width:900px){
  #authModal .auth-card::before{height:min(74.7vw,300px);background-color:#fff;background-size:contain;background-position:center top;background-repeat:no-repeat;clip-path:none}
  #authModal .auth-brand{display:block;width:118px;margin:0 auto 12px}
  #authModal .auth-header{padding:12px 20px 6px}
}

/* v238: phone login - photo fills the whole banner, bottom edge is a wave */
@media (max-width:900px){
  #authModal .auth-card::before{height:min(74.7vw,300px);background-color:transparent;background-size:cover;background-position:center top;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M0 0H100V93C85 100 70 99 55 95C40 91 25 90 12 94C7 95 3 96 0 96Z' fill='black'/></svg>") center/100% 100% no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M0 0H100V93C85 100 70 99 55 95C40 91 25 90 12 94C7 95 3 96 0 96Z' fill='black'/></svg>") center/100% 100% no-repeat}
  #authModal .auth-header{padding:4px 20px 6px}
}

/* v238: desktop - wider picture side so more of the picture shows */
@media (min-width:901px){
  #authModal .auth-card{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
  #authModal .auth-card::before{background-position:60% center;margin-right:-6%}
}

/* v239: desktop - the form column must not paint white over the slanted picture edge */
@media (min-width:901px){
  #authModal .auth-body,#authModal .auth-header{background:transparent}
}

/* v242: bigger logo on the login page */
#authModal .auth-brand{width:220px;margin:0 auto 18px}
@media (max-width:900px){#authModal .auth-brand{width:170px;margin:0 auto 14px}}

/* v244: loading screen for Login / Register */
#m4uAuthLoader{position:fixed;inset:0;background:#fff;z-index:3000;display:flex;align-items:center;justify-content:center;transition:opacity .4s ease,visibility .4s ease}
#m4uAuthLoader.m4u-al-out{opacity:0;visibility:hidden}
#m4uAuthLoader .m4u-al-wrap{position:relative;width:150px;height:150px;display:flex;align-items:center;justify-content:center}
#m4uAuthLoader img{max-width:100px;max-height:100px;object-fit:contain;position:relative;z-index:2;margin-left:-5px}
#m4uAuthLoader .m4u-al-ring{position:absolute;inset:0;border:3px dashed #2563eb;border-radius:50%;border-top-color:#38bdf8;border-left-color:#93c5fd;animation:m4uSpin 1.8s linear infinite;opacity:.85}
@keyframes m4uSpin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){#m4uAuthLoader .m4u-al-ring{animation:none}}

#phoneView .phone-p{font-size:13px;color:#475569;line-height:1.55;margin:0 0 12px}
#phoneView .phone-link{border:0;background:none;color:#2563eb;font-size:13px;font-weight:600;cursor:pointer;padding:6px 0;margin-right:14px}
#phoneView .phone-link:disabled{color:#94a3b8;cursor:default}
#phoneView .phone-note{font-size:13px;font-weight:600;margin:10px 0 0;line-height:1.5}
#phoneView .phone-note.bad{color:#b91c1c}#phoneView .phone-note.good{color:#166534}
#phoneView .btn-auth-primary:disabled{opacity:.6;cursor:default}

/* v347: six-box code entry */
#phoneView .otp-ico{width:60px;height:60px;border-radius:50%;background:#eff6ff;color:#2563eb;display:grid;place-items:center;margin:4px auto 12px}
#phoneView .otp-ico svg{width:28px;height:28px}
#phoneView .otp-h{text-align:center;font-size:20px;font-weight:800;color:#0f172a;margin:0 0 4px}
#phoneView .otp-p{text-align:center;line-height:1.7;overflow-wrap:anywhere}
#phoneView .otp-p b{color:#0f172a}
#phoneView .otp-row{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:14px 0 18px}
#phoneView .otp-row input{height:54px;width:100%;box-sizing:border-box;text-align:center;font-size:22px;font-weight:800;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc;padding:0;font-family:inherit;color:#0f172a;outline:none}
#phoneView .otp-row input:focus{border-color:#2563eb;background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,.12)}
#phoneView .phone-note{border-radius:10px;padding:9px 12px;text-align:center}
#phoneView .phone-note.good{background:#f0fdf4}
#phoneView .phone-note.bad{background:#fef2f2}
@media (max-width:380px){#phoneView .otp-row{gap:6px}#phoneView .otp-row input{height:48px;font-size:20px}}

/* Sign-up form: password eyes, strength bar and checklist */
.rg-w{position:relative}.rg-w input{padding-right:46px!important}
.rg-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:36px;height:36px;border:0;background:none;border-radius:8px;display:grid;place-items:center;color:#64748b;padding:0;cursor:pointer;margin:0}
.rg-eye:hover{background:#eef2f7;color:#0f172a}.rg-eye.on{color:#2563eb}
.rg-eye svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.rg-bar{display:flex;gap:5px;margin:9px 0 5px}.rg-bar i{flex:1;height:5px;border-radius:5px;background:#e2e8f0;transition:background .25s}
.rg-bar.s1 i:nth-child(1){background:#ef4444}.rg-bar.s2 i:nth-child(-n+2){background:#f59e0b}.rg-bar.s3 i:nth-child(-n+3){background:#22c55e}.rg-bar.s4 i{background:#16a34a}
.rg-sl{font-size:12.5px;color:#64748b;margin:0 0 4px}
.rg-req{list-style:none;margin:8px 0 14px;padding:0;display:grid;gap:5px}.rg-req li{font-size:12.5px;color:#64748b;display:flex;align-items:center;gap:8px}
.rg-req li:before{content:"";width:15px;height:15px;border-radius:50%;border:1.5px solid #cbd5e1;box-sizing:border-box;flex:none}
.rg-req li.ok{color:#15803d}.rg-req li.ok:before{background:#16a34a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/11px no-repeat;border-color:#16a34a}

/* v351: hover, press and keyboard-focus effects for every button in the login, sign-up, phone and reset-password boxes */
.auth-card .btn-auth-primary,.auth-card .oauth-button,.auth-card .btn-close-modal,.auth-card .phone-link,.auth-card .auth-switch span,#openForgotModalLink,#switchToLogin,#switchToRegister,#switchToLoginFromForgot{transition:transform .18s ease,box-shadow .18s ease,filter .18s ease,background-color .18s ease,border-color .18s ease,color .18s ease}
.auth-card .btn-auth-primary:active:not(:disabled),.auth-card .oauth-button:active:not(:disabled){transform:translateY(0) scale(.985)!important;box-shadow:none!important;filter:brightness(.96)}
.auth-card .btn-auth-primary:focus-visible,.auth-card .oauth-button:focus-visible,.auth-card .btn-close-modal:focus-visible,.auth-card .phone-link:focus-visible{outline:3px solid rgba(37,99,235,.35);outline-offset:2px}
.auth-card .btn-auth-primary:disabled{transform:none!important;box-shadow:none!important}
@media (hover:hover){
  .auth-card .btn-auth-primary:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 10px 22px rgba(37,99,235,.34);filter:brightness(1.08)}
  .auth-card .oauth-button:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 8px 18px rgba(15,23,42,.10);border-color:#93b4f0;background:#f8fbff}
  .auth-card .btn-close-modal:hover{background:#cbd5e1;color:#0f172a;transform:rotate(90deg)}
  .auth-card .phone-link:hover:not(:disabled){color:#1d4ed8;text-decoration:underline;text-underline-offset:3px}
  .auth-card .auth-switch span:hover,#openForgotModalLink:hover,#switchToLogin:hover,#switchToRegister:hover,#switchToLoginFromForgot:hover{color:#1d4ed8;text-decoration:underline;text-underline-offset:3px}
}
@media (prefers-reduced-motion:reduce){.auth-card .btn-auth-primary,.auth-card .oauth-button,.auth-card .btn-close-modal{transition:none}.auth-card .btn-close-modal:hover{transform:none}}

/* v352: code screens keep the digits while checking, then show a tick */
#phoneView .otp-row.ok input{border-color:#86efac;background:#f0fdf4;color:#15803d}
#phoneView .otp-row.lock input{pointer-events:none}
#phoneView .otp-row.bad input{border-color:#fca5a5;background:#fef2f2}
#phoneView .otp-row.bad{animation:otpshake .35s}
@keyframes otpshake{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
#phoneView .vbtn{display:flex;align-items:center;justify-content:center;gap:10px}
#phoneView .spin{width:17px;height:17px;border-radius:50%;border:2.5px solid rgba(255,255,255,.45);border-top-color:#fff;animation:otpsp .8s linear infinite;display:inline-block}
@keyframes otpsp{to{transform:rotate(360deg)}}
#phoneView .phone-note.busy{background:none;color:#2563eb;text-align:center}
#phoneView .okp{text-align:center;padding:26px 0 14px}
#phoneView .okc{width:84px;height:84px;border-radius:50%;background:#dcfce7;display:grid;place-items:center;margin:0 auto 16px;box-shadow:0 0 0 10px #f0fdf4;animation:okpop .4s cubic-bezier(.2,1.4,.4,1)}
@keyframes okpop{from{transform:scale(.6);opacity:0}to{transform:none;opacity:1}}
#phoneView .okc svg{width:42px;height:42px;fill:none;stroke:#16a34a;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
#phoneView .okp h3{margin:0 0 6px;font-size:22px;color:#0f172a}#phoneView .okp p{margin:0;color:#64748b;font-size:14px}
#phoneView .okbar{height:5px;border-radius:5px;background:#e2e8f0;margin:20px auto 0;max-width:240px;overflow:hidden}
#phoneView .okbar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#2563eb,#16a34a);border-radius:5px;animation:okfill 1.6s ease-out forwards}
@keyframes okfill{to{width:92%}}
@media (prefers-reduced-motion:reduce){#phoneView .otp-row.bad,#phoneView .okc,#phoneView .spin,#phoneView .okbar i{animation:none}#phoneView .okbar i{width:92%}}

/* phone number field with +94 prefix */
#phoneView .pv-pn{display:flex;align-items:center;gap:10px;width:100%;box-sizing:border-box;padding:0 15px;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc;transition:border-color .2s,box-shadow .2s,background .2s}
#phoneView .pv-pn:focus-within{border-color:#2563eb;background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,.12)}
#phoneView .pv-pre{font-weight:700;font-size:14px;color:#334155;padding-right:10px;border-right:1px solid #cbd5e1;line-height:20px;white-space:nowrap;flex:none}
#phoneView .pv-pn input{border:0!important;background:none!important;box-shadow:none!important;outline:none!important;margin:0!important;padding-left:0!important;padding-right:0!important;width:100%;min-width:0;flex:1}
