/* ═══════════════════════════════════════════════════════════════════
   CAELESTIA NOVA — گیت فعال‌سازی «دروازهٔ ستاره» — v5.0
   پوستهٔ اورجینال کائلستیا برای صفحهٔ فعال‌سازی (کلاس‌های dfter-*
   قلاب JS هستند؛ همهٔ ظاهر از نو نوشته شده است).
   ───────────────────────────────────────────────────────────────────
   رنگ برند: --gt-a1/--gt-a2 از موتور تم (theme-core.js)
   سخت‌سازی iOS: بدون background-attachment — بدون color-mix
   ═══════════════════════════════════════════════════════════════════ */

html.dfter-gate, html.dfter-gate body{
  min-height:100vh; min-height:var(--vvh,100vh);
}
/* r20.4: گارد «:not(.dfter-granted)» — بعد از فعال‌سازی، بدنه باید از موتور تم
   خود برنامه (nova.css → var(--cx-ink)) پیروی کند. بدون این گارد، رنگ سفیدِ
   #EAEEFFِ گیت برای همیشه روی کل برنامه می‌ماند و در تم روشن (سپیده)
   متن‌ها سفید روی زمینهٔ روشن دیده می‌شدند — مثل اپ اصلی (gate.css). */
html.dfter-gate:not(.dfter-granted) body{
  margin:0;
  background:#060917;
  font-family:"Vazirmatn","Segoe UI","SF Arabic","Geeza Pro",Tahoma,Arial,sans-serif;
  color:#EAEEFF;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
html.dfter-gate:not(.dfter-granted)[data-gtm="light"] body{background:#EDF2FC;color:#18203E;}

/* دروازهٔ ستاره */
#dfterGate.dfter-gate-overlay{
  position:fixed; top:0; left:0; right:0; bottom:0; z-index:9999;
  display:flex; align-items:center; justify-content:center;
  padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px));
  overflow-y:auto;
  background:
    radial-gradient(52% 38% at 82% -6%, rgba(45,212,191,.17) 0%, transparent 60%),
    radial-gradient(56% 42% at 12% 10%, rgba(139,124,246,.20) 0%, transparent 62%),
    radial-gradient(70% 46% at 50% 114%, rgba(91,141,239,.15) 0%, transparent 64%),
    linear-gradient(178deg,#060917 0%,#0C1230 56%,#05070F 100%);
}
html.dfter-gate[data-gtm="light"] #dfterGate.dfter-gate-overlay{
  background:
    radial-gradient(52% 38% at 82% -6%, rgba(14,165,168,.20) 0%, transparent 60%),
    radial-gradient(56% 42% at 12% 10%, rgba(109,90,230,.18) 0%, transparent 62%),
    radial-gradient(70% 46% at 50% 114%, rgba(94,234,212,.16) 0%, transparent 64%),
    linear-gradient(178deg,#EDF2FC 0%,#E2EAFB 58%,#DCE6FA 100%);
}
/* r20.4: رنگ متن اورلی صریح شد — چون بعد از grant بدنه دیگر سفید نیست؛
   اورلی قفل (دسترسی متوقف شد) ممکن است بعد از grant باز شود */
#dfterGate.dfter-gate-overlay{ color:#EAEEFF; }
html.dfter-gate[data-gtm="light"] #dfterGate.dfter-gate-overlay{ color:#18203E; }

/* سیاره‌های پس‌زمینه */
.dfter-gate-blob{position:fixed;border-radius:50%;pointer-events:none;transform:translateZ(0);}
.dfter-b1{
  width:340px;height:340px; left:-120px; bottom:-130px;
  background:radial-gradient(circle at 32% 30%, rgba(45,212,191,.28), rgba(45,212,191,.05) 58%, transparent 72%);
}
.dfter-b2{
  width:280px;height:280px; right:-90px; top:-80px;
  background:radial-gradient(circle at 60% 62%, rgba(139,124,246,.30), rgba(139,124,246,.05) 58%, transparent 72%);
}

