/* =========================================================
   بارگ | Glass UI
   بهینه‌سازی کامل — Responsive Mobile / Desktop
   ========================================================= */

@font-face {
  font-family: 'Dana';
  src: url('../fonts/DanaFaNum-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../fonts/DanaFaNum-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../fonts/DanaFaNum-DemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../fonts/DanaFaNum-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =========================================================
   Variables
   ========================================================= */

:root {
  --bg-0: #070b16;
  --bg-1: #0c1226;
  --bg-2: #131b34;

  --amber: #fbbf24;
  --amber-2: #f59e0b;

  --blue: #38bdf8;
  --violet: #818cf8;

  --success: #34d399;
  --success-bg: rgba(52, 211, 153, .14);

  --error: #fb7185;
  --error-bg: rgba(251, 113, 133, .14);

  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, .14);

  --text-0: #f5f7fb;
  --text-1: #cbd5e1;
  --text-2: #8b96ad;

  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(255, 255, 255, .10);
  --glass-border: rgba(255, 255, 255, .12);

  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;

  --shadow-card:
    0 10px 30px rgba(0, 0, 0, .28),
    0 1px 0 rgba(255, 255, 255, .05) inset;

  --shadow-amber:
    0 8px 20px rgba(245, 158, 11, .28);
}

/* =========================================================
   Reset
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 28px 14px;

  font-family: 'Dana', Tahoma, Arial, sans-serif;
  color: var(--text-0);
  direction: rtl;

  background: var(--bg-0);

  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
}

img,
svg {
  display: block;
}

::selection {
  background: rgba(251, 191, 36, .28);
}

/* =========================================================
   Device
   ========================================================= */

.device-frame {
  position: relative;
  width: 100%;
  max-width: 430px;
}

.device-caption {
  display: none;
}

.device-screen {
  position: relative;

  width: 100%;
  height: 100dvh;

  display: flex;
  flex-direction: column;

  overflow: hidden;
  isolation: isolate;

  background: var(--bg-0);
  border-radius: 0;
}

/* =========================================================
   Ambient Background
   ========================================================= */

.device-screen::before,
.device-screen::after {
  content: "";

  position: absolute;
  z-index: -1;

  border-radius: 50%;

  pointer-events: none;

  filter: blur(60px);
  opacity: .35;

  will-change: transform;
}

.device-screen::before {
  width: 260px;
  height: 260px;

  top: -80px;
  right: -60px;

  background: var(--amber-2);

  animation: float1 14s ease-in-out infinite;
}

.device-screen::after {
  width: 300px;
  height: 300px;

  bottom: 10%;
  left: -100px;

  background: var(--blue);

  animation: float2 17s ease-in-out infinite;
}

@keyframes float1 {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-18px, 24px, 0) scale(1.08);
  }
}

@keyframes float2 {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(20px, -16px, 0) scale(1.05);
  }
}

/* =========================================================
   Status Bar
   ========================================================= */

.statusbar {
  display: none;
}

/* =========================================================
   App Header
   ========================================================= */

.app-header {
  flex: 0 0 auto;

  position: relative;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 18px 16px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 0;
}

.brand-badge {
  width: 40px;
  height: 40px;

  flex: none;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 13px;

  background:
    linear-gradient(
      145deg,
      var(--amber),
      var(--amber-2)
    );

  color: #211305;

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .18) inset,
    0 6px 18px rgba(245, 158, 11, .35);

  animation: pulseGlow 2.6s ease-in-out infinite;
}

.brand-badge svg {
  width: 22px;
  height: 22px;
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, .18) inset,
      0 6px 18px rgba(245, 158, 11, .35);
  }

  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, .24) inset,
      0 6px 26px rgba(245, 158, 11, .60);
  }
}

.brand-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-0);
}

.brand-sub {
  margin-top: 1px;

  font-size: 11px;
  color: var(--text-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================
   Icon Button
   ========================================================= */

.icon-btn {
  width: 38px;
  height: 38px;

  min-width: 38px;
  padding: 0;
  margin: 0;

  flex: none;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--glass-border);
  border-radius: 12px;

  background: var(--glass);
  color: var(--text-1);

  box-shadow: none;

  cursor: pointer;

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  transition:
    background .15s ease,
    color .15s ease,
    transform .15s ease;
}

.icon-btn:hover {
  background: var(--glass-strong);
  color: var(--text-0);
}

.icon-btn:active {
  transform: scale(.93);
}

.icon-btn svg {
  width: 18px;
  height: 18px;

  display: block;

  stroke: currentColor;
  visibility: visible;
  opacity: 1;
}

/* =========================================================
   App Content
   ========================================================= */

.app-content {
  position: relative;
  z-index: 1;

  flex: 1 1 auto;

  min-height: 0;

  overflow-y: auto;
  overflow-x: hidden;

  padding: 4px 16px 22px;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
  scrollbar-color:
    rgba(255, 255, 255, .16)
    transparent;
}

.app-content::-webkit-scrollbar {
  width: 5px;
}

.app-content::-webkit-scrollbar-track {
  background: transparent;
}

.app-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .16);
  border-radius: 10px;
}

