/* JobLik 0.33.391
   STRICT SCOPE: Smart Card creation/edit wizard only.
   No public-card, homepage, automotive, construction or global UI rules.
*/

/* -------- Issue 1: Intro sample preview --------
   0.33.392: keep the complete 793x1983 reference card visible inside the phone viewport.
   No crop, no zoom, no geometry change outside the intro preview. */
body.smart-card-wizard-focus .scw-intro-preview-stage{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  min-height:0!important;
  height:calc(100dvh - 154px)!important;
  max-height:calc(100dvh - 154px)!important;
  padding:8px 10px!important;
  box-sizing:border-box!important;
}
body.smart-card-wizard-focus .scw-intro-card-frame{
  width:100%!important;
  max-width:360px!important;
  height:100%!important;
  max-height:100%!important;
  min-height:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  margin:0 auto!important;
  padding:0!important;
  box-sizing:border-box!important;
}
body.smart-card-wizard-focus .scw-intro-card-frame>img{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center center!important;
  margin:auto!important;
  padding:0!important;
  transform:none!important;
}

/* 0.33.392: the public site footer must not appear inside the card wizard.
   This only affects pages carrying the wizard-specific body class. */
body.smart-card-wizard-focus .v064-footer{
  display:none!important;
}

/* -------- Issue 2: Bottom wizard action bar on mobile -------- */
@media (max-width:699px){
  body.smart-card-wizard-focus .scw-actions{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    z-index:100!important;
    width:100%!important;
    height:auto!important;
    min-height:70px!important;
    box-sizing:border-box!important;
    padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important;
    display:grid!important;
    grid-template-columns:minmax(92px,1.45fr) minmax(58px,.78fr) minmax(58px,.78fr) minmax(96px,1.25fr)!important;
    grid-template-areas:"next close help prev"!important;
    gap:7px!important;
    align-items:stretch!important;
    direction:ltr!important;
    background:#fff!important;
    border-top:1px solid #dfe6ee!important;
    box-shadow:0 -7px 20px rgba(17,39,67,.10)!important;
  }

  body.smart-card-wizard-focus .scw-actions>.secondary[data-prev]{
    grid-area:prev!important;
  }

  body.smart-card-wizard-focus .scw-action-center,
  body.smart-card-wizard-focus .scw-action-next{
    display:contents!important;
  }

  body.smart-card-wizard-focus .scw-actions .scw-help-button{
    grid-area:help!important;
  }

  body.smart-card-wizard-focus .scw-actions [data-safe-exit]{
    grid-area:close!important;
  }

  body.smart-card-wizard-focus .scw-actions [data-next],
  body.smart-card-wizard-focus .scw-actions [data-final-submit]{
    grid-area:next!important;
  }

  body.smart-card-wizard-focus .scw-actions button{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    height:50px!important;
    min-height:50px!important;
    max-height:50px!important;
    margin:0!important;
    padding:0 8px!important;
    border-radius:12px!important;
    font-family:Vazirmatn,Tahoma,sans-serif!important;
    font-size:12px!important;
    font-weight:900!important;
    line-height:1.35!important;
    text-align:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    direction:rtl!important;
  }

  body.smart-card-wizard-focus .scw-actions>.secondary[data-prev],
  body.smart-card-wizard-focus .scw-actions .scw-help-button,
  body.smart-card-wizard-focus .scw-actions [data-safe-exit]{
    border:1px solid #d6dde6!important;
    background:#fff!important;
    color:#10243f!important;
  }

  body.smart-card-wizard-focus .scw-actions [data-next],
  body.smart-card-wizard-focus .scw-actions [data-final-submit]{
    border:1px solid #ff7900!important;
    background:#ff7900!important;
    color:#fff!important;
  }

  body.smart-card-wizard-focus .scw-actions button:disabled{
    opacity:.48!important;
  }

  body.smart-card-wizard-focus .scw-actions [data-mobile-stage-label]{
    display:none!important;
  }

  /* Leave sufficient content space above the fixed action bar. */
  body.smart-card-wizard-focus .scw-stage-scroll{
    padding-bottom:92px!important;
  }
}

