/* Eshraq App v1.6.3 — unified branded dialogs, recovery and MFA polish */
:root{--eshraq-green:#0b6b5e;--eshraq-green-2:#0f7f6d;--eshraq-gold:#d8af49;--eshraq-beige:#f8f3e8;--eshraq-ink:#17312c;--eshraq-muted:#667085;--eshraq-line:#dbe7e2}

body.eshraq-recovery-active #appView{display:none!important}
body.eshraq-recovery-active #authView{display:grid!important;place-items:center!important;visibility:visible!important;opacity:1!important;position:fixed!important;inset:0!important;width:100vw!important;min-height:100dvh!important;margin:0!important;padding:0!important;overflow:hidden!important}
body.eshraq-recovery-active{overflow:hidden!important}

dialog{border:0!important;padding:0!important;background:transparent!important;max-width:min(94vw,620px)!important;width:auto!important;color:var(--eshraq-ink)}
dialog[open]{position:fixed!important;inset:0!important;margin:auto!important;transform:none!important}
dialog::backdrop{background:rgba(28,37,34,.64)!important;backdrop-filter:blur(4px)}
dialog form.auth-dialog-card,dialog form.dialog-card,#eshraqBeneficiaryMfa form{
  width:min(92vw,560px)!important;max-width:560px!important;margin:0!important;padding:24px 26px 22px!important;border:1px solid rgba(216,175,73,.22)!important;border-radius:24px!important;
  background:linear-gradient(180deg,#fff 0%,#fff 68%,#fbfaf6 100%)!important;box-shadow:0 28px 80px rgba(15,37,32,.28)!important;box-sizing:border-box!important;position:relative!important;overflow:hidden!important;text-align:right!important
}
#passwordDialog form.auth-dialog-card{max-height:92dvh!important;overflow:auto!important;scrollbar-width:thin;scrollbar-color:#8ca39d transparent}

dialog form::before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 8% 10%,rgba(216,175,73,.08),transparent 18%),radial-gradient(circle at 92% 92%,rgba(11,107,94,.06),transparent 20%)}
.eshraq-dialog-brand{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;text-align:center;margin:0 0 16px;padding-bottom:14px;border-bottom:2px solid rgba(216,175,73,.75)}
.eshraq-dialog-brand img{display:block;width:auto;height:auto;max-width:124px;max-height:84px;object-fit:contain;margin:0 auto 7px;filter:drop-shadow(0 5px 10px rgba(11,107,94,.09))}
.eshraq-dialog-brand small{font-size:.74rem;color:#8a6c20;font-weight:800}.eshraq-dialog-brand b{font-size:.9rem;color:var(--eshraq-green);margin-top:2px}
.auth-dialog-card h3,.dialog-card h3,#eshraqMfaForm h3{position:relative;z-index:1;margin:4px 0 7px!important;text-align:center!important;color:var(--eshraq-ink)!important;font-size:1.38rem!important;line-height:1.45!important}
.auth-dialog-card>p,.dialog-card>p,#eshraqMfaText{position:relative;z-index:1;margin:0 auto 16px!important;max-width:450px;text-align:center!important;line-height:1.75!important;color:var(--eshraq-muted)!important;font-size:.9rem!important}
.auth-dialog-card label,.dialog-card label,#eshraqMfaForm label{position:relative;z-index:1;display:grid!important;gap:7px!important;margin:0 0 12px!important;font-weight:800!important;color:#294c45!important}
.auth-dialog-card input,.auth-dialog-card select,.dialog-card input,.dialog-card select,#eshraqMfaForm input,#eshraqMfaForm select{
  width:100%!important;min-height:48px!important;box-sizing:border-box!important;border:1px solid #cfded8!important;border-radius:13px!important;background:#fff!important;padding:10px 14px!important;font:inherit!important;color:#213b36!important;outline:none!important;box-shadow:0 1px 0 rgba(11,107,94,.02)!important
}
.auth-dialog-card input:focus,.dialog-card input:focus,#eshraqMfaForm input:focus,#eshraqMfaForm select:focus{border-color:#74b5a8!important;box-shadow:0 0 0 3px rgba(11,107,94,.10)!important}
.dialog-actions,.eshraq-mfa-actions{position:relative;z-index:1;display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;margin-top:16px!important}
.dialog-actions .btn,.eshraq-mfa-actions .btn{min-height:46px!important;border-radius:12px!important;font-weight:800!important}
.dialog-msg{position:relative;z-index:1;margin:10px 0 0!important;padding:11px 13px!important;border-radius:12px!important;background:#edf8f4!important;color:#24584e!important;text-align:center!important;line-height:1.6!important;opacity:1!important;visibility:visible!important;transition:none!important;animation:none!important}
.dialog-msg:empty{display:none!important}
.dialog-msg.error{background:#fff2f0!important;color:#a33a2d!important;opacity:1!important;visibility:visible!important}
.dialog-msg.hidden{display:none!important}

#eshraqRecoveryMfaStep{position:relative;z-index:1;margin:14px 0 4px!important;padding:16px!important;border:1px solid #cfe5dc!important;border-radius:16px!important;background:linear-gradient(180deg,#f6fbf9,#eef8f4)!important}
#eshraqRecoveryMfaStep h4{margin:0 0 6px!important;text-align:center!important;color:var(--eshraq-ink)!important;font-size:1.08rem!important}
#eshraqRecoveryMfaStep p{margin:0 0 12px!important;text-align:center!important;color:var(--eshraq-muted)!important;font-size:.84rem!important;line-height:1.65!important}
.eshraq-otp-row{display:grid!important;grid-template-columns:repeat(6,1fr)!important;gap:8px!important;direction:ltr!important;margin:8px 0 10px!important}
.eshraq-otp-row input{min-width:0!important;min-height:50px!important;padding:0!important;text-align:center!important;font-size:1.22rem!important;font-weight:900!important;letter-spacing:0!important}
#eshraqRecoveryMfaVerify{width:100%!important;min-height:46px!important;border:0!important;border-radius:12px!important;background:linear-gradient(135deg,#0b6b5e,#0f826e)!important;color:#fff!important;font:inherit!important;font-weight:900!important;cursor:pointer!important}
#eshraqRecoveryMfaHint{margin-top:9px!important;font-size:.76rem!important;color:#6b7773!important;text-align:center!important;line-height:1.6!important}

#eshraqBeneficiaryMfa{max-width:min(94vw,600px)!important}
#eshraqMfaQr{text-align:center!important;margin:0 auto 14px!important}
#eshraqMfaQr img{border-radius:14px;background:#fff;padding:8px;border:1px solid var(--eshraq-line)}
.eshraq-app-trust-box{position:relative;z-index:1!important;margin:14px 0!important;padding:14px!important;border:1px solid #d5e7e0!important;background:#f5faf8!important;border-radius:14px!important;text-align:right!important}
.eshraq-app-trust-box label{margin:0!important}.eshraq-app-trust-box p{margin:8px 0 0!important;line-height:1.65!important;color:#6b7773!important}

dialog button.x,[data-auth-close]{position:relative;z-index:2}

@media(max-width:640px){
  dialog form.auth-dialog-card,dialog form.dialog-card,#eshraqBeneficiaryMfa form{width:min(94vw,520px)!important;padding:20px 17px 18px!important;border-radius:20px!important}
  .eshraq-dialog-brand img{max-width:110px;max-height:78px}.auth-dialog-card h3,.dialog-card h3,#eshraqMfaForm h3{font-size:1.24rem!important}
  .dialog-actions,.eshraq-mfa-actions{grid-template-columns:1fr!important}.eshraq-otp-row{gap:5px!important}.eshraq-otp-row input{min-height:46px!important;font-size:1.04rem!important}
}