/* =========================================================
   Tabs
   ========================================================= */

.tab-panel {
  display: none;

  animation: fadeUp .28s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* =========================================================
   Glass
   ========================================================= */

.glass {
  background: var(--glass);

  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);

  backdrop-filter:
    blur(22px)
    saturate(140%);

  -webkit-backdrop-filter:
    blur(22px)
    saturate(140%);

  box-shadow: var(--shadow-card);
}

.card {
  padding: 18px;
  margin-bottom: 14px;
}

.card:last-child {
  margin-bottom: 0;
}

/* =========================================================
   Card Header
   ========================================================= */

.card-head {
  display: flex;
  align-items: center;

  gap: 10px;
  margin-bottom: 4px;
}

.card-head .card-icon {
  width: 32px;
  height: 32px;

  flex: none;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;

  background: var(--glass-strong);
  color: var(--amber);
}

.card-head .card-icon svg {
  width: 17px;
  height: 17px;
}

/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3 {
  margin: 0 0 4px;

  color: var(--text-0);
  font-weight: 700;
}

h1 {
  font-size: 19px;
}

h2 {
  font-size: 15px;
}

p {
  line-height: 1.8;
}

.muted {
  color: var(--text-2);

  font-size: 12.5px;
  line-height: 1.8;
}

/* =========================================================
   Labels
   ========================================================= */

label {
  display: block;

  margin: 14px 0 7px;

  color: var(--text-1);

  font-size: 13px;
  font-weight: 500;
}

/* =========================================================
   Inputs
   ========================================================= */

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"] {
  width: 100%;

  padding: 12px 14px;

  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);

  outline: none;

  background: rgba(7, 11, 22, .55);
  color: var(--text-0);

  font-size: 14px;

  transition:
    border-color .15s ease,
    box-shadow .15s ease;
}

input::placeholder {
  color: var(--text-2);
}

input:focus {
  border-color: var(--amber-2);

  box-shadow:
    0 0 0 3px rgba(245, 158, 11, .16);
}

.field-row {
  display: flex;
  align-items: center;

  gap: 8px;
}

.field-row input {
  flex: 1;
  min-width: 0;
}

/* =========================================================
   Buttons
   ========================================================= */

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  padding: 12.5px 18px;

  border: 0;
  border-radius: var(--r-sm);

  background:
    linear-gradient(
      135deg,
      var(--amber),
      var(--amber-2)
    );

  color: #241503;

  font-size: 14.5px;
  font-weight: 700;

  cursor: pointer;
  text-decoration: none;

  margin-top: 16px;

  box-shadow: var(--shadow-amber);

  transition:
    transform .12s ease,
    box-shadow .12s ease,
    filter .12s ease;
}

button:not(.icon-btn):not(.nav-btn):not(.captcha-refresh),
.btn {
  width: 100%;
}

button:hover,
.btn:hover {
  filter: brightness(1.05);
}

button:active,
.btn:active {
  transform: scale(.98);
}

button.secondary {
  background: var(--glass-strong);

  color: var(--text-0);

  border: 1px solid var(--glass-border);

  box-shadow: none;
}

button.danger {
  background:
    linear-gradient(
      135deg,
      #fb7185,
      #e11d48
    );

  color: #fff;

  box-shadow:
    0 8px 20px rgba(225, 29, 72, .28);
}

button.ghost {
  background: transparent;

  color: var(--text-1);

  border: 1px dashed var(--glass-border);

  box-shadow: none;
}

/* =========================================================
   Messages
   ========================================================= */

.msg-err,
.msg-ok,
.msg-warn {
  display: flex;
  align-items: flex-start;

  gap: 8px;

  padding: 11px 14px;
  margin-bottom: 12px;

  border-radius: var(--r-sm);

  font-size: 13px;
  line-height: 1.7;
}

.msg-err {
  background: var(--error-bg);
  color: #ffd7dd;
}

.msg-ok {
  background: var(--success-bg);
  color: #c8f7e3;
}

.msg-warn {
  background: var(--warn-bg);
  color: #ffe8b3;
}

