/* ============================================================
   SIMSAR AUTH MOBILE FORMS V21
   Presentation-only. Existing membership workflow/API unchanged.
   ============================================================ */

#sm18-overlay{
  --sm21-red:#e23628;
  --sm21-red-dark:#c92f23;
  --sm21-orange:#f58220;
  --sm21-ink:#172033;
  --sm21-text:#344054;
  --sm21-muted:#778397;
  --sm21-line:#e4e8ee;
  --sm21-soft:#f7f8fa;
  --sm21-card:#fff;
  --sm21-success:#147a54;
}

#sm18-overlay .sm18-card{
  overflow:hidden!important;
}

#sm18-overlay .sm18-body{
  overflow:auto!important;
  overscroll-behavior:contain;
}

#sm18-overlay .sm18-panel.active{
  animation:sm21PanelIn .16s ease-out both;
}

@keyframes sm21PanelIn{
  from{opacity:.45;transform:translateY(4px)}
  to{opacity:1;transform:none}
}

/* ---------------- Panel introduction ---------------- */

#sm18-overlay .sm21-panel-intro{
  grid-column:1/-1!important;
  margin:0 0 16px!important;
  padding:0!important;
  display:block!important;
}

#sm18-overlay .sm21-panel-intro strong{
  display:block!important;
  margin:0!important;
  color:var(--sm21-ink)!important;
  font-size:22px!important;
  line-height:1.2!important;
  font-weight:900!important;
  letter-spacing:-.025em!important;
}

#sm18-overlay .sm21-panel-intro p{
  margin:6px 0 0!important;
  color:var(--sm21-muted)!important;
  font-size:12.5px!important;
  line-height:1.55!important;
  font-weight:550!important;
}

/* ---------------- General fields ---------------- */

#sm18-overlay .sm18-field{
  position:relative!important;
  gap:7px!important;
}

#sm18-overlay .sm18-field label{
  color:var(--sm21-text)!important;
  font-size:12.5px!important;
  line-height:1.25!important;
  font-weight:850!important;
}

#sm18-overlay .sm18-field input:not([type="hidden"]),
#sm18-overlay .sm18-field select,
#sm18-overlay .sm18-field textarea{
  width:100%!important;
  min-width:0!important;
  min-height:50px!important;
  box-sizing:border-box!important;
  border:1px solid #d6dde7!important;
  border-radius:12px!important;
  background:#fff!important;
  color:var(--sm21-ink)!important;
  font-size:16px!important;
  font-weight:600!important;
  outline:0!important;
  box-shadow:0 1px 2px rgba(15,23,42,.02)!important;
  transition:border-color .14s ease,box-shadow .14s ease,background .14s ease!important;
}

#sm18-overlay .sm18-field input:not([type="hidden"]),
#sm18-overlay .sm18-field select{
  height:50px!important;
  padding-block:0!important;
  padding-inline:13px!important;
}

#sm18-overlay .sm18-field textarea{
  padding:12px 13px!important;
  min-height:100px!important;
  resize:vertical!important;
}

#sm18-overlay .sm18-field input:focus,
#sm18-overlay .sm18-field select:focus,
#sm18-overlay .sm18-field textarea:focus{
  border-color:#e98f87!important;
  box-shadow:0 0 0 3px rgba(226,54,40,.075)!important;
}

#sm18-overlay .sm18-field input::placeholder,
#sm18-overlay .sm18-field textarea::placeholder{
  color:#a0a9b7!important;
  opacity:1!important;
}

#sm18-overlay input[type="email"],
#sm18-overlay input[type="tel"],
#sm18-overlay input[name="identity"],
#sm18-overlay input[name="mobile"],
#sm18-overlay input[name="code"]{
  direction:ltr!important;
}

#sm18-overlay input[name="code"]{
  text-align:center!important;
  letter-spacing:.36em!important;
  font-size:21px!important;
  font-weight:900!important;
}

/* ---------------- Password toggle ---------------- */

#sm18-overlay .sm21-password-field input{
  padding-inline-end:54px!important;
}

