@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --bg-1: #0f1226;
    --bg-2: #1b1440;
    --accent: #7c6bff;
    --accent-2: #22d3c5;
    --danger: #ff5c7a;
    --warning: #ffb95c;
    --ok: #34d399;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.14);
    --text: #f2f3fb;
    --text-dim: #b7b9d6;
    --radius: 18px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: radial-gradient(circle at 15% 20%, #2a1f6b 0%, transparent 45%),
                radial-gradient(circle at 85% 0%, #123b4a 0%, transparent 40%),
                linear-gradient(160deg, var(--bg-1), var(--bg-2));
    background-attachment: fixed;
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.8;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
}

.brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 14px var(--accent);
}

.nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav a {
    padding: 9px 16px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-dim);
    transition: .2s;
}

.nav a:hover, .nav a.active {
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--glass-border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 13px;
}

/* ---------- Glass card ---------- */
.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 22px;
}

.card h2, .card h3 { margin-top: 0; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Stat tiles ---------- */
.stat {
    padding: 20px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(124,107,255,.18), rgba(34,211,197,.10));
    border: 1px solid var(--glass-border);
}
.stat .num { font-size: 28px; font-weight: 800; }
.stat .label { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* ---------- Auth screens ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* بلوب‌های گرادیانی محو در پس‌زمینه صفحه ورود برای حس مدرن‌تر */
.auth-bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.auth-bg-decor span {
    position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35;
    animation: floatBlob 16s ease-in-out infinite;
}
.auth-bg-decor span:nth-child(1) { width: 320px; height: 320px; background: var(--accent); top: -80px; right: -60px; }
.auth-bg-decor span:nth-child(2) { width: 280px; height: 280px; background: var(--accent-2); bottom: -60px; left: -60px; animation-delay: -6s; }
.auth-bg-decor span:nth-child(3) { width: 180px; height: 180px; background: #ff7ab0; top: 45%; left: 50%; animation-delay: -11s; opacity: .18; }
@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -24px) scale(1.08); }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: authCardIn .45s cubic-bezier(.2,.8,.2,1);
}
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card .logo {
    width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 26px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 30px -8px rgba(124,107,255,.6);
}
.auth-brand { font-size: 13px; color: var(--text-dim); letter-spacing: .3px; margin-bottom: 4px; }
.auth-card h2 { margin: 0 0 4px; font-size: 22px; }
.auth-card p.sub { color: var(--text-dim); margin-top: 0; margin-bottom: 26px; font-size: 14px; }

/* نشانگر مرحله (موبایل ← کد تایید) */
.step-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; }
.step-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--glass-border); transition: .25s; }
.step-dots span.active { width: 22px; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.btn[data-loading="1"] { opacity: .7; pointer-events: none; }
.btn .spin {
    display: inline-block; width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    animation: spin .7s linear infinite; margin-left: 8px; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field { margin-bottom: 16px; text-align: right; }

input[type=text], input[type=tel], input[type=number], input[type=date],
input[type=password], input[type=search], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,.05);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: .2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,107,255,.25);
}
textarea { resize: vertical; min-height: 80px; }
::placeholder { color: #8c8fb5; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #9d8cff); color: #fff; width: 100%; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--glass-border); color: var(--text); }
.btn-outline:hover { background: var(--glass); }
.btn-danger { background: rgba(255,92,122,.15); color: var(--danger); border: 1px solid rgba(255,92,122,.4); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 14px; text-align: right; white-space: nowrap; }
thead th { color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--glass-border); }
tbody tr { border-bottom: 1px solid rgba(255,255,255,.06); }
tbody tr:hover { background: rgba(255,255,255,.03); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-ok { background: rgba(52,211,153,.15); color: var(--ok); }
.badge-warning { background: rgba(255,185,92,.15); color: var(--warning); }
.badge-danger { background: rgba(255,92,122,.15); color: var(--danger); }
.badge-expired { background: rgba(255,92,122,.28); color: #ffd7de; }
.badge-neutral { background: var(--glass); color: var(--text-dim); border: 1px solid var(--glass-border); }

/* ---------- Toast / flash ---------- */
.flash-stack { position: fixed; top: 18px; left: 18px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    padding: 14px 18px; border-radius: 12px; min-width: 240px;
    background: rgba(20,20,40,.9); border: 1px solid var(--glass-border);
    box-shadow: var(--shadow); font-size: 13.5px; backdrop-filter: blur(10px);
    animation: slidein .25s ease;
}
.toast.success { border-color: rgba(52,211,153,.5); }
.toast.error { border-color: rgba(255,92,122,.5); }
@keyframes slidein { from { opacity:0; transform: translateY(-8px);} to {opacity:1; transform: translateY(0);} }

/* ---------- Misc ---------- */
.muted { color: var(--text-dim); }
.text-left { text-align: left; direction: ltr; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chip { padding: 4px 10px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-border); font-size: 12px; }
hr.sep { border: none; border-top: 1px solid var(--glass-border); margin: 18px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

.otp-boxes { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.otp-boxes input {
    width: 46px; height: 54px; text-align: center; font-size: 20px; padding: 0;
}

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-dim); }
.checkbox-row input { width: auto; }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(5,5,15,.6); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 900; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
    width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
}

footer.site-footer { text-align: center; color: var(--text-dim); font-size: 12.5px; padding: 30px 0 50px; }
