1&display=swap");
#mlStudentPortal,#mlStudentPortal *{box-sizing:border-box}
#mlStudentPortal{
  --blue:#2457ee;
  --deep:#102a72;
  --purple:#6547e9;
  --text:#10182c;
  --muted:#68738b;
  --line:#dfe5f2;
  min-height:680px;
  border-radius:18px;
  overflow:hidden;
  color:var(--text);
  font-family:Arial,sans-serif;
  background:
    radial-gradient(circle at top left,rgba(73,112,255,.12),transparent 32%),
    radial-gradient(circle at top right,rgba(144,89,255,.10),transparent 30%),
    #f7f9ff;
}
.ml-header{
  min-height:70px;
  padding:0 24px;
  background:#fff;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid #e1e6f0;
  box-shadow:0 6px 24px rgba(22,41,91,.06);
}
.ml-brand{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--deep);
  font-size:21px;
  font-weight:900;
}
.ml-brand-mark{
  width:38px;
  height:38px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--blue),var(--purple));
  color:#fff;
  display:grid;
  place-items:center;
  font-size:20px;
}
.ml-header-label{color:var(--blue);font-weight:800}
.ml-auth-wrap{padding:50px 14px 75px}
.ml-auth-card{
  width:min(100%,560px);
  margin:auto;
  background:#fff;
  border:1px solid #dfe5f2;
  border-radius:25px;
  overflow:hidden;
  box-shadow:0 24px 65px rgba(33,51,99,.13);
}
.ml-tabs{display:grid;grid-template-columns:1fr 1fr;background:#eef1f7}
.ml-tab{
  border:0;
  padding:18px;
  background:transparent;
  font-size:17px;
  font-weight:800;
  cursor:pointer;
}
.ml-tab.active{background:#050505;color:#fff}
.ml-auth-content{padding:31px}
.ml-auth-title{margin:0 0 7px;font-size:30px}
.ml-auth-subtitle{margin:0 0 24px;color:var(--muted);line-height:1.6}
.ml-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.ml-field{margin-bottom:14px}
.ml-field.full{grid-column:1/-1}
.ml-input-wrap{
  min-height:57px;
  display:flex;
  align-items:center;
  background:#f9fbff;
  border:1px solid #d6deed;
  border-radius:14px;
}
.ml-input-wrap:focus-within{
  border-color:#5b76ee;
  box-shadow:0 0 0 4px rgba(71,99,235,.11);
  background:#fff;
}
.ml-input-icon{
  width:50px;
  text-align:center;
  color:#526078;
  font-weight:800;
}
.ml-input{
  flex:1;
  min-width:0;
  height:55px;
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  padding:0 10px 0 0!important;
  color:#111827!important;
  font-size:16px!important;
}
.ml-password-toggle{
  width:48px;
  height:54px;
  border:0;
  background:transparent;
  cursor:pointer;
  font-size:18px;
}
.ml-primary-btn{
  width:100%;
  min-height:53px;
  border:0;
  border-radius:14px;
  background:linear-gradient(135deg,var(--blue),var(--purple));
  color:#fff;
  font-size:17px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 12px 28px rgba(54,73,221,.25);
}
.ml-primary-btn:disabled{opacity:.65;cursor:not-allowed}
.ml-auth-links{
  margin-top:18px;
  display:flex;
  justify-content:space-between;
  gap:14px;
}
.ml-text-btn{
  border:0;
  background:transparent;
  color:var(--blue);
  font-weight:800;
  cursor:pointer;
}
.ml-message{
  display:none;
  margin-top:16px;
  padding:12px;
  border-radius:11px;
  font-weight:700;
}
.ml-message.error{
  display:block;
  color:#a81726;
  background:#fff0f2;
  border:1px solid #ffcbd1;
}
.ml-message.success{
  display:block;
  color:#087443;
  background:#ecfff5;
  border:1px solid #b9efd4;
}
.ml-loading-screen{
  min-height:620px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:15px;
  font-weight:800;
  color:var(--deep);
}
.ml-spinner{
  width:46px;
  height:46px;
  border:5px solid #dfe6ff;
  border-top-color:var(--blue);
  border-radius:50%;
  animation:mlSpin .75s linear infinite;
}
@keyframes mlSpin{to{transform:rotate(360deg)}}
.ml-hero{
  margin:22px;
  padding:36px 38px;
  border-radius:25px;
  background:linear-gradient(115deg,#fff,#f0f4ff);
  display:flex;
  justify-content:space-between;
  align-items:center;
  border:1px solid #dfe5f2;
  box-shadow:0 15px 44px rgba(30,49,99,.09);
}
.ml-hero h1{margin:0 0 9px;font-size:35px}
.ml-hero p{margin:0;color:var(--muted)}
.ml-hero-art{
  width:105px;
  height:105px;
  border-radius:30px;
  background:linear-gradient(135deg,#e9edff,#f2eaff);
  display:grid;
  place-items:center;
  font-size:48px;
}
.ml-books-card{
  margin:22px;
  background:#fff;
  border:1px solid #dfe5f2;
  border-radius:22px;
  padding:17px;
  box-shadow:0 15px 44px rgba(30,49,99,.08);
}
.ml-table-header,.ml-book-row{
  display:grid;
  grid-template-columns:72px minmax(180px,1.7fr) .7fr .9fr 105px;
  gap:15px;
  align-items:center;
}
.ml-table-header{
  padding:13px 15px;
  background:#eef4ff;
  border-radius:12px;
  font-weight:800;
}
.ml-book-row{
  padding:15px;
  border-bottom:1px solid #e6eaf2;
}
.ml-book-cover{
  width:52px;
  height:72px;
  object-fit:cover;
  border-radius:8px;
  background:#edf0f7;
}
.ml-book-title-wrap{
  min-width:0;
  width:100%;
  overflow:hidden;
  position:relative;
  mask-image:linear-gradient(to right,transparent 0,#000 12px,#000 calc(100% - 12px),transparent 100%);
  -webkit-mask-image:linear-gradient(to right,transparent 0,#000 12px,#000 calc(100% - 12px),transparent 100%);
}
.ml-book-title-track{
  display:flex;
  align-items:center;
  width:max-content;
  min-width:100%;
  white-space:nowrap;
  will-change:transform;
}
.ml-book-title-copy{
  flex:0 0 auto;
  padding-right:42px;
  font-size:16px;
  line-height:1.4;
  font-weight:850;
}
.ml-book-title-wrap:not(.is-scrolling) .ml-book-title-copy.clone{
  display:none;
}
.ml-book-title-wrap.is-scrolling .ml-book-title-track{
  animation:mlTitleMarquee var(--ml-title-duration,12s) linear infinite;
}
.ml-book-title-wrap.is-scrolling:hover .ml-book-title-track{
  animation-play-state:paused;
}
@keyframes mlTitleMarquee{
  from{transform:translateX(0)}
  to{transform:translateX(-50%)}
}
.ml-meta{color:#647089}
.ml-open-btn,.ml-outline-btn{
  min-height:43px;
  border-radius:13px;
  font-weight:850;
  cursor:pointer;
}
.ml-open-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-width:150px;
  border:1px solid rgba(255,255,255,.34);
  background:linear-gradient(135deg,#3468ff 0%,#2854e8 52%,#5a48e8 100%);
  color:#fff;
  padding:0 17px;
  box-shadow:0 10px 22px rgba(42,79,225,.24),inset 0 1px 0 rgba(255,255,255,.26);
  transition:transform .2s ease,box-shadow .2s ease,filter .2s ease;
}
.ml-open-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 28px rgba(42,79,225,.30),inset 0 1px 0 rgba(255,255,255,.30);
}
.ml-open-btn:active{transform:translateY(0) scale(.985)}
.ml-toggle-book-icon{
  width:20px;height:20px;display:inline-grid;place-items:center;
  border-radius:7px;background:rgba(255,255,255,.15);font-size:12px;
}
.ml-toggle-label{white-space:nowrap}
.ml-toggle-symbol{
  width:20px;height:20px;display:grid;place-items:center;border-radius:50%;
  background:rgba(255,255,255,.16);font-size:10px;transition:transform .28s ease;
}
.ml-open-btn[aria-expanded="true"]{background:linear-gradient(135deg,#142f88,#4436b7)}
.ml-open-btn[aria-expanded="true"] .ml-toggle-symbol{transform:rotate(180deg)}
.ml-outline-btn{
  border:1px solid #cad6ff;background:linear-gradient(180deg,#fff,#f5f7ff);
  color:#2457ee;padding:0 15px;box-shadow:0 5px 13px rgba(38,75,190,.08);
}
.ml-outline-btn:hover{border-color:#7895ff;background:#eef3ff}
.ml-chapter-panel{
  display:grid;grid-template-rows:0fr;padding:0 18px 0 100px;
  background:#f8faff;border-bottom:1px solid #e6eaf2;opacity:0;overflow:hidden;
  transition:grid-template-rows .32s ease,opacity .22s ease,padding .32s ease;
}
.ml-chapter-panel-inner{min-height:0;overflow:hidden}
.ml-chapter-panel.open{
  grid-template-rows:1fr;padding:9px 18px 18px 100px;opacity:1;
}
.ml-chapter-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-top:9px;
  padding:12px 13px;
  background:#fff;
  border:1px solid #e2e7f1;
  border-radius:11px;
}
.ml-chapter-name{
  min-width:0;
  font-weight:750;
  line-height:1.5;
}
.ml-empty{
  text-align:center;
  padding:45px 18px;
  color:var(--muted);
  font-weight:750;
}
.ml-footer{
  display:flex;
  justify-content:center;
  padding:6px 22px 28px;
}
.ml-logout-btn{
  border:1px solid #d1d8e8;
  background:#fff;
  color:#33405b;
  border-radius:10px;
  padding:10px 19px;
  font-weight:800;
  cursor:pointer;
}

/* Secure reader */
.ml-reader{
  position:fixed;
  inset:0;
  z-index:999999;
  display:none;
  flex-direction:column;
  background:#edf1f8;
}
.ml-reader.open{display:flex}
.ml-reader-header{
  min-height:62px;
  background:#fff;
  border-bottom:1px solid #dfe4ee;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 16px;
  box-shadow:0 4px 18px rgba(22,38,78,.08);
}
.ml-reader-back{
  border:0;
  background:#edf2ff;
  color:#214bc9;
  border-radius:10px;
  padding:9px 14px;
  font-weight:850;
  cursor:pointer;
}
.ml-reader-title{
  flex:1;
  min-width:0;
  text-align:center;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ml-reader-brand{font-size:13px;color:#66728a;font-weight:800}
.ml-reader-body{flex:1;min-height:0;padding:18px;overflow:hidden}
.ml-reader-frame{
  display:block;
  width:min(100%,980px);
  height:100%;
  margin:auto;
  border:0;
  background:#fff;
  box-shadow:0 12px 38px rgba(25,42,79,.15);
  border-radius:8px;
}
.ml-reader-loading{
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:14px;
}

@media(max-width:700px){
  #mlStudentPortal{border-radius:0}
  .ml-header{min-height:61px;padding:0 12px}
  .ml-brand{font-size:17px}
  .ml-brand-mark{width:32px;height:32px}
  .ml-auth-wrap{padding:28px 9px 50px}
  .ml-auth-content{padding:23px 17px}
  .ml-form-grid{grid-template-columns:1fr;gap:0}
  .ml-field.full{grid-column:auto}
  .ml-hero{margin:12px;padding:23px 20px}
  .ml-hero h1{font-size:27px}
  .ml-hero-art{display:none}
  .ml-books-card{margin:12px;padding:9px}
  .ml-table-header{display:none}
  .ml-book-row{
    grid-template-columns:60px minmax(0,1fr) auto;
    gap:10px;
    padding:13px 6px;
  }
  .ml-book-cover{grid-row:1/4}
  .ml-book-title-wrap{grid-column:2/4}
  .ml-book-row .ml-class,.ml-book-row .ml-subject{
    grid-column:2;
    font-size:13px;
  }
  .ml-book-row .ml-open-btn{
    grid-column:3;
    grid-row:2/4;
  }
  .ml-chapter-panel{padding:0 4px}
  .ml-chapter-panel.open{padding:7px 4px 14px}
  .ml-reader-header{padding:7px 9px}
  .ml-reader-brand{display:none}
  .ml-reader-title{font-size:14px}
  .ml-reader-body{padding:0}
  .ml-reader-frame{
    width:100%;
    height:100%;
    border-radius:0;
    box-shadow:none;
  }
}

/* ===== PDF DOWNLOAD + RESPONSIVE FIX (keeps original working portal startup) ===== */
#mlStudentPortal,
#mlStudentPortal button,
#mlStudentPortal input,
#mlStudentPortal h1,
#mlStudentPortal h2,
#mlStudentPortal p{
  font-family:"Tiro Bangla",Arial,sans-serif!important;
}

#mlStudentPortal{
  width:100%!important;
  max-width:100%!important;
}

.ml-books-card{
  width:calc(100% - 44px)!important;
  max-width:calc(100% - 44px)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  overflow:visible!important;
}

.ml-table-header,.ml-book-row{
  width:100%!important;
  min-width:0!important;
  grid-template-columns:64px minmax(0,1.75fr) minmax(75px,.55fr) minmax(100px,.72fr) minmax(135px,.78fr)!important;
  gap:12px!important;
}
.ml-table-header>*,.ml-book-row>*{min-width:0!important}
.ml-meta{overflow-wrap:anywhere}

.ml-chapter-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex:0 0 auto;
}
.ml-download-btn{
  min-height:43px;
  border:1px solid #b80f16!important;
  border-radius:13px!important;
  background:linear-gradient(135deg,#e11d2e,#b80f16)!important;
  color:#fff!important;
  padding:0 15px!important;
  font-family:"Tiro Bangla",Arial,sans-serif!important;
  font-weight:800!important;
  font-size:14px!important;
  cursor:pointer!important;
  white-space:nowrap!important;
  box-shadow:0 7px 16px rgba(190,15,22,.18)!important;
}
.ml-download-btn:hover{filter:brightness(.97)}
.ml-download-btn:disabled{opacity:.62;cursor:not-allowed!important}
.ml-outline-btn{white-space:nowrap!important}

@media(max-width:1080px){
  .ml-table-header{display:none!important}
  .ml-book-row{
    grid-template-columns:62px minmax(0,1fr) minmax(135px,auto)!important;
    gap:10px!important;
    align-items:center!important;
  }
  .ml-book-cover{grid-row:1/4}
  .ml-book-title-wrap{grid-column:2/4!important}
  .ml-book-row .ml-class,.ml-book-row .ml-subject{grid-column:2!important}
  .ml-book-row .ml-open-btn{
    grid-column:3!important;
    grid-row:2/4!important;
    min-width:0!important;
    width:100%!important;
    align-self:center!important;
  }
  .ml-chapter-panel{padding-left:12px!important}
  .ml-chapter-panel.open{padding-left:12px!important}
}

@media(max-width:700px){
  .ml-books-card{
    width:calc(100% - 16px)!important;
    max-width:calc(100% - 16px)!important;
    margin:10px auto!important;
  }
  .ml-book-row{
    grid-template-columns:56px minmax(0,1fr)!important;
    gap:8px!important;
    padding:11px 5px!important;
  }
  .ml-book-cover{grid-row:1/5!important;width:48px!important;height:68px!important}
  .ml-book-title-wrap{grid-column:2!important}
  .ml-book-row .ml-class,.ml-book-row .ml-subject{grid-column:2!important;font-size:13px!important}
  .ml-book-row .ml-open-btn{
    grid-column:2!important;
    grid-row:auto!important;
    min-width:0!important;
    width:100%!important;
    min-height:40px!important;
    margin-top:3px!important;
  }
  .ml-chapter-panel{padding:0 3px!important}
  .ml-chapter-panel.open{padding:6px 3px 12px!important}
  .ml-chapter-row{display:block!important;padding:11px!important}
  .ml-chapter-name{margin-bottom:9px!important}
  .ml-chapter-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    width:100%!important;
    gap:7px!important;
  }
  .ml-chapter-actions button{
    min-width:0!important;
    width:100%!important;
    padding-left:8px!important;
    padding-right:8px!important;
    font-size:13px!important;
  }
}

/* WordPress live-page safety */
#mlStudentPortal{
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
}
#mlStudentPortal img,
#mlStudentPortal iframe{
  max-width:100%!important;
}


/* ===== v1.1 form clarity ===== */
#mlStudentPortal .ml-input{
  color:#111827!important;
  caret-color:#2457ee!important;
  -webkit-text-fill-color:#111827!important;
}
#mlStudentPortal .ml-input::placeholder{
  color:#98a2b3!important;
  -webkit-text-fill-color:#98a2b3!important;
  opacity:1!important;
  font-weight:400!important;
}
#mlStudentPortal .ml-input:focus::placeholder,
#mlStudentPortal .ml-input:hover::placeholder{
  color:#98a2b3!important;
  -webkit-text-fill-color:#98a2b3!important;
  opacity:1!important;
}
#mlStudentPortal .ml-input:-webkit-autofill,
#mlStudentPortal .ml-input:-webkit-autofill:hover,
#mlStudentPortal .ml-input:-webkit-autofill:focus{
  -webkit-text-fill-color:#111827!important;
  transition:background-color 99999s ease-out 0s;
}

#mlStudentPortal .ml-password-toggle{
  width:52px!important;
  min-width:52px!important;
  height:54px!important;
  flex:0 0 52px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  border-left:1px solid #e8edf5!important;
  border-radius:0!important;
  margin:0!important;
  padding:0!important;
  background:#f9fbff!important;
  color:#526078!important;
  cursor:pointer!important;
  box-shadow:none!important;
  outline:0!important;
  line-height:1!important;
}
#mlStudentPortal .ml-input-wrap:focus-within .ml-password-toggle{
  background:#fff!important;
}
#mlStudentPortal .ml-password-toggle:hover{
  background:#eef3ff!important;
  color:#2457ee!important;
}
#mlStudentPortal .ml-password-toggle:focus-visible{
  box-shadow:inset 0 0 0 2px #7895ff!important;
}
#mlStudentPortal .ml-password-toggle svg{
  width:22px!important;
  height:22px!important;
  display:block!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  pointer-events:none!important;
}