#sm18-overlay .sm21-password-toggle{
  position:absolute!important;
  inset-inline-end:8px!important;
  bottom:7px!important;
  z-index:2!important;

  width:38px!important;
  height:36px!important;
  min-height:36px!important;
  padding:0!important;

  display:grid!important;
  place-items:center!important;

  border:0!important;
  border-radius:9px!important;
  background:#f5f7f9!important;
  color:#697586!important;
  cursor:pointer!important;
  box-shadow:none!important;
}

#sm18-overlay .sm21-password-toggle:hover{
  background:#eef1f4!important;
  color:var(--sm21-ink)!important;
}

#sm18-overlay .sm21-password-toggle svg{
  width:17px!important;
  height:17px!important;
}

/* ---------------- Alerts ---------------- */

#sm18-overlay #sm18-alert.sm18-alert{
  margin:0 0 13px!important;
  padding:10px 12px!important;
  border:1px solid transparent!important;
  border-radius:11px!important;
  font-size:12px!important;
  line-height:1.5!important;
}

#sm18-overlay #sm18-alert.sm18-alert.err{
  border-color:#f5c9c5!important;
  background:#fff5f4!important;
  color:#a72a22!important;
}

#sm18-overlay #sm18-alert.sm18-alert.ok{
  border-color:#cce8db!important;
  background:#f1faf6!important;
  color:#176b4b!important;
}

#sm18-overlay #sm18-alert.sm18-alert.info{
  border-color:#d5e4f7!important;
  background:#f4f8fe!important;
  color:#315f99!important;
}

/* ---------------- Login ---------------- */

#sm18-overlay .sm18-card[data-sm21-panel="login"]{
  width:min(480px,calc(100vw - 28px))!important;
}

#sm18-overlay #sm18-login-form{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:13px!important;
}

#sm18-overlay #sm18-login-form .sm18-field{
  grid-column:1!important;
}

#sm18-overlay #sm18-login-form .sm18-actions{
  width:100%!important;
  margin:3px 0 0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  align-items:stretch!important;
}

#sm18-overlay #sm18-login-form .sm18-actions .sm18-primary{
  order:0!important;
  width:100%!important;
  min-height:50px!important;
  border:0!important;
  border-radius:12px!important;
  background:var(--sm21-red)!important;
  color:#fff!important;
  font-size:14px!important;
  font-weight:900!important;
  box-shadow:0 8px 18px rgba(226,54,40,.18)!important;
}

#sm18-overlay #sm18-login-form .sm18-actions .sm18-primary:hover{
  background:var(--sm21-red-dark)!important;
}

#sm18-overlay #sm18-login-form .sm18-actions .sm18-secondary{
  order:1!important;
  width:100%!important;
  min-height:42px!important;
  border:0!important;
  background:transparent!important;
  color:#556276!important;
  box-shadow:none!important;
  font-size:12px!important;
  font-weight:800!important;
}

#sm18-overlay #sm18-login-form .sm18-actions .sm18-secondary:hover{
  color:var(--sm21-red)!important;
  background:#fff7f6!important;
}

#sm18-overlay .sm18-forgot-row{
  grid-column:1!important;
  width:100%!important;
  margin:-3px 0 0!important;
  display:flex!important;
  justify-content:flex-end!important;
}

html[dir="rtl"] #sm18-overlay .sm18-forgot-row{
  justify-content:flex-start!important;
}

#sm18-overlay .sm18-forgot-row .sm18-link-btn{
  min-height:34px!important;
  padding:4px 2px!important;
  border:0!important;
  background:transparent!important;
  color:var(--sm21-red)!important;
  font-size:11.5px!important;
  font-weight:850!important;
  cursor:pointer!important;
}

/* ---------------- Register ---------------- */

#sm18-overlay #sm18-register-form{
  align-items:start!important;
}

#sm18-overlay #sm18-register-form .sm21-register-divider{
  grid-column:1/-1!important;
  margin:2px 0 -3px!important;
  padding-top:12px!important;
  border-top:1px solid var(--sm21-line)!important;
  color:#8b95a5!important;
  font-size:10px!important;
  line-height:1.2!important;
  font-weight:850!important;
  letter-spacing:.06em!important;
  text-transform:uppercase!important;
}

#sm18-overlay #sm18-register-form .sm18-actions{
  grid-column:1/-1!important;
  margin-top:2px!important;
}

