/* Pelk FaceFit v5.6.2 — fixed camera frame + readable text */
#pelk-facefit-root{
  display:none;
  position:fixed !important;
  inset:0 !important;
  z-index:2147483000 !important;
  width:100% !important;
  height:100% !important;
  font-family:Tahoma, Vazirmatn, "IRANSans", "Segoe UI", sans-serif !important;
  direction:rtl !important;
}

.pelk-facefit,
.pelk-facefit-ready,
[data-pelk-facefit-trigger]{cursor:pointer !important}
.pelk-facefit img,
.pelk-facefit-ready img{cursor:pointer !important}

#pelk-facefit-root,
#pelk-facefit-root *{box-sizing:border-box !important}
#pelk-facefit-root button,
#pelk-facefit-root input,
#pelk-facefit-root select,
#pelk-facefit-root textarea{
  font:inherit !important;
  text-transform:none !important;
  letter-spacing:normal !important;
  box-shadow:none !important;
  text-shadow:none !important;
  appearance:none !important;
  -webkit-appearance:none !important;
}

.pelkff-backdrop{
  position:fixed !important;
  inset:0 !important;
  background:rgba(10,12,18,.72) !important;
  backdrop-filter:blur(4px);
  z-index:1 !important;
}

.pelkff-modal{
  position:fixed !important;
  left:50% !important;
  right:auto !important;
  top:50% !important;
  bottom:auto !important;
  transform:translate(-50%,-50%) !important;
  width:min(94vw,640px) !important;
  max-height:min(92vh,860px) !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
  z-index:2 !important;
  background:#f4f6fb !important;
  color:#152033 !important;
  border:1px solid #d7deea !important;
  border-radius:18px !important;
  box-shadow:0 24px 80px rgba(0,0,0,.35) !important;
}

