@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --navy: #1c2a5e;
    --blue: #2f4a9e;
    --blue-light: #4f6fd1;
    --bg: #f3f6fd;
    --text: #2a3146;
    --text-muted: #6b7491;
    --border: #e3e7f0;
    --green-bg: #e9f7ee;
    --green-text: #1c6b3e;
    --amber-bg: #fdf3e0;
    --amber-text: #b9750f;
    --red: #c4332f;
    --red-dark: #a82a26;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(28, 42, 94, 0.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    direction: rtl;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* ===== نوار بالا ===== */
.nav {
    background: linear-gradient(135deg, #1c2a5e, #2f4a9e);
    color: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(28, 42, 94, 0.15);
}
.nav .brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
}
.nav .brand .x { color: #8fa8ff; }
.nav .links { display: flex; align-items: center; gap: 18px; }
.nav a {
    color: #cdd9ff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}
.nav a:hover { color: #ffffff; }

/* ===== محتوای صفحه ===== */
.content {
    padding: 48px 24px;
    max-width: 760px;
    margin: 0 auto;
}

.card {
    background: white;
    padding: 28px 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.card h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 18px 0;
}
.card p {
    font-size: 14px;
    color: var(--text);
    margin: 8px 0;
}
.card p strong { color: var(--navy); font-weight: 600; }

/* ===== فرم‌ها ===== */
label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}
input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    transition: border-color 0.15s;
    background: #fafbfd;
}
input:focus {
    outline: none;
    border-color: var(--blue-light);
    background: white;
}

/* ===== دکمه‌ها ===== */
button, a.btn {
    background: linear-gradient(135deg, #2f4a9e, #4f6fd1);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.15s, transform 0.1s;
}
button:hover, a.btn:hover { opacity: 0.92; }
button:active, a.btn:active { transform: scale(0.98); }
.btn-danger { background: linear-gradient(135deg, #c4332f, #a82a26); }

/* ===== پیام‌ها ===== */
.error {
    background: #fdeceb;
    color: var(--red-dark);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    border-right: 3px solid var(--red);
}
.status {
    background: var(--green-bg);
    color: var(--green-text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    border-right: 3px solid var(--green-text);
}

/* ===== نشان وضعیت ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge.on { background: var(--green-bg); color: var(--green-text); }
.badge.off { background: var(--amber-bg); color: var(--amber-text); }

/* ===== صفحه‌ی ورود (تمام‌صفحه) ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.auth-box {
    background: white;
    padding: 44px 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(28, 42, 94, 0.12);
    width: 360px;
}
.auth-box h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
    margin-bottom: 28px;
}
.auth-box p.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: -16px;
    margin-bottom: 24px;
}
.auth-box input[type="text"] {
    text-align: center;
    font-size: 22px;
    letter-spacing: 6px;
}
.auth-box button { width: 100%; padding: 13px; font-size: 15px; }
.secret-box {
    background: var(--bg);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    direction: ltr;
    text-align: center;
    margin-bottom: 20px;
    word-break: break-all;
    color: var(--text-muted);
}