/* کارت دروازه */
.dfter-gate-card{
  position:relative; z-index:2;
  width:100%; max-width:392px;
  border-radius:28px;
  padding:30px 26px 24px;
  background:rgba(15,21,44,.72);
  border:1px solid rgba(190,200,255,.2);
  box-shadow:0 30px 80px rgba(2,4,14,.55), inset 0 1px 0 rgba(255,255,255,.09);
  -webkit-backdrop-filter:blur(26px) saturate(1.5);
  backdrop-filter:blur(26px) saturate(1.5);
  animation:cxGateIn .5s cubic-bezier(.32,.9,.28,1);
}
html.dfter-gate[data-gtm="light"] .dfter-gate-card{
  background:rgba(255,255,255,.82);
  border-color:rgba(35,45,90,.14);
  box-shadow:0 30px 80px rgba(30,40,90,.18);
}
@keyframes cxGateIn{from{opacity:0;transform:translateY(18px) scale(.97);}to{opacity:1;transform:none;}}

/* نشان مداری (لوگو) */
.dfter-gate-logo{
  width:74px;height:74px;margin:0 auto 14px;
  border-radius:24px;
  display:flex;align-items:center;justify-content:center;
  font-size:31px;
  position:relative;
  background:
    radial-gradient(120% 120% at 22% 14%, rgba(255,255,255,.4) 0%, transparent 46%),
    linear-gradient(135deg, var(--gt-a1,#2DD4BF), var(--gt-a2,#8B7CF6));
  color:#fff;
  box-shadow:0 14px 34px rgba(91,123,233,.4), inset 0 1px 0 rgba(255,255,255,.4);
}
.dfter-gate-logo::before{
  content:""; position:absolute; inset:-13px;
  border-radius:34px;
  border:1.5px dashed rgba(190,200,255,.4);
  transform:rotate(-8deg);
}
html.dfter-gate[data-gtm="light"] .dfter-gate-logo::before{border-color:rgba(35,45,90,.28);}

.dfter-gate-card h1{
  margin:0 0 6px; text-align:center;
  font-size:21px; font-weight:900; letter-spacing:.2px; line-height:1.7;
}
.dfter-gate-sub{
  margin:0 0 18px; text-align:center;
  font-size:12px; font-weight:600; line-height:2.1;
  color:rgba(234,238,255,.62);
}
html.dfter-gate[data-gtm="light"] .dfter-gate-sub{color:rgba(24,32,62,.6);}

/* فیلدها */
.dfter-field{display:flex;flex-direction:column;gap:6px;margin:0 0 13px;}
.dfter-field > span:first-child{
  font-size:11px; font-weight:800; color:rgba(234,238,255,.68);
  display:flex;align-items:center;gap:6px;
}
html.dfter-gate[data-gtm="light"] .dfter-field > span:first-child{color:rgba(24,32,62,.65);}
.dfter-field > span:first-child::before{
  content:""; width:5px;height:5px;border-radius:50%;
  background:linear-gradient(135deg,var(--gt-a1,#2DD4BF),var(--gt-a2,#8B7CF6));
}
.dfter-field input{
  width:100%;
  border:1.5px solid rgba(190,200,255,.24);
  background:rgba(8,12,28,.55);
  border-radius:14px;
  padding:12px 14px;
  font-size:14.5px; font-weight:700; line-height:1.8;
  color:inherit;
  transition:border-color .22s, box-shadow .22s;
  -webkit-appearance:none; appearance:none;
}
html.dfter-gate[data-gtm="light"] .dfter-field input{
  background:rgba(255,255,255,.75);
  border-color:rgba(35,45,90,.2);
}
.dfter-field input:focus{
  outline:none;
  border-color:var(--gt-a2,#8B7CF6);
  box-shadow:0 0 0 3.5px rgba(139,124,246,.22);
}
.dfter-field input::placeholder{color:rgba(234,238,255,.32);letter-spacing:1px;}
html.dfter-gate[data-gtm="light"] .dfter-field input::placeholder{color:rgba(24,32,62,.35);}

.dfter-code-row{display:flex;gap:8px;align-items:stretch;}
.dfter-code-row input{flex:1;letter-spacing:2px;direction:ltr;text-align:left;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}
.dfter-paste-btn{
  flex:none; width:48px; border-radius:14px;
  border:1.5px dashed rgba(190,200,255,.32);
  background:rgba(139,124,246,.14);
  font-size:17px; cursor:pointer;
}
html.dfter-gate[data-gtm="light"] .dfter-paste-btn{border-color:rgba(35,45,90,.25);background:rgba(109,90,230,.1);}

/* دکمهٔ فعال‌سازی */
.dfter-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  border-radius:15px; padding:13px 20px;
  font-size:14px; font-weight:800; line-height:1.7;
  cursor:pointer; text-decoration:none; border:1px solid transparent;
  transition:transform .2s, box-shadow .25s, opacity .2s;
}
.dfter-btn:active{transform:scale(.97);}
.dfter-btn:disabled{opacity:.6;cursor:default;}
.dfter-btn-primary{
  width:100%;
  background:linear-gradient(135deg,var(--gt-a1,#2DD4BF),var(--gt-a2,#8B7CF6));
  color:#fff;
  box-shadow:0 12px 30px rgba(91,123,233,.42), inset 0 1px 0 rgba(255,255,255,.32);
}
.dfter-btn-ghost{
  background:transparent;
  color:inherit;
  border-color:rgba(190,200,255,.3);
}
html.dfter-gate[data-gtm="light"] .dfter-btn-ghost{border-color:rgba(35,45,90,.25);}

/* وضعیت */
.dfter-status{
  min-height:20px; margin-top:11px;
  font-size:11.5px; font-weight:700; line-height:2; text-align:center;
  color:rgba(234,238,255,.75);
}
html.dfter-gate[data-gtm="light"] .dfter-status{color:rgba(24,32,62,.75);}
.dfter-status:empty{margin:0;min-height:0;}
.dfter-status.dfter-err{
  color:#FF8FAE;
  background:rgba(251,113,133,.12);
  border-radius:12px; padding:8px 12px;
}
.dfter-status.dfter-ok{color:#5EEAD4;background:rgba(45,212,191,.12);border-radius:12px;padding:8px 12px;}
.dfter-status.dfter-info{color:#A5B4FC;background:rgba(139,124,246,.12);border-radius:12px;padding:8px 12px;}
html.dfter-gate[data-gtm="light"] .dfter-status.dfter-err{color:#BE185D;background:rgba(213,57,123,.1);}
html.dfter-gate[data-gtm="light"] .dfter-status.dfter-ok{color:#047857;background:rgba(14,159,110,.1);}
html.dfter-gate[data-gtm="light"] .dfter-status.dfter-info{color:#4338CA;background:rgba(90,80,216,.1);}

/* راهنمای نصب iOS */
.dfter-install-hint{
  font-size:10.5px; font-weight:600; line-height:2.1;
  color:rgba(252,211,77,.95);
  background:rgba(251,191,36,.1);
  border:1px dashed rgba(252,211,77,.4);
  border-radius:13px; padding:9px 12px;
  margin:0 0 13px; text-align:right;
}
html.dfter-gate[data-gtm="light"] .dfter-install-hint{color:#92400E;background:rgba(217,119,6,.08);border-color:rgba(217,119,6,.35);}

/* پاورقی */
.dfter-gate-foot{
  display:flex; align-items:center; justify-content:center; gap:14px;
  margin-top:16px; padding-top:13px;
  border-top:1px dashed rgba(190,200,255,.2);
  font-size:10px; font-weight:700; color:rgba(234,238,255,.45);
  flex-wrap:wrap;
}
html.dfter-gate[data-gtm="light"] .dfter-gate-foot{border-color:rgba(35,45,90,.16);color:rgba(24,32,62,.45);}

/* دکمهٔ تم */
.dfter-th-btn{
  position:absolute; top:14px; inset-inline-start:14px;
  width:38px;height:38px;border-radius:12px;
  border:1px solid rgba(190,200,255,.22);
  background:rgba(8,12,28,.5);
  font-size:15px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
html.dfter-gate[data-gtm="light"] .dfter-th-btn{background:rgba(255,255,255,.7);border-color:rgba(35,45,90,.18);}

/* پاپ‌آپ تم */
.dfter-theme-pop{
  margin-top:13px;
  border-radius:18px;
  background:rgba(8,12,28,.72);
  border:1px solid rgba(190,200,255,.2);
  padding:14px;
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
}
html.dfter-gate[data-gtm="light"] .dfter-theme-pop{background:rgba(255,255,255,.85);border-color:rgba(35,45,90,.14);}
.dfter-th-head{display:flex;align-items:center;gap:9px;margin-bottom:11px;}
.dfter-th-head b{flex:1;font-size:12.5px;font-weight:900;}
.dfter-th-x{
  width:30px;height:30px;border-radius:9px;border:1px solid rgba(190,200,255,.24);
  background:transparent;color:inherit;font-size:12px;cursor:pointer;
}
.dfter-th-dots{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:11px;}
.dfter-th-dot{
  width:34px;height:34px;border-radius:12px;border:2px solid transparent;cursor:pointer;
  padding:0;background:transparent;
}
.dfter-th-dot i{display:block;width:100%;height:100%;border-radius:10px;}
.dfter-th-dot.sel{border-color:currentColor;box-shadow:0 0 0 3px rgba(139,124,246,.25);}
.dfter-th-modes{display:flex;gap:6px;margin-bottom:11px;}
.dfter-th-mode{
  flex:1;border-radius:11px;padding:8px 4px;cursor:pointer;
  border:1px solid rgba(190,200,255,.22);background:transparent;color:inherit;
  font-size:11px;font-weight:800;
}
.dfter-th-mode.sel{
  background:linear-gradient(135deg,var(--gt-a1,#2DD4BF),var(--gt-a2,#8B7CF6));
  color:#fff;border-color:transparent;
}
.dfter-th-custom{display:flex;gap:9px;}
.dfter-th-custom label{
  flex:1;display:flex;flex-direction:column;gap:5px;
  font-size:10.5px;font-weight:800;color:rgba(234,238,255,.65);
}
html.dfter-gate[data-gtm="light"] .dfter-th-custom label{color:rgba(24,32,62,.65);}
.dfter-th-custom input[type="color"]{
  width:100%;height:36px;border-radius:10px;border:1px solid rgba(190,200,255,.24);
  background:transparent;padding:2px;cursor:pointer;
}
.dfter-th-reset{
  width:100%;margin-top:11px;
  border-radius:12px;padding:9px;cursor:pointer;
  border:1px dashed rgba(190,200,255,.3);background:transparent;color:inherit;
  font-size:11px;font-weight:800;
}
.dfter-th-note{margin:9px 0 0;font-size:9.5px;line-height:1.9;color:rgba(234,238,255,.45);text-align:center;}
html.dfter-gate[data-gtm="light"] .dfter-th-note{color:rgba(24,32,62,.45);}

/* لایهٔ تک‌نسخه‌ای بودن (single-instance) */
.dfter-si-overlay{
  position:fixed;top:0;left:0;right:0;bottom:0;z-index:99999;
  display:flex;align-items:center;justify-content:center;
  background:rgba(6,9,23,.9);color:#EAEEFF;
  font-family:"Vazirmatn","Segoe UI",Tahoma,sans-serif;
  text-align:center;padding:24px;font-size:14px;font-weight:700;line-height:2.1;
}

/* پنل توسعه‌دهنده (developer.js) */
#dfterDevPanel{
  position:fixed;inset:auto 0 0 0;z-index:99998;
  max-height:72vh;overflow-y:auto;
  background:rgba(10,14,32,.94);
  border-top:1px solid rgba(190,200,255,.2);
  color:#EAEEFF;
  padding:16px;
  -webkit-backdrop-filter:blur(22px);
  backdrop-filter:blur(22px);
  font-size:12px;
}

/* بنر آپدیت نسخه */
#dafterUpdBanner{font-family:"Vazirmatn","Segoe UI",Tahoma,sans-serif;}