.pelkff-head{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:12px !important;
  padding:14px 16px 8px !important;
  background:#ffffff !important;
  border-bottom:1px solid #e4ebf5 !important;
  flex:0 0 auto !important;
}
.pelkff-kicker{font-size:.72rem !important; color:#5b6b85 !important; margin-bottom:2px !important}
.pelkff-title{font-weight:800 !important; font-size:1.05rem !important; color:#101828 !important; line-height:1.4 !important}
.pelkff-close{
  background:#eef2f8 !important; border:1px solid #d5deea !important; color:#243247 !important;
  padding:8px 12px !important; border-radius:10px !important; cursor:pointer !important; flex:0 0 auto !important;
}

.pelkff-progress{
  display:flex !important; gap:6px !important; padding:10px 16px !important;
  background:#fff !important; flex:0 0 auto !important;
}
.pelkff-progress span{flex:1 !important; height:4px !important; border-radius:99px !important; background:#d9e2ef !important}
.pelkff-progress span.is-done{background:#9db0cc !important}
.pelkff-progress span.is-active{background:var(--pelk-ff-theme,#ff1e56) !important}

.pelkff-body{
  padding:12px 16px 8px !important;
  overflow:auto !important;
  flex:1 1 auto !important;
  min-height:0 !important;
  background:#f4f6fb !important;
  color:#152033 !important;
  -webkit-overflow-scrolling:touch !important;
}
.pelkff-step{display:none !important}
.pelkff-step.is-active{display:block !important; animation:pelkffIn .25s ease}
@keyframes pelkffIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.pelkff-hero-card{
  background:#ffffff !important; border:1px solid #d9e3f0 !important; border-radius:16px !important;
  padding:18px 16px !important; color:#152033 !important;
}
.pelkff-hero-badge{
  display:inline-flex !important; align-items:center !important;
  background:#ffe5ec !important; color:#b00034 !important; border:1px solid #ffc2d1 !important;
  border-radius:999px !important; padding:5px 10px !important; font-size:.78rem !important;
  font-weight:700 !important; margin-bottom:12px !important;
}
.pelkff-hero-card h3{
  margin:0 0 8px !important; font-size:1.18rem !important; line-height:1.5 !important;
  font-weight:800 !important; color:#101828 !important;
}
.pelkff-hero-card p{
  margin:0 0 12px !important; color:#334155 !important; line-height:1.75 !important; font-size:.92rem !important;
}
.pelkff-bullets{
  margin:0 !important; padding-right:18px !important; padding-left:0 !important;
  color:#243247 !important; line-height:1.85 !important; font-size:.9rem !important;
}

.pelkff-qhead h3{
  margin:4px 0 6px !important; font-size:1.08rem !important; font-weight:800 !important; color:#101828 !important;
}
.pelkff-qhead p{
  margin:0 0 14px !important; color:#475569 !important; font-size:.88rem !important; line-height:1.65 !important;
}

.pelkff-options{display:grid !important; grid-template-columns:1fr 1fr !important; gap:10px !important}
.pelkff-option{
  text-align:right !important;
  background:#ffffff !important;
  border:1.5px solid #cfd9e8 !important;
  color:#152033 !important;
  border-radius:14px !important;
  padding:12px !important;
  cursor:pointer !important;
  width:100% !important;
  min-height:64px !important;
}
.pelkff-option:hover{
  border-color:#9db0cc !important;
  background:#f8fbff !important;
}
.pelkff-option.is-selected{
  border-color:var(--pelk-ff-theme,#ff1e56) !important;
  background:#fff1f5 !important;
  box-shadow:inset 0 0 0 1px rgba(255,30,86,.25) !important;
}
.pelkff-option strong{
  display:block !important; font-size:.92rem !important; margin-bottom:4px !important;
  color:#101828 !important; font-weight:800 !important;
}
.pelkff-option span{
  display:block !important; font-size:.78rem !important; color:#52627a !important; opacity:1 !important;
}

.pelkff-status{
  font-size:.92rem !important; color:#1f2937 !important; margin-bottom:8px !important;
  min-height:1.3em !important; font-weight:600 !important;
}
.pelkff-canvas-wrap{
  position:relative !important;
  background:#0b1220 !important;
  border-radius:14px !important;
  overflow:hidden !important;
  aspect-ratio:3 / 4 !important;
  border:1px solid #d5deea !important;
  width:min(100%, 420px) !important;
  max-width:100% !important;
  height:auto !important;
  margin:0 auto !important;
}
.pelkff-video,.pelkff-canvas{
  position:absolute !important; inset:0 !important; width:100% !important; height:100% !important;
}
.pelkff-video{object-fit:cover !important; object-position:center center !important}
.pelkff-scan-hint{
  position:absolute !important; left:50% !important; bottom:12px !important; transform:translateX(-50%) !important;
  background:rgba(255,255,255,.92) !important; color:#101828 !important; border:1px solid #d7deea !important;
  padding:6px 10px !important; border-radius:999px !important; font-size:.78rem !important;
  white-space:nowrap !important; pointer-events:none !important; font-weight:700 !important;
}
.pelkff-privacy{
  font-size:.84rem !important; color:#475569 !important; margin-top:8px !important; line-height:1.6 !important;
}

.pelkff-result-card{
  background:#ffffff !important; border:1px solid #d9e3f0 !important; border-radius:16px !important;
  padding:18px 16px !important; color:#152033 !important;
}
.pelkff-result-label{font-size:.78rem !important; color:#64748b !important; margin-bottom:6px !important}
.pelkff-result-shape{font-size:1.6rem !important; font-weight:800 !important; color:#101828 !important; margin-bottom:12px !important}
.pelkff-result-meta{display:flex !important; flex-wrap:wrap !important; gap:8px !important; margin-bottom:14px !important}
.pelkff-result-meta span{
  display:inline-flex !important; align-items:center !important; padding:6px 10px !important; border-radius:999px !important;
  background:#eef3fa !important; border:1px solid #d5deea !important; color:#243247 !important; font-size:.8rem !important;
}
.pelkff-result-tips{
  margin:0 !important; padding-right:18px !important; padding-left:0 !important;
  line-height:1.85 !important; color:#243247 !important; font-size:.9rem !important;
}

.pelkff-foot{
  display:flex !important; gap:8px !important; padding:12px 16px !important;
  border-top:1px solid #e4ebf5 !important; align-items:center !important; flex-wrap:wrap !important;
  background:#ffffff !important; flex:0 0 auto !important;
}
.pelkff-foot-spacer{flex:1 !important}

.pelkff-primary,
.pelkff-start,
.pelkff-goto{
  background:var(--pelk-ff-theme,#ff1e56) !important;
  border:0 !important;
  color:#ffffff !important;
  padding:11px 16px !important;
  border-radius:12px !important;
  cursor:pointer !important;
  font-weight:700 !important;
  min-height:44px !important;
}
.pelkff-primary[disabled],
.pelkff-start[disabled]{
  opacity:.45 !important; cursor:not-allowed !important; color:#fff !important;
}
.pelkff-secondary,
.pelkff-back,
.pelkff-close,
.pelkff-showall{
  background:#eef2f8 !important;
  border:1px solid #d5deea !important;
  color:#243247 !important;
  padding:10px 14px !important;
  border-radius:12px !important;
  cursor:pointer !important;
  font-weight:600 !important;
  min-height:44px !important;
}

.pelkff-choices{display:none; gap:8px; flex-wrap:wrap; align-items:center; margin-top:10px}
.pelkff-choices span{color:#334155 !important}
.pelkff-choice{
  background:#ffffff !important; border:1px solid #cfd9e8 !important; color:#152033 !important;
  padding:8px 12px !important; border-radius:10px !important; cursor:pointer !important; font-weight:700 !important;
}

.pelkff-debug{position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.55); z-index:2147483001; opacity:0; transition:opacity .35s ease}
.pelkff-debug-card{width:min(92vw,520px); background:#111827; color:#f8fafc; border:1px solid rgba(255,255,255,.12); border-radius:14px; padding:16px 18px; font:13px/1.45 Tahoma,sans-serif}
.pelkff-debug .title{font-weight:800;font-size:14px;margin-bottom:10px;color:#fff}
.pelkff-debug .tops{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px}
.pelkff-debug .top{background:#1f2937; border:1px solid rgba(255,255,255,.10); border-radius:12px; padding:10px 12px; text-align:center; color:#fff}
.pelkff-debug .top .label{display:block;font-weight:800;font-size:18px;margin-bottom:4px;color:#fff}
.pelkff-debug .top .pct{display:block;font-weight:700;color:#e5e7eb;font-size:14px}
.pelkff-debug table{width:100%;border-collapse:collapse;margin-top:6px;color:#e5e7eb}
.pelkff-debug td{padding:2px 6px;vertical-align:top;color:#e5e7eb}
.pelkff-debug .k{color:#cbd5e1}
.pelkff-debug .v{font-weight:600;color:#fff}

/* ========== MOBILE — must stay LAST so !important wins ========== */
@media (max-width:768px){
  #pelk-facefit-root.is-open,
  #pelk-facefit-root[style*="display: block"],
  #pelk-facefit-root[style*="display:block"]{
    width:100vw !important;
    height:100vh !important;
    height:100dvh !important;
  }

  #pelk-facefit-root .pelkff-modal{
    inset:0 !important;
    left:0 !important;
    right:0 !important;
    top:0 !important;
    bottom:0 !important;
    transform:none !important;
    width:100% !important;
    max-width:none !important;
    height:100% !important;
    max-height:none !important;
    border-radius:0 !important;
    border:0 !important;
    box-shadow:none !important;
  }

  #pelk-facefit-root .pelkff-head{
    padding:10px 12px 6px !important;
    padding-top:max(10px, env(safe-area-inset-top)) !important;
  }
  #pelk-facefit-root .pelkff-title{font-size:.98rem !important}
  #pelk-facefit-root .pelkff-kicker{display:none !important}
  #pelk-facefit-root .pelkff-progress{padding:6px 12px 8px !important}

  #pelk-facefit-root .pelkff-body{
    padding:8px 12px !important;
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow-y:auto !important;
  }

  #pelk-facefit-root .pelkff-hero-card{padding:14px 12px !important}
  #pelk-facefit-root .pelkff-hero-card h3{font-size:1.05rem !important}
  #pelk-facefit-root .pelkff-bullets{font-size:.86rem !important; line-height:1.7 !important}

  #pelk-facefit-root .pelkff-options{
    grid-template-columns:1fr !important;
    gap:8px !important;
  }
  #pelk-facefit-root .pelkff-option{
    min-height:54px !important;
    padding:10px 12px !important;
  }

  /* کادر دوربین: نسبت ثابت ۳:۴، وسط‌چین، بدون له شدن */
  #pelk-facefit-root .pelkff-canvas-wrap{
    aspect-ratio:3 / 4 !important;
    width:min(86vw, 340px) !important;
    max-width:86vw !important;
    height:auto !important;
    max-height:min(52vh, 420px) !important;
    max-height:min(52dvh, 420px) !important;
    margin:0 auto 8px !important;
  }
  #pelk-facefit-root .pelkff-scan-hint{font-size:.72rem !important; bottom:8px !important}
  #pelk-facefit-root .pelkff-privacy{font-size:.8rem !important; color:#475569 !important}

  #pelk-facefit-root .pelkff-foot{
    padding:10px 12px !important;
    padding-bottom:max(12px, env(safe-area-inset-bottom)) !important;
    gap:6px !important;
    position:sticky !important;
    bottom:0 !important;
  }
  #pelk-facefit-root .pelkff-foot-spacer{display:none !important}

  #pelk-facefit-root .pelkff-primary,
  #pelk-facefit-root .pelkff-start,
  #pelk-facefit-root .pelkff-goto,
  #pelk-facefit-root .pelkff-secondary,
  #pelk-facefit-root .pelkff-back,
  #pelk-facefit-root .pelkff-showall{
    flex:1 1 calc(50% - 6px) !important;
    min-height:46px !important;
    font-size:.9rem !important;
    padding:10px 12px !important;
  }

  #pelk-facefit-root .pelkff-result-shape{font-size:1.35rem !important}
  #pelk-facefit-root .pelkff-result-meta span{font-size:.76rem !important}
}

@media (max-width:380px){
  #pelk-facefit-root .pelkff-canvas-wrap{
    width:min(88vw, 300px) !important;
    max-height:min(48vh, 360px) !important;
    max-height:min(48dvh, 360px) !important;
  }
  #pelk-facefit-root .pelkff-primary,
  #pelk-facefit-root .pelkff-start,
  #pelk-facefit-root .pelkff-goto,
  #pelk-facefit-root .pelkff-secondary,
  #pelk-facefit-root .pelkff-back{
    flex:1 1 100% !important;
  }
}

/* ========== ضد متن سفید روی بک روشن (تم pelk-chrome) ========== */
html.pelk-chrome #pelk-facefit-root .pelkff-modal,
html.pelk-chrome #pelk-facefit-root .pelkff-modal *:not(.pelkff-primary):not(.pelkff-start):not(.pelkff-goto){
  -webkit-text-fill-color:unset !important;
  background-image:none !important;
}
html.pelk-chrome #pelk-facefit-root .pelkff-modal{
  color:#152033 !important;
  background:#f4f6fb !important;
}
html.pelk-chrome #pelk-facefit-root .pelkff-modal h1,
html.pelk-chrome #pelk-facefit-root .pelkff-modal h2,
html.pelk-chrome #pelk-facefit-root .pelkff-modal h3,
html.pelk-chrome #pelk-facefit-root .pelkff-modal h4,
html.pelk-chrome #pelk-facefit-root .pelkff-title,
html.pelk-chrome #pelk-facefit-root .pelkff-hero-card h3,
html.pelk-chrome #pelk-facefit-root .pelkff-qhead h3,
html.pelk-chrome #pelk-facefit-root .pelkff-result-shape{
  color:#101828 !important;
  -webkit-text-fill-color:#101828 !important;
  background:none !important;
}
html.pelk-chrome #pelk-facefit-root .pelkff-modal p,
html.pelk-chrome #pelk-facefit-root .pelkff-modal li,
html.pelk-chrome #pelk-facefit-root .pelkff-modal span,
html.pelk-chrome #pelk-facefit-root .pelkff-modal strong,
html.pelk-chrome #pelk-facefit-root .pelkff-status,
html.pelk-chrome #pelk-facefit-root .pelkff-privacy,
html.pelk-chrome #pelk-facefit-root .pelkff-kicker,
html.pelk-chrome #pelk-facefit-root .pelkff-option strong,
html.pelk-chrome #pelk-facefit-root .pelkff-option span{
  color:#243247 !important;
  -webkit-text-fill-color:#243247 !important;
}
html.pelk-chrome #pelk-facefit-root .pelkff-option span,
html.pelk-chrome #pelk-facefit-root .pelkff-kicker,
html.pelk-chrome #pelk-facefit-root .pelkff-privacy,
html.pelk-chrome #pelk-facefit-root .pelkff-result-label{
  color:#52627a !important;
  -webkit-text-fill-color:#52627a !important;
}
html.pelk-chrome #pelk-facefit-root .pelkff-close,
html.pelk-chrome #pelk-facefit-root .pelkff-back,
html.pelk-chrome #pelk-facefit-root .pelkff-secondary,
html.pelk-chrome #pelk-facefit-root .pelkff-showall,
html.pelk-chrome #pelk-facefit-root .pelkff-choice{
  color:#243247 !important;
  -webkit-text-fill-color:#243247 !important;
  background:#eef2f8 !important;
}
html.pelk-chrome #pelk-facefit-root .pelkff-primary,
html.pelk-chrome #pelk-facefit-root .pelkff-start,
html.pelk-chrome #pelk-facefit-root .pelkff-goto{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  background:var(--pelk-ff-theme,#ff1e56) !important;
}
html.pelk-chrome #pelk-facefit-root .pelkff-option{
  color:#152033 !important;
  background:#ffffff !important;
}
html.pelk-chrome #pelk-facefit-root .pelkff-option.is-selected{
  background:#fff1f5 !important;
}
