/* iTex Report — installer UI (RTL, glass, motion-aware) */
:root {
  --bg: #070b14;
  --ink: #eef2ff;
  --muted: #9ba8c9;
  --faint: #6b7794;
  --line: rgba(255, 255, 255, .13);
  --glass: rgba(255, 255, 255, .07);
  --glass-hi: rgba(255, 255, 255, .11);
  --accent: #ff8a3d;
  --accent-deep: #ff7a1a;
  --accent-ink: #1c0e00;
  --ok: #34d399;
  --err: #fb7185;
  --warn: #fbbf24;
  --cyan: #38bdf8;
  --r: 26px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  font-family: "Vazirmatn", "IRANSansX", "IRANSans", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 15px;
  overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 800; }
[hidden] { display: none !important; }

/* ---------- backdrop ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute;
  width: 52vmax; height: 52vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.b1 { background: #ff6a00; top: -22vmax; right: -14vmax; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { background: #1d4ed8; bottom: -26vmax; left: -18vmax; animation: drift2 30s ease-in-out infinite alternate; }
.b3 { background: #0d9488; width: 34vmax; height: 34vmax; bottom: -10vmax; right: 8vmax; opacity: .32; animation: drift3 34s ease-in-out infinite alternate; }
.grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 28%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 28%, #000 10%, transparent 72%);
}
@keyframes drift1 { to { transform: translate3d(-9vmax, 7vmax, 0) scale(1.12); } }
@keyframes drift2 { to { transform: translate3d(10vmax, -8vmax, 0) scale(1.1); } }
@keyframes drift3 { to { transform: translate3d(-6vmax, -9vmax, 0) scale(1.25); } }

/* ---------- shell ---------- */
.shell {
  position: relative; z-index: 1;
  width: 100%; max-width: 580px;
  margin: 0 auto;
  padding: 30px 16px 48px;
}
.brand { text-align: center; margin-bottom: 18px; animation: rise .8s var(--ease) both; }
.logo { width: 92px; height: 92px; display: block; margin: 0 auto 6px; overflow: visible; filter: drop-shadow(0 8px 26px rgba(255, 138, 61, .45)); }
.brand h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: 0; text-wrap: balance; }
.brand h1 span { color: var(--accent); }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 14px; text-wrap: pretty; }