@media (max-width:390px){
  body.smart-card-wizard-focus .scw-actions{
    grid-template-columns:minmax(86px,1.35fr) minmax(54px,.72fr) minmax(54px,.72fr) minmax(88px,1.18fr)!important;
    gap:6px!important;
    padding-inline:8px!important;
  }
  body.smart-card-wizard-focus .scw-actions button{
    font-size:11px!important;
    padding-inline:5px!important;
  }
}


/* =========================================================
   JobLik 0.33.393 — MOBILE WIZARD ONLY
   Fix ONLY:
   1) intro sample card full-fit geometry
   2) stray JobLik/global branding below wizard action bar
   No action-bar geometry changes.
   ========================================================= */
@media (max-width:699px){

  /* The preview overlay itself keeps the original 3-row structure.
     The center stage gets a strict finite viewport. */
  body.smart-card-wizard-focus [data-simple-card-wizard] .scw-intro-preview{
    height:100dvh!important;
    max-height:100dvh!important;
    overflow:hidden!important;
    grid-template-rows:64px minmax(0,1fr) 78px!important;
  }

  body.smart-card-wizard-focus [data-simple-card-wizard] .scw-intro-preview-stage{
    position:relative!important;
    min-width:0!important;
    min-height:0!important;
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    padding:8px 10px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  /* Reference image is 793x1983.
     Frame itself uses exactly that aspect ratio and is bounded by BOTH
     available height and mobile width, preventing any zoom/crop. */
  body.smart-card-wizard-focus [data-simple-card-wizard] .scw-intro-card-frame{
    position:relative!important;
    inset:auto!important;
    flex:0 1 auto!important;
    width:auto!important;
    height:auto!important;
    aspect-ratio:793 / 1983!important;
    max-width:calc(100vw - 28px)!important;
    max-height:calc(100dvh - 164px)!important;
    min-width:0!important;
    min-height:0!important;
    margin:auto!important;
    padding:0!important;
    display:block!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  body.smart-card-wizard-focus [data-simple-card-wizard] .scw-intro-card-frame>img,
  body.smart-card-wizard-focus [data-simple-card-wizard] .scw-intro-card-frame img{
    position:static!important;
    inset:auto!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    max-width:100%!important;
    max-height:100%!important;
    margin:0!important;
    padding:0!important;
    object-fit:contain!important;
    object-position:center center!important;
    transform:none!important;
    border:0!important;
    border-radius:10px!important;
    box-shadow:0 5px 18px rgba(6,27,54,.14)!important;
  }

  /* If width is the limiting dimension, derive height from the real ratio. */
  @supports (height:min(1px,2px)){
    body.smart-card-wizard-focus [data-simple-card-wizard] .scw-intro-card-frame{
      width:min(calc(100vw - 28px), calc((100dvh - 164px) * 793 / 1983))!important;
      height:auto!important;
    }
  }

  /* Wizard pages are standalone. Suppress only known global JobLik branding
     shells if a legacy layout accidentally renders them around the wizard.
     Does NOT target images inside the wizard or the sample card. */
  body.smart-card-wizard-focus > .v064-header,
  body.smart-card-wizard-focus > .v064-footer,
  body.smart-card-wizard-focus .v064-footer,
  body.smart-card-wizard-focus .joblik-footer-brand,
  body.smart-card-wizard-focus .joblik-smartcard-footer-logo-link,
  body.smart-card-wizard-focus .joblik-smartcard-footer-logo,
  body.smart-card-wizard-focus > .joblik-public-brand{
    display:none!important;
  }
}

/* =========================================================
   JobLik 0.33.394 — WIZARD BOTTOM LOGO ONLY
   Exact regression fix:
   layout.php can render .joblik-smart-card-footer-logo-v347
   for Smart Card experience pages. Hide that element only while
   the Smart Card wizard body scope is active.
   No other wizard/page geometry is changed.
   ========================================================= */
body.smart-card-wizard-focus .joblik-smart-card-footer-logo-v347{
  display:none!important;
}

