@font-face {
    font-family: 'Vazir';
    src: url('/Vazir-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazir';
    src: url('/Vazir.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazir';
    src: url('/Vazir-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazir';
    src: url('/Vazir-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root,
html[data-theme="dark"] {
    --bg: #09050f;
    --bg2: #160b25;
    --header-bg: rgba(9, 5, 15, .78);
    --panel: rgba(255, 255, 255, .075);
    --panel2: rgba(255, 255, 255, .12);
    --input-bg: rgba(0, 0, 0, .24);
    --text: #faf7ff;
    --heading: #ffffff;
    --muted: #cbbce0;
    --purple: #7c3aed;
    --purple2: #a855f7;
    --purple3: #4c1d95;
    --danger: #ff4d6d;
    --danger-text: #ffd5de;
    --success: #38d996;
    --success-text: #ccffeb;
    --border: rgba(255, 255, 255, .14);
    --shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

html[data-theme="light"] {
    --bg: #f7f3ff;
    --bg2: #eee6ff;
    --header-bg: rgba(255, 255, 255, .82);
    --panel: rgba(255, 255, 255, .76);
    --panel2: rgba(255, 255, 255, .94);
    --input-bg: rgba(255, 255, 255, .9);
    --text: #241536;
    --heading: #160b25;
    --muted: #6f607e;
    --purple: #6d28d9;
    --purple2: #9333ea;
    --purple3: #5b21b6;
    --danger: #dc284b;
    --danger-text: #8e1730;
    --success: #169f69;
    --success-text: #076341;
    --border: rgba(75, 39, 107, .15);
    --shadow: 0 24px 70px rgba(67, 33, 93, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body {
    margin: 0;
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(168, 85, 247, .30), transparent 34%),
        radial-gradient(circle at bottom left, rgba(124, 58, 237, .22), transparent 30%),
        linear-gradient(135deg, var(--bg), var(--bg2));
    color: var(--text);
    min-height: 100vh;
    transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; color: var(--heading); }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 16px;
    color: white;
    background: linear-gradient(135deg, var(--purple), var(--purple2));
    box-shadow: 0 12px 30px rgba(139, 92, 246, .4);
    direction: ltr;
}
.nav { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.nav a:not(.btn) { padding: 10px 12px; border-radius: 14px; }
.nav a:not(.btn):hover { background: var(--panel); color: var(--text); }
.theme-toggle {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 15px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    transition: transform .2s ease, background .2s ease;
}
.theme-toggle:hover { transform: translateY(-2px); background: var(--panel2); }
.theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: inline; }
.btn {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 18px;
    border-radius: 16px;
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    font-weight: 700;
    transition: .2s ease;
    white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--purple), var(--purple2)); color: white; box-shadow: 0 14px 35px rgba(139, 92, 246, .32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(139, 92, 246, .4); }
.btn-soft { background: var(--panel2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-danger { background: rgba(255, 77, 109, .14); color: var(--danger-text); border: 1px solid rgba(255, 77, 109, .35); }
.btn-lg { padding: 15px 22px; font-size: 16px; }
.btn-sm { padding: 9px 12px; border-radius: 12px; font-size: 13px; }
.btn-full { width: 100%; }
.hero { padding: 76px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 28px; align-items: center; }
.badge, .auth-badge { display: inline-flex; color: #eadcff; background: rgba(139, 92, 246, .16); border: 1px solid rgba(168, 85, 247, .28); padding: 9px 14px; border-radius: 999px; margin-bottom: 18px; }
html[data-theme="light"] .badge,
html[data-theme="light"] .auth-badge { color: #5b21b6; }
.hero h1 { font-size: clamp(34px, 6vw, 68px); line-height: 1.18; margin: 0 0 18px; letter-spacing: -1px; color: var(--heading); }
.hero p { color: var(--muted); line-height: 2.05; font-size: 18px; margin: 0; max-width: 760px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.glass-card, .auth-card, .upload-panel, .files-card, .feature-card {
    background: linear-gradient(145deg, var(--panel2), var(--panel));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    border-radius: 28px;
}
.hero-card { padding: 28px; min-height: 330px; display: flex; flex-direction: column; justify-content: center; }
.upload-illustration { width: 160px; height: 160px; margin: 0 auto 20px; position: relative; border-radius: 44px; background: radial-gradient(circle, rgba(168, 85, 247, .38), rgba(139, 92, 246, .14)); display: grid; place-items: center; }
.cloud { font-size: 72px; opacity: .85; }
.arrow { position: absolute; font-size: 44px; font-weight: 900; color: white; transform: translateY(14px); }
.hero-card h2 { margin: 0 0 10px; text-align: center; color: var(--heading); }
.hero-card p { text-align: center; color: var(--muted); line-height: 1.9; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 28px 0 70px; }
.feature-card { padding: 24px; }
.feature-card span { color: #d8c6ff; font-weight: 800; }
html[data-theme="light"] .feature-card span { color: #6d28d9; }
.feature-card h3 { margin: 12px 0 10px; color: var(--heading); }
.feature-card p { color: var(--muted); line-height: 1.85; margin: 0; }
.auth-wrap { padding: 60px 0 76px; display: grid; place-items: center; }
.auth-card { width: min(470px, 100%); padding: 30px; }
.auth-card-wide { width: min(520px, 100%); }
.auth-card h1 { margin: 0 0 8px; color: var(--heading); }
.auth-card p, .auth-link { color: var(--muted); line-height: 1.85; }
.auth-heading { text-align: center; }
.auth-heading .auth-badge { margin-bottom: 14px; }
.form { display: grid; gap: 16px; margin-top: 22px; }
.compact-form { margin-top: 16px; }
label { display: grid; gap: 8px; color: var(--text); font-weight: 600; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--input-bg);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
}
input::placeholder { color: var(--muted); opacity: .76; }
input:focus { border-color: rgba(168, 85, 247, .75); box-shadow: 0 0 0 4px rgba(168, 85, 247, .13); }
.phone-field { display: grid; grid-template-columns: 72px 1fr; align-items: center; border: 1px solid var(--border); border-radius: 16px; background: var(--input-bg); overflow: hidden; }
.phone-field:focus-within { border-color: rgba(168, 85, 247, .75); box-shadow: 0 0 0 4px rgba(168, 85, 247, .13); }
.phone-field span { display: grid; place-items: center; height: 100%; border-right: 1px solid var(--border); color: var(--muted); font-weight: 700; }
.phone-field input { border: 0; border-radius: 0; box-shadow: none !important; letter-spacing: .4px; }
.field-help { display: block; color: var(--muted); margin-top: -8px; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--border); }
.password-login { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 18px; }
.password-login summary { cursor: pointer; color: var(--muted); text-align: center; font-weight: 600; }
.auth-link { margin-top: 20px; text-align: center; }
.auth-link a, .back-link, .link-button { color: var(--purple2); font-weight: 700; }
.otp-input { text-align: center; font-size: 32px; letter-spacing: 12px; font-weight: 800; direction: ltr; padding-right: 28px; }
.resend-box { min-height: 40px; margin-top: 18px; display: grid; place-items: center; color: var(--muted); }
.resend-box form { margin: 0; }
.link-button { background: transparent; border: 0; cursor: pointer; }
.back-link { display: block; text-align: center; margin-top: 12px; }
.alert, .flash { padding: 13px 16px; border-radius: 16px; margin: 14px auto; }
.alert.error, .flash.error { background: rgba(255, 77, 109, .14); border: 1px solid rgba(255, 77, 109, .35); color: var(--danger-text); }
.flash.success { background: rgba(56, 217, 150, .14); border: 1px solid rgba(56, 217, 150, .35); color: var(--success-text); }
.dashboard { padding: 44px 0 80px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.dash-head h1 { margin: 0 0 6px; font-size: 38px; color: var(--heading); }
.dash-head p { color: var(--muted); margin: 0; }
.profile-heading { display: flex; align-items: center; gap: 15px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 22px; object-fit: cover; border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(139, 92, 246, .22); }
.profile-avatar-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--purple), var(--purple2)); color: white; font-size: 27px; font-weight: 800; }
.stats { display: flex; gap: 12px; }
.stats div { min-width: 120px; padding: 16px; border: 1px solid var(--border); border-radius: 22px; background: var(--panel); }
.stats strong { display: block; font-size: 22px; direction: ltr; }
.stats span { color: var(--muted); }
.upload-panel, .files-card { padding: 24px; margin-top: 18px; }
.upload-panel h2, .files-card h2 { margin: 0 0 16px; color: var(--heading); }
.upload-form { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; }
.file-drop { border: 1px dashed rgba(157, 112, 218, .45); border-radius: 24px; padding: 20px; background: var(--panel); text-align: center; cursor: pointer; }
.file-drop input { display: none; }
.file-icon { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: linear-gradient(135deg, var(--purple), var(--purple2)); color: white; font-size: 32px; margin-bottom: 8px; }
.file-drop small { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.files-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.files-table th, .files-table td { padding: 14px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; }
.files-table th { color: var(--heading); font-weight: 800; }
.file-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-input { direction: ltr; min-width: 260px; padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 22px; }
.footer { border-top: 1px solid var(--border); padding: 22px 0; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.install-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
@media (max-width: 860px) {
    .hero-grid, .features { grid-template-columns: 1fr; }
    .upload-form { grid-template-columns: 1fr; }
    .dash-head { align-items: flex-start; flex-direction: column; }
    .stats { width: 100%; }
    .stats div { flex: 1; }
    .nav { gap: 3px; font-size: 13px; }
    .nav > a:first-child { display: none; }
    .brand span:last-child { display: none; }
}
@media (max-width: 560px) {
    .container { width: min(100% - 20px, 1120px); }
    .auth-wrap { padding: 30px 0 50px; }
    .auth-card { padding: 22px 18px; border-radius: 24px; }
    .nav .btn { padding: 10px 11px; }
    .nav > a:not(.btn) { display: none; }
    .theme-toggle { width: 40px; height: 40px; }
    .otp-input { font-size: 28px; letter-spacing: 9px; }
    .profile-heading { align-items: flex-start; }
}

/* v4: فرم ثبت نام موبایلی و بازیابی رمز */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.form-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: -2px;
}
.form-meta-row .field-help { margin: 0; }
.form-meta-row a { color: var(--purple2); font-weight: 700; }
.privacy-note {
    color: var(--muted);
    background: rgba(139, 92, 246, .09);
    border: 1px solid rgba(168, 85, 247, .2);
    border-radius: 15px;
    padding: 12px 14px;
    line-height: 1.8;
    font-size: 14px;
}
@media (max-width: 620px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-meta-row { align-items: flex-start; flex-direction: column; gap: 5px; }
}