/* logo animation */
.logo .shield { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s var(--ease) .1s forwards; }
.logo .fillshield { opacity: 0; animation: fadein .8s ease .9s forwards; }
.logo .xhair { transform-box: fill-box; transform-origin: center; animation: spin 18s linear infinite; }
.logo .dot { transform-box: fill-box; transform-origin: center; animation: pulse 2.2s ease-in-out infinite; }
.logo .tick { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .6s ease 1.1s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.7); opacity: .55; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- stepper ---------- */
.stepper {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  position: relative;
  animation: rise .8s var(--ease) .1s both;
}
.stepper::before, .stepper .fill {
  content: ""; position: absolute; top: 19px; height: 3px; border-radius: 3px;
  inset-inline: 16.66%;
}
.stepper::before { background: var(--line); }
.stepper .fill {
  background: linear-gradient(90deg, var(--accent), #ffc08a);
  transform: scaleX(0); transform-origin: right center;
  transition: transform .7s var(--ease);
}
.st { position: relative; text-align: center; color: var(--faint); font-size: 12.5px; font-weight: 700; transition: color .4s; }
.st .dot {
  width: 40px; height: 40px; margin: 0 auto 6px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #121a2c;
  border: 1.5px solid var(--line);
  font-weight: 800; font-size: 15px;
  transition: transform .5s var(--pop), background .4s, border-color .4s, box-shadow .4s;
}
.st .dot svg { width: 20px; height: 20px; }
.st.active { color: var(--ink); }
.st.active .dot { border-color: var(--accent); background: #1d1409; color: var(--accent); transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 138, 61, .15); }
.st.done { color: var(--muted); }
.st.done .dot { background: var(--ok); border-color: var(--ok); color: #03281c; }

/* ---------- glass card ---------- */
.card {
  position: relative;
  border-radius: var(--r);
  padding: 26px 24px 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .18);
  animation: rise .9s var(--ease) .2s both;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 38%, rgba(255, 138, 61, .25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(18, 26, 44, .92); }
}
@media (prefers-reduced-transparency: reduce) {
  .card { background: #121a2c; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.panel { display: none; }
.panel.show { display: block; animation: rise .55s var(--ease) both; }
.panel.leaving { animation: out .25s ease both; }
@keyframes out { to { opacity: 0; transform: translateY(-8px); } }

.hero-icon { width: 78px; height: 78px; margin: 0 auto 8px; display: block; overflow: visible; }
.panel h2 { margin: 0 0 4px; font-size: 21px; font-weight: 900; text-align: center; text-wrap: balance; }
.panel .sub { margin: 0 0 20px; color: var(--muted); text-align: center; text-wrap: pretty; font-size: 14px; }

/* hero icons animation */
.bot-eye { transform-box: fill-box; transform-origin: center; animation: blink 4.2s infinite; }
.bot-ant { transform-box: fill-box; transform-origin: center; animation: pulse 2s ease-in-out infinite; }
.bot-head { animation: floaty 4s ease-in-out infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ping { transform-box: fill-box; transform-origin: center; animation: ping 2.4s ease-out infinite; opacity: 0; }
.ping.p2 { animation-delay: 1.2s; }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
.rocket { animation: floaty 2.6s ease-in-out infinite; }
.flame { transform-box: fill-box; transform-origin: top center; animation: flicker .28s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scaleY(.8) scaleX(.9); } to { transform: scaleY(1.25) scaleX(1.05); } }

/* ---------- form ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.input {
  display: flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 14px;
  border-radius: 16px;
  background: rgba(5, 8, 16, .45);
  border: 1.5px solid var(--line);
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 138, 61, .17); background: rgba(5, 8, 16, .6); }
.input.ok { border-color: rgba(52, 211, 153, .7); }
.input.bad { border-color: rgba(251, 113, 133, .75); }
.input > svg { width: 20px; height: 20px; flex: none; color: var(--faint); }
.input:focus-within > svg { color: var(--accent); }
.input input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: 0; outline: 0;
  color: var(--ink); font: inherit; font-size: 15px;
}
.input input.ltr { direction: ltr; text-align: left; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 14px; }
.input input::placeholder { color: #55617f; }
.mini {
  flex: none; height: 34px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--glass-hi); color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: transform .15s, background .2s;
}
.mini:hover { background: rgba(255, 255, 255, .17); }
.mini:active { transform: scale(.95); }
.help { margin: 6px 2px 0; font-size: 12.5px; color: var(--faint); text-wrap: pretty; }

details.adv { margin: 4px 0 16px; border-radius: 16px; border: 1px dashed var(--line); padding: 0 14px; }
details.adv summary { cursor: pointer; padding: 11px 0; color: var(--muted); font-size: 13.5px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::after { content: "▾"; margin-inline-start: auto; transition: transform .3s var(--ease); }
details.adv[open] summary::after { transform: rotate(180deg); }
details.adv .field:last-child { margin-bottom: 14px; }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 0 20px;
  border: 0; border-radius: 17px;
  font: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
  color: var(--accent-ink);
  background: linear-gradient(135deg, #ffa05a, var(--accent-deep));
  box-shadow: 0 12px 30px rgba(255, 122, 26, .38), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .2s var(--ease), box-shadow .2s, filter .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(255, 122, 26, .5), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn:active { transform: scale(.98); }
.btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 140%; } }
.btn[disabled] { filter: grayscale(.6) brightness(.8); cursor: not-allowed; transform: none; box-shadow: none; }
.btn[disabled]::after { display: none; }
.btn.ghost {
  background: var(--glass-hi); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); border: 1px solid var(--line);
}
.btn.ghost::after { display: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, .17); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn.sm { min-height: 44px; font-size: 14px; border-radius: 14px; }
.btn .spin { display: none; }
.btn.loading .lbl { opacity: 0; }
.btn.loading .spin { display: block; position: absolute; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row .btn { flex: 1; }
.row .btn.back { flex: 0 0 auto; width: auto; }

.spin, .ring-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(28, 14, 0, .25); border-top-color: var(--accent-ink);
  animation: spin .8s linear infinite;
}

/* ---------- alerts ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 14px; padding: 12px 14px; border-radius: 16px;
  font-size: 13.5px; line-height: 1.8; text-wrap: pretty;
  border: 1px solid transparent;
  animation: rise .4s var(--ease) both;
}
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 4px; }
.alert.err { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .4); color: #ffd3da; animation: shake .5s both; }
.alert.warn { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .35); color: #ffe7a6; }
.alert.ok { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); color: #b8f5dc; }
.alert a { font-weight: 800; }

/* ---------- env chips ---------- */
.env { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 9px; border-radius: 99px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); font-weight: 700;
  animation: pop .5s var(--pop) both;
}
.chip svg { width: 15px; height: 15px; }
.chip.ok { color: #b8f5dc; border-color: rgba(52, 211, 153, .35); }
.chip.ok svg { color: var(--ok); }
.chip.bad { color: #ffd3da; border-color: rgba(251, 113, 133, .45); }
.chip.bad svg { color: var(--err); }
.chip.warn { color: #ffe7a6; border-color: rgba(251, 191, 36, .4); }
.chip.warn svg { color: var(--warn); }
.chip.load .ring-spin { width: 13px; height: 13px; border-width: 2px; border-color: rgba(255, 255, 255, .2); border-top-color: var(--accent); }

/* ---------- identity card ---------- */
.idcard {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; margin: 0 0 16px; border-radius: 20px;
  background: rgba(52, 211, 153, .08); border: 1px solid rgba(52, 211, 153, .3);
  animation: pop .6s var(--pop) both;
}
.avatar {
  position: relative; flex: none; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}
.avatar.alt { background: linear-gradient(135deg, #ffb06a, #ff6a00); }
.avatar .badge {
  position: absolute; bottom: -3px; inset-inline-end: -3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ok); color: #03281c; display: grid; place-items: center; border: 2px solid #0e1626;
}
.avatar .badge svg { width: 13px; height: 13px; }
.idcard .meta { min-width: 0; }
.idcard .nm { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idcard .un { color: var(--muted); font-size: 13px; direction: ltr; text-align: right; }

/* ---------- summary ---------- */
.sum { display: grid; gap: 10px; margin-bottom: 18px; }
.sum .idcard { margin: 0; background: var(--glass); border-color: var(--line); }

/* ---------- timeline ---------- */
.tasks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .045); border: 1px solid var(--line);
  color: var(--faint); font-weight: 700; font-size: 14px;
  transition: background .3s, color .3s, border-color .3s, transform .4s var(--ease);
}
.task .ic { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); }
.task .ic svg { width: 16px; height: 16px; }
.task .ic .ring-spin { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255, 255, 255, .15); border-top-color: var(--accent); }
.task .note { margin-inline-start: auto; font-size: 12px; font-weight: 600; color: var(--faint); }
.task.run { color: var(--ink); background: rgba(255, 138, 61, .09); border-color: rgba(255, 138, 61, .4); transform: scale(1.015); }
.task.run .ic { border-color: transparent; }
.task.ok { color: var(--ink); border-color: rgba(52, 211, 153, .3); }
.task.ok .ic { background: var(--ok); border-color: var(--ok); color: #03281c; }
.task.fail { color: #ffd3da; background: rgba(251, 113, 133, .1); border-color: rgba(251, 113, 133, .45); }
.task.fail .ic { background: var(--err); border-color: var(--err); color: #3b0612; }
.bar { height: 9px; border-radius: 9px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 0 0 18px; }
.bar i {
  display: block; height: 100%; width: 100%; border-radius: inherit;
  transform: scaleX(0); transform-origin: right center;
  background: linear-gradient(90deg, var(--accent), #ffc08a, var(--accent));
  background-size: 200% 100%;
  transition: transform .6s var(--ease);
  animation: slide 1.6s linear infinite;
}
@keyframes slide { to { background-position: -200% 0; } }

/* ---------- done ---------- */
.done-wrap { position: relative; text-align: center; padding-top: 6px; }
.big-ring { position: relative; width: 112px; height: 112px; margin: 0 auto 8px; }
.big-ring svg { width: 100%; height: 100%; overflow: visible; }
.big-ring .c { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s var(--ease) .1s forwards; }
.big-ring .t { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .6s var(--ease) .75s forwards; }
.big-ring .glow { animation: pulse 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.confetti { position: absolute; top: 56px; left: 50%; width: 0; height: 0; pointer-events: none; }
.confetti i {
  position: absolute; width: 8px; height: 14px; border-radius: 3px; opacity: 0;
  background: var(--c);
  animation: burst 1.5s var(--ease) var(--d) forwards;
}
@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.6); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
}
.steps-next { text-align: start; list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 8px; }
.steps-next li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  font-size: 14px; text-wrap: pretty;
  animation: rise .6s var(--ease) both;
}
.steps-next li:nth-child(2) { animation-delay: .1s; }
.steps-next li:nth-child(3) { animation-delay: .2s; }
.steps-next .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 138, 61, .2); color: var(--accent); font-weight: 900; font-size: 13px; }
code, .code { direction: ltr; unicode-bidi: embed; font-family: ui-monospace, Consolas, monospace; background: rgba(255, 255, 255, .09); padding: 1px 7px; border-radius: 7px; font-size: 13px; }

.foot { text-align: center; margin-top: 22px; color: var(--faint); font-size: 12.5px; animation: rise 1s var(--ease) .4s both; }

/* ---------- status page ---------- */
.status-card { text-align: center; }
.status-card .live { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 99px; background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .4); color: #b8f5dc; font-weight: 800; font-size: 13px; margin: 10px 0 16px; }
.status-card .live i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: livepulse 1.8s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

/* ---------- responsive / a11y ---------- */
@media (max-width: 480px) {
  .shell { padding-top: 20px; }
  .card { padding: 22px 16px 18px; border-radius: 22px; }
  .brand h1 { font-size: 24px; }
  .st { font-size: 11.5px; }
  .st .dot { width: 36px; height: 36px; }
  .stepper::before, .stepper .fill { top: 17px; }
  .env { gap: 6px; margin-bottom: 14px; }
  .chip { font-size: 11px; padding: 2px 9px 2px 7px; }
  .chip svg { width: 13px; height: 13px; }
}
:focus-visible { outline: 3px solid rgba(56, 189, 248, .7); outline-offset: 2px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .blob { animation: none !important; }
}