/* ===== v1.1 PDF download button ===== */
#mlStudentPortal .ml-download-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  min-width:148px!important;
  position:relative!important;
}
#mlStudentPortal .ml-download-icon{
  width:20px!important;
  height:20px!important;
  flex:0 0 20px!important;
  display:inline-grid!important;
  place-items:center!important;
}
#mlStudentPortal .ml-download-icon svg{
  width:20px!important;
  height:20px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
#mlStudentPortal .ml-download-label{
  line-height:1.1!important;
}
#mlStudentPortal .ml-download-spinner{
  width:15px!important;
  height:15px!important;
  flex:0 0 15px!important;
  border:2px solid rgba(255,255,255,.42)!important;
  border-top-color:#fff!important;
  border-radius:50%!important;
  animation:mlPdfSpin .75s linear infinite!important;
}
#mlStudentPortal .ml-download-btn.is-loading .ml-download-icon{
  animation:mlDownloadPulse .85s ease-in-out infinite alternate!important;
}
@keyframes mlPdfSpin{to{transform:rotate(360deg)}}
@keyframes mlDownloadPulse{
  from{transform:translateY(-1px);opacity:.75}
  to{transform:translateY(2px);opacity:1}
}
@media(max-width:700px){
  #mlStudentPortal .ml-download-btn{
    min-width:0!important;
  }
  #mlStudentPortal .ml-download-label{
    white-space:nowrap!important;
  }
}