/* =========================================================
   Rows
   ========================================================= */

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 10px 0;

  border-bottom:
    1px solid rgba(255, 255, 255, .07);

  font-size: 13.5px;
}

.row:last-child {
  border-bottom: none;
}

.row > span:first-child {
  color: var(--text-2);
}

.row > span:last-child {
  color: var(--text-0);

  font-weight: 600;

  text-align: left;
}

/* =========================================================
   Switch
   ========================================================= */

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 11px 0;

  border-bottom:
    1px solid rgba(255, 255, 255, .07);

  font-size: 13.5px;
}

.switch-row:last-child {
  border-bottom: none;
}

.switch {
  position: relative;

  display: inline-block;

  width: 44px;
  height: 25px;

  flex: none;
}

.switch input {
  position: absolute;

  width: 0;
  height: 0;

  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;

  cursor: pointer;

  background: rgba(255, 255, 255, .14);

  border-radius: 26px;

  transition: background .2s ease;
}

.slider::before {
  content: "";

  position: absolute;

  width: 19px;
  height: 19px;

  top: 3px;
  right: 3px;

  background: #fff;

  border-radius: 50%;

  box-shadow:
    0 2px 6px rgba(0, 0, 0, .3);

  transition: transform .2s ease;
}

.switch input:checked + .slider {
  background:
    linear-gradient(
      135deg,
      var(--amber),
      var(--amber-2)
    );
}

.switch input:checked + .slider::before {
  transform: translateX(-19px);
}

/* =========================================================
   Badges
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;

  gap: 5px;

  padding: 4px 11px;

  border-radius: 20px;

  font-size: 11.5px;
  font-weight: 600;
}

.badge-ok {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-err {
  background: var(--error-bg);
  color: var(--error);
}

/* =========================================================
   Table
   ========================================================= */

table {
  width: 100%;

  margin-top: 10px;

  border-collapse: collapse;

  font-size: 12.5px;
}

table th,
table td {
  padding: 9px 6px;

  border-bottom:
    1px solid rgba(255, 255, 255, .07);

  text-align: center;
}

table th {
  color: var(--text-2);

  font-size: 11.5px;
  font-weight: 500;
}

table td:first-child,
table th:first-child {
  text-align: right;
}

/* =========================================================
   Grids
   ========================================================= */

.grid-2 {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.stat-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 10px;

  margin-top: 4px;
}

.stat-box {
  padding: 14px 10px;

  text-align: center;

  background: rgba(7, 11, 22, .45);

  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
}

.stat-box .num {
  color: var(--text-0);

  font-size: 19px;
  font-weight: 800;

  font-variant-numeric: tabular-nums;
}

.stat-box .lbl {
  margin-top: 4px;

  color: var(--text-2);

  font-size: 11px;
}

/* =========================================================
   Empty State
   ========================================================= */

.empty-state {
  padding: 34px 10px;

  text-align: center;

  color: var(--text-2);
}

.empty-state svg {
  width: 46px;
  height: 46px;

  margin: 0 auto 10px;

  color: var(--text-2);

  opacity: .5;
}

.empty-state p {
  margin: 0;

  font-size: 13px;
}

/* =========================================================
   Captcha
   ========================================================= */

.captcha-row {
  display: flex;
  align-items: center;

  gap: 8px;

  padding: 10px 12px;

  background: rgba(7, 11, 22, .55);

  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
}

.captcha-q {
  color: var(--text-0);

  font-size: 14px;
  font-weight: 700;

  font-variant-numeric: tabular-nums;

  white-space: nowrap;
}

button.captcha-refresh {
  width: 34px;
  height: 34px;

  flex: none;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  margin: 0;

  border: 1px solid var(--glass-border);
  border-radius: 9px;

  background: var(--glass-strong);
  color: var(--amber);

  box-shadow: none;

  cursor: pointer;
}

button.captcha-refresh:hover {
  background: var(--glass-strong);
  filter: brightness(1.15);
}

button.captcha-refresh:active {
  transform: scale(.92);
}

.captcha-refresh svg {
  width: 16px;
  height: 16px;

  display: block;

  transition: transform .4s ease;
}

.captcha-refresh.spin svg {
  transform: rotate(360deg);
}

/* =========================================================
   Login Hero
   ========================================================= */

.login-hero {
  padding: 26px 6px 4px;

  text-align: center;
}

.login-hero .brand-badge {
  width: 62px;
  height: 62px;

  margin: 0 auto 14px;

  border-radius: 20px;
}

.login-hero .brand-badge svg {
  width: 32px;
  height: 32px;
}