#sm18-overlay #sm18-register-form .sm18-actions .sm18-primary{
  width:100%!important;
  min-height:50px!important;
  border:0!important;
  border-radius:12px!important;
  background:var(--sm21-red)!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:900!important;
  box-shadow:0 8px 18px rgba(226,54,40,.15)!important;
}

#sm18-overlay #sm18-register-form .sm20-trust{
  border-radius:11px!important;
  background:#f8fafb!important;
  border-color:#e6eaf0!important;
}

/* ---------------- OTP / password reset ---------------- */

#sm18-overlay [data-panel-id="otp"] .sm18-grid,
#sm18-overlay [data-panel-id="forgot-password"] .sm18-grid,
#sm18-overlay [data-panel-id="reset-otp"] .sm18-grid,
#sm18-overlay [data-panel-id="new-password"] .sm18-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:13px!important;
}

#sm18-overlay [data-panel-id="otp"] .sm18-actions,
#sm18-overlay [data-panel-id="forgot-password"] .sm18-reset-actions,
#sm18-overlay [data-panel-id="reset-otp"] .sm18-reset-actions,
#sm18-overlay [data-panel-id="new-password"] .sm18-reset-actions{
  grid-column:1!important;
  width:100%!important;
  margin:2px 0 0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  align-items:stretch!important;
}

#sm18-overlay [data-panel-id="otp"] .sm18-primary,
#sm18-overlay [data-panel-id="forgot-password"] .sm18-primary,
#sm18-overlay [data-panel-id="reset-otp"] .sm18-primary,
#sm18-overlay [data-panel-id="new-password"] .sm18-primary{
  width:100%!important;
  min-height:50px!important;
  border-radius:12px!important;
  background:var(--sm21-red)!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:900!important;
}

#sm18-overlay [data-panel-id="otp"] .sm18-secondary,
#sm18-overlay [data-panel-id="forgot-password"] .sm18-secondary,
#sm18-overlay [data-panel-id="reset-otp"] .sm18-secondary,
#sm18-overlay [data-panel-id="new-password"] .sm18-secondary{
  width:100%!important;
  min-height:42px!important;
  border:0!important;
  background:transparent!important;
  color:#5f6c80!important;
  font-size:11.5px!important;
  box-shadow:none!important;
}

#sm18-overlay .sm18-reset-intro{
  display:none!important;
}

/* ---------------- Tabs ---------------- */

#sm18-overlay .sm18-tabs{
  border:1px solid #edf0f4!important;
  background:#f6f7f9!important;
  box-shadow:none!important;
}

#sm18-overlay .sm18-tab{
  min-height:42px!important;
  border-radius:10px!important;
  font-size:11.5px!important;
  font-weight:850!important;
}

#sm18-overlay .sm18-tab.active{
  background:#fff!important;
  color:var(--sm21-red)!important;
  box-shadow:0 3px 10px rgba(15,23,42,.06)!important;
}

/* ============================================================
   MOBILE AUTH EXPERIENCE
   ============================================================ */