.login-hero h1 {
  font-size: 20px;
}

.login-hero p {
  margin-top: 4px;

  color: var(--text-2);

  font-size: 13px;
}

/* =========================================================
   Steps
   ========================================================= */

.steps-dots {
  display: flex;
  justify-content: center;

  gap: 6px;

  margin: 14px 0 2px;
}

.steps-dots span {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: rgba(255, 255, 255, .16);

  transition:
    background .2s ease,
    width .2s ease;
}

.steps-dots span.on {
  width: 18px;

  border-radius: 4px;

  background: var(--amber);
}

/* =========================================================
   Bottom Navigation
   ========================================================= */

.bottom-nav {
  position: relative;

  flex: 0 0 auto;

  z-index: 2;

  display: flex;
  align-items: stretch;
  justify-content: space-between;

  padding:
    8px
    6px
    calc(8px + env(safe-area-inset-bottom));

  background: rgba(9, 13, 26, .72);

  border-top:
    1px solid var(--glass-border);

  backdrop-filter:
    blur(24px)
    saturate(150%);

  -webkit-backdrop-filter:
    blur(24px)
    saturate(150%);
}

.nav-btn {
  width: auto;

  flex: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4px;

  padding: 7px 2px;
  margin: 0;

  border: 0;
  border-radius: var(--r-sm);

  background: none;
  color: var(--text-2);

  box-shadow: none;

  cursor: pointer;

  transition:
    color .15s ease,
    background .15s ease;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
}

.nav-btn span {
  font-size: 10px;
  font-weight: 600;
}

.nav-btn:hover {
  color: var(--text-1);
  filter: none;
}

.nav-btn:active {
  transform: none;
}

.nav-btn.on {
  color: var(--amber);
  background: rgba(251, 191, 36, .10);
}

.nav-btn.on svg {
  filter:
    drop-shadow(
      0 0 6px
      rgba(251, 191, 36, .5)
    );
}

/* =========================================================
   Desktop Device
   ========================================================= */

@media (min-width: 720px) {

  body {
    background:
      radial-gradient(
        900px 500px at 15% 10%,
        rgba(56, 189, 248, .16),
        transparent 60%
      ),
      radial-gradient(
        900px 600px at 85% 90%,
        rgba(245, 158, 11, .14),
        transparent 60%
      ),
      var(--bg-0);
  }

  .device-caption {
    display: block;

    margin-bottom: 18px;

    text-align: center;
  }

  .device-caption .cap-title {
    color: var(--text-0);

    font-size: 15px;
    font-weight: 700;
  }

  .device-caption .cap-sub {
    margin-top: 3px;

    color: var(--text-2);

    font-size: 12px;
  }

  .device-frame {
    padding: 16px 16px 26px;

    border-radius: 52px;

    background:
      linear-gradient(
        160deg,
        #1b2540,
        #0a0f1f 65%
      );

    box-shadow:
      0 50px 100px -20px rgba(0, 0, 0, .60),
      0 0 0 1px rgba(255, 255, 255, .06) inset,
      0 0 0 8px rgba(255, 255, 255, .02);
  }

  .device-frame::before {
    content: "";

    position: absolute;

    top: 30px;
    left: 50%;

    transform: translateX(-50%);

    width: 120px;
    height: 24px;

    z-index: 3;

    background: #05070d;

    border-radius:
      0 0 16px 16px;
  }

  .device-screen {
    height: 780px;

    border-radius: 38px;

    box-shadow:
      0 0 0 1px rgba(255, 255, 255, .05);
  }

  .statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex: 0 0 auto;

    position: relative;
    z-index: 1;

    padding: 16px 26px 0;

    color: var(--text-0);

    font-size: 12px;
    font-weight: 700;

    font-variant-numeric: tabular-nums;
  }

  .statusbar .sb-icons {
    display: flex;
    align-items: center;

    gap: 5px;
  }

  .statusbar svg {
    width: 15px;
    height: 15px;
  }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 719px) {
  body {
    padding: 0;
  }

  .device-frame {
    max-width: none;
  }

  .device-screen {
    width: 100%;
    min-height: 100dvh;
  }
}

/* =========================================================
   Small Screens
   ========================================================= */

@media (max-width: 360px) {

  .app-header {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card {
    padding: 15px;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand-sub {
    font-size: 10px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .device-screen::before,
  .device-screen::after,
  .brand-badge,
  .tab-panel {
    animation: none !important;
  }

  .icon-btn,
  button,
  .btn,
  .slider,
  .slider::before,
  .steps-dots span,
  .captcha-refresh svg {
    transition: none !important;
  }
}