@media(max-width:640px){

  #sm18-overlay.sm18-overlay{
    padding:0!important;
    align-items:stretch!important;
    justify-content:stretch!important;
    background:#fff!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }

  #sm18-overlay .sm18-card,
  #sm18-overlay .sm18-card[data-sm14-panel],
  #sm18-overlay .sm18-card[data-sm20-panel],
  #sm18-overlay .sm18-card[data-sm21-panel]{
    width:100%!important;
    max-width:100%!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
    background:#fff!important;
    box-shadow:none!important;
    display:flex!important;
    flex-direction:column!important;
  }

  #sm18-overlay .sm18-head{
    position:relative!important;
    top:auto!important;
    flex:0 0 auto!important;
    min-height:72px!important;
    padding:
      calc(12px + env(safe-area-inset-top,0px))
      16px
      10px!important;
    border-bottom:1px solid #eef1f4!important;
    background:#fff!important;
  }

  #sm18-overlay .sm14-brand{
    gap:10px!important;
  }

  #sm18-overlay .sm14-logo{
    width:40px!important;
    height:40px!important;
    flex-basis:40px!important;
    padding:4px!important;
    border-radius:11px!important;
  }

  #sm18-overlay .sm18-head h3{
    margin:0!important;
    font-size:17px!important;
    line-height:1.15!important;
    letter-spacing:-.015em!important;
  }

  #sm18-overlay .sm14-subtitle{
    display:block!important;
    max-width:230px!important;
    margin-top:3px!important;
    font-size:9.5px!important;
    line-height:1.25!important;
    color:#8a94a4!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  #sm18-overlay .sm18-close{
    width:38px!important;
    height:38px!important;
    flex-basis:38px!important;
    border-radius:11px!important;
    background:#f6f7f9!important;
    color:#556276!important;
    font-size:23px!important;
  }

  #sm18-overlay .sm18-body{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:
      12px
      16px
      calc(22px + env(safe-area-inset-bottom,0px))!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  #sm18-overlay .sm18-tabs{
    position:sticky!important;
    top:0!important;
    z-index:4!important;
    margin:0 0 17px!important;
    padding:4px!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:4px!important;
    border-radius:13px!important;
    background:#f5f6f8!important;
  }

  #sm18-overlay .sm18-tab[data-panel="plans"],
  #sm18-overlay .sm18-tab[data-panel="account"]{
    display:none!important;
  }

  #sm18-overlay .sm18-card[data-sm21-panel="account"] .sm18-tabs,
  #sm18-overlay .sm18-card[data-sm21-panel="plans"] .sm18-tabs,
  #sm18-overlay .sm18-card[data-sm21-panel="otp"] .sm18-tabs,
  #sm18-overlay .sm18-card[data-sm21-panel="forgot-password"] .sm18-tabs,
  #sm18-overlay .sm18-card[data-sm21-panel="reset-otp"] .sm18-tabs,
  #sm18-overlay .sm18-card[data-sm21-panel="new-password"] .sm18-tabs{
    display:none!important;
  }

  #sm18-overlay .sm18-tab{
    min-width:0!important;
    width:100%!important;
    height:42px!important;
    min-height:42px!important;
    padding:0 8px!important;
    font-size:11px!important;
  }

  #sm18-overlay .sm21-panel-intro{
    margin-bottom:18px!important;
  }

  #sm18-overlay .sm21-panel-intro strong{
    font-size:23px!important;
  }

  #sm18-overlay .sm21-panel-intro p{
    max-width:330px!important;
    font-size:12px!important;
  }

  #sm18-overlay .sm18-grid,
  #sm18-overlay #sm18-register-form{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  #sm18-overlay #sm18-register-form .sm18-field,
  #sm18-overlay #sm18-register-form .sm18-actions,
  #sm18-overlay #sm18-register-form .sm20-trust,
  #sm18-overlay #sm18-register-form .sm20-form-error,
  #sm18-overlay #sm18-register-form .sm21-register-divider{
    grid-column:1!important;
  }

  #sm18-overlay #sm18-register-form .sm20-phone-row{
    grid-template-columns:112px minmax(0,1fr)!important;
    gap:7px!important;
  }

  #sm18-overlay #sm18-register-form .sm20-country-wrap,
  #sm18-overlay #sm18-register-form .sm20-local-wrap{
    min-width:0!important;
  }

  #sm18-overlay .sm18-field input:not([type="hidden"]),
  #sm18-overlay .sm18-field select{
    height:50px!important;
    min-height:50px!important;
    font-size:16px!important;
  }

  #sm18-overlay #sm18-login-form{
    gap:13px!important;
  }

  #sm18-overlay #sm18-login-form .sm18-actions{
    margin-top:4px!important;
  }

  #sm18-overlay #sm18-alert.sm18-alert.show{
    position:relative!important;
    margin-bottom:12px!important;
  }

  #sm18-overlay .sm18-note{
    font-size:10.5px!important;
    line-height:1.5!important;
  }
}

@media(max-width:360px){
  #sm18-overlay .sm18-body{
    padding-inline:13px!important;
  }

  #sm18-overlay #sm18-register-form .sm20-phone-row{
    grid-template-columns:100px minmax(0,1fr)!important;
  }

  #sm18-overlay .sm21-panel-intro strong{
    font-size:21px!important;
  }
}
