@font-face {
    font-family: 'IranYekan';
    src: url('../fonts/IRANYakanX.woff');
}

@font-face {
    font-family: 'IRANYekanEB';
    src: url('../fonts/IRANYekanX-ExtraBold.woff');
}

@font-face {
    font-family: 'JB';
    src: url('../fonts/JetBrainsMono-Bold.ttf');
}

:root {
    --bg: #050505;
    --bg-soft: #0f0f0f;
    --card: #111111;
    --card-2: #1a1a1a;
    --border: #262626;
    --text: #f0f0f0;
    --muted: #8a8a8a;
    --accent: #38bdf8;
    --accent-2: #0284c7;
    --ok: #4ade80;
    --err: #f87171;
    --warn: #fbbf24;
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'IranYekan', sans-serif;
}

html,
body {
    color-scheme: dark;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.8;
    font-size: 15px;
}

.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(600px 300px at 85% -5%, rgba(56, 189, 248, .12), transparent 70%),
        radial-gradient(500px 280px at 10% 110%, rgba(2, 132, 199, .08), transparent 70%);
    pointer-events: none;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* a:hover {
    opacity: .85;
} */

.shell {
    width: 92%;
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.flash-area {
    padding-top: 18px;
}

.flash {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid;
    font-size: 14px;
}

.flash.ok {
    background: rgba(74, 222, 128, .1);
    border-color: rgba(74, 222, 128, .35);
    color: #4ade80;
}

.flash.err {
    background: rgba(248, 113, 113, .1);
    border-color: rgba(248, 113, 113, .35);
    color: #f87171;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--card-2);
    transition: all .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: #3a3a3a;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #050505;
    box-shadow: 0 6px 20px rgba(56, 189, 248, .35);
}

.btn-primary:hover {
    box-shadow: 0 8px 26px rgba(56, 189, 248, .5);
}

.btn-danger {
    background: rgba(248, 113, 113, .12);
    border: 1px solid rgba(248, 113, 113, .4);
    color: #f87171;
}

.btn-danger:hover {
    background: rgba(248, 113, 113, .22);
}

.btn-ghost {
    background: transparent;
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #a78bfa;
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.6);
}

.btn-locked {
    background: rgba(138, 138, 138, 0.1);
    border: 1px solid rgba(138, 138, 138, 0.35);
    color: #8a8a8a;
    cursor: not-allowed;
    pointer-events: none;
}

body.light-theme .btn-locked {
    background: rgba(138, 138, 138, 0.08);
    border-color: rgba(138, 138, 138, 0.25);
}

/* دکمه ویرایش (سبز) */
.btn-edit {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: #4ade80;
}

.btn-edit:hover {
    background: rgba(74, 222, 128, 0.18);
    border-color: rgba(74, 222, 128, 0.5);
}

body.light-theme .btn-edit {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    color: #16a34a;
}

.btn-lg {
    height: 52px;
    font-size: 16px;
}

.btn-sm {
    height: 42px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 10px;
}

.btn-block {
    width: 100%;
}

.field {
    margin-bottom: 16px;
    text-align: right;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--muted);
}

.input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: #161616;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.q-textarea {
    min-height: 100px;
    max-height: 250px;
    resize: vertical;
    padding: 12px 14px;
    line-height: 1.6;
    font-family: 'IranYekan';
    font-size: 16.6px;
    overflow: hidden;
}

.q-textarea:focus {
    outline: none;
    background: #1a1a1a;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .18);
}

.input:focus {
    outline: none;
    background: #1a1a1a;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .18);
}

.input::placeholder {
    color: #555555;
}

.field-err {
    color: #f87171;
    font-size: 12px;
    margin-top: 4px;
}

.hint {
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
}

.topbar {
    background: rgba(5, 5, 5, .9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 23px;
    font-family: "JB";
}

.logo-img {
    user-select: none;
    width: 55px;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
}

.logo-badge {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #050505;
    font-size: 18px;
    box-shadow: 0 4px 14px rgba(56, 189, 248, .4);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hello {
    color: var(--muted);
    font-size: 13px;
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
}

.auth-card {
    width: 92%;
    max-width: 460px;
    padding: 34px;
}

.auth-card.wide {
    max-width: 560px;
}

.brand {
    text-align: center;
    margin-bottom: 26px;
}

.brand .logo-badge {
    width: 56px;
    height: 56px;
    font-size: 26px;
    border-radius: 16px;
    margin-bottom: 12px;
}

.brand-name {
    font-family: "JB";
    font-size: 28px;
    font-weight: 700;
}

.brand-name span {
    background: linear-gradient(135deg, var(--accent), #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: "JB";
}

.brand-sub {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.auth-alt {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
}

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

.page-title {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.4;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.page-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    text-align: center;
}

.stat-num {
    font-size: 28px;
    background: linear-gradient(135deg, var(--accent), #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.quiz-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color .2s, transform .2s;
}

.quiz-card:hover {
    border-color: rgba(56, 189, 248, .5);
    transform: translateY(-2px);
}

.quiz-title {
    font-size: 17px;
    font-weight: bold;
    line-height: 1.5;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

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

.chip {
    background: var(--card-2);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    color: var(--muted);
}

.chip.hot {
    background: rgba(251, 191, 36, .1);
    border-color: rgba(251, 191, 36, .4);
    color: #fbbf24;
}

.quiz-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.quiz-actions form {
    width: 100%;
    margin: 0;
    display: flex;
}

.quiz-actions form .btn {
    width: 100%;
}

.empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    margin-bottom: 40px;
}

.empty .big {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.form-card {
    margin: 26px 0 16px;
}

.card-title {
    font-size: 18px;
    margin-bottom: 18px;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.5;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.switch-row b {
    color: var(--text);
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 27px;
    flex-shrink: 0;
}

.switch input {
    display: none;
}

.switch .track {
    position: absolute;
    inset: 0;
    background: #222222;
    border-radius: 99px;
    transition: .25s;
    cursor: pointer;
}

.switch .track::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 21px;
    height: 21px;
    background: var(--text);
    border-radius: 50%;
    transition: .25s;
}

.switch input:checked+.track {
    background: var(--accent);
}

.switch input:checked+.track::after {
    transform: translateX(-21px);
}

.q-block {
    margin-bottom: 14px;
    background: var(--card);
}

.q-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.q-num {
    color: var(--accent);
}

.opts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opt-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.opt-line input[type=radio] {
    display: none;
}

.radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: .2s;
}

.opt-line input[type=radio]:checked+.radio-dot {
    border-color: var(--ok);
    background: rgba(74, 222, 128, .2);
}

.opt-line input[type=radio]:checked+.radio-dot::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ok);
    font-size: 12px;
}

.opt-input {
    border-color: #404040;
}

.add-row {
    text-align: center;
    margin: 18px 0;
}

.link-box {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--bg-soft);
    border: 1px dashed var(--accent);
    border-radius: 12px;
    padding: 12px;
    margin: 14px 0;
}

.link-input {
    flex: 1;
    direction: ltr;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--accent);
    font-family: 'FiraCode', Consolas, monospace;
    font-size: 13px;
    outline: none;
    min-width: 0;
}

.back-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.q-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.q-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s;
}

.q-item:hover {
    border-color: rgba(56, 189, 248, 0.3);
}

.q-text {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.7;
}

.q-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.q-num-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #090909;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 2000;
    font-family: 'IRANYekan';
    padding-left: 7px;
    padding-right: 7px;
    border-radius: 3px;
}

.q-text-content {
    flex: 1;
    white-space: pre-wrap;
}

.q-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.q-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.q-option.is-correct {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(74, 222, 128, 0.08);
}

.q-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #090909;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 2000;
    font-family: 'IRANYekan';
    padding-left: 7px;
    padding-right: 7px;
    border-radius: 3px;
}

body.light-theme .q-badge {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 3px 8px rgba(56, 189, 248, 0.2);
}

.opt-label {
    min-width: 38px;
    height: 38px;
    background: var(--card-2);
    border: 2px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    font-family: 'IranYekan';
    color: var(--text);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.q-option.is-correct .opt-label {
    background: var(--ok);
    color: #050505;
    border-color: var(--ok);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
    transform: scale(1.05);
}

.opt-value {
    flex: 1;
    font-family: 'IranYekan';
    font-size: 15px;
    direction: rtl;
    text-align: right;
    color: var(--text);
    letter-spacing: 0.5px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.q-option.is-correct .opt-value {
    font-weight: bold;
    color: var(--ok);
}

.correct-badge {
    font-size: 11px;
    background: var(--ok);
    color: #050505;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: bold;
    white-space: nowrap;
    margin-right: auto;
}

.question-image-wrapper {
    text-align: center;
    margin: 16px 0;
}

.question-image {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    margin: 18px 0 40px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.table th {
    text-align: right;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--muted);
    background: var(--card-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    white-space: nowrap;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: rgba(56, 189, 248, .05);
}

.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 99px;
    font-size: 13px;
}

.badge-score {
    background: rgba(56, 189, 248, .15);
    border: 1px solid rgba(56, 189, 248, .45);
    color: var(--accent);
}

.badge-warn {
    background: rgba(251, 191, 36, .12);
    border: 1px solid rgba(251, 191, 36, .4);
    color: #fbbf24;
}

.badge-ok {
    background: rgba(74, 222, 128, .12);
    border: 1px solid rgba(74, 222, 128, .4);
    color: #4ade80;
}

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

.mini-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.mini-chip.g {
    color: #4ade80;
    border-color: rgba(74, 222, 128, .4);
}

.mini-chip.r {
    color: #f87171;
    border-color: rgba(248, 113, 113, .4);
}

.mini-chip.b {
    color: var(--muted);
}

.review-head {
    margin: 26px 0 16px;
}

.info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.warn-card {
    background: rgba(251, 191, 36, .06);
    border: 1px solid rgba(251, 191, 36, .35);
    margin-bottom: 20px;
}

.warn-card h3 {
    font-size: 15px;
    color: #fbbf24;
    margin-bottom: 10px;
}

.warn-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #fbbf24;
}

.q-card {
    margin-bottom: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.q-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.6;
    max-width: 100%;
}

.q-text-content,
.opt-text {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: justify;
    line-height: 1.6;
}

.question-image-wrapper {
    display: block;
    text-align: center;
    margin: 16px auto;
    max-width: 100%;
}

.question-image {
    display: block;
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 0 auto;
    object-fit: contain;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    max-width: 100%;
}

.opt {
    position: relative;
}

.opt input {
    position: absolute;
    opacity: 0;
}

.opt-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    background: var(--bg-soft);
}

.opt-body:hover {
    border-color: #333333;
}

.opt input:checked+.opt-body {
    border-color: var(--accent);
    background: rgba(56, 189, 248, .1);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .15);
}

.opt-letter {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--card-2);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.opt input:checked+.opt-body .opt-letter {
    background: var(--accent);
    color: #050505;
    border-color: var(--accent);
}

.opt-static {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    font-size: 14px;
    max-width: 100%;
    box-sizing: border-box;
}

.opt-static.correct {
    border-color: rgba(74, 222, 128, .55);
    background: rgba(74, 222, 128, .08);
}

.opt-static.wrong {
    border-color: rgba(248, 113, 113, .55);
    background: rgba(248, 113, 113, .08);
}

.opt-mark {
    flex-shrink: 0;
    font-size: 12px;
    white-space: nowrap;
    font-weight: bold;
    text-align: left;
}

.opt-static.correct .opt-mark {
    color: var(--ok);
}

.opt-static.wrong .opt-mark {
    color: var(--err);
}

body.exam-page,
body.exam-page * {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.exam-shell {
    padding: 20px 0 50px;
}

.exam-top {
    position: sticky;
    top: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    margin-bottom: 18px;
    background: rgba(17, 17, 17, .92);
    backdrop-filter: blur(12px);
}

.exam-title {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.5;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.exam-sub {
    font-size: 12px;
    color: var(--muted);
}

.timer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 18px;
    min-width: 110px;
}

.timer-label {
    font-size: 10px;
    color: var(--muted);
}

.timer {
    font-size: 22px;
    direction: ltr;
    color: var(--accent);
    font-family: 'IranYekan', sans-serif;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.timer-box.danger {
    border-color: rgba(248, 113, 113, .6);
}

.timer-box.danger .timer {
    color: var(--err);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    50% {
        opacity: .45;
    }
}

.exam-hint {
    font-size: 12px;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.warn-chip {
    color: #fbbf24;
}

.result-card {
    text-align: center;
    padding: 40px 24px;
}

.score-ring {
    width: 190px;
    height: 190px;
    margin: 20px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(var(--card), var(--card)) padding-box,
        linear-gradient(135deg, var(--accent), var(--ok)) border-box;
    border: 4px solid transparent;
    box-shadow: 0 10px 40px rgba(56, 189, 248, .25);
}

.score-num {
    font-size: 44px;
    font-family: 'IRANYekan';
    color: var(--text);
}

.score-num small {
    font-size: 16px;
    color: var(--muted);
    font-weight: 400;
}

.percent-text {
    color: var(--muted);
    margin-bottom: 24px;
}

.msg-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-card {
    width: 92%;
    max-width: 440px;
    text-align: center;
    padding: 40px 28px;
}

.msg-icon {
    font-size: 46px;
    display: block;
    margin-bottom: 14px;
}

.msg-title {
    font-size: 20px;
    margin-bottom: 8px;
}

.msg-text {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 22px;
}

.student-quiz-title {
    text-align: center;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.5;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.exam-shell .q-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.6;
    max-width: 100%;
}

.exam-shell .opt-body {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.5;
}

.exam-shell .opt-letter {
    flex-shrink: 0;
    margin-top: 2px;
}

.custom-file-upload {
    position: relative;
    width: 100%;
    height: 90px;
}

.custom-file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    color: var(--muted);
    transition: all 0.3s ease;
    pointer-events: none;
}

.custom-file-upload input[type="file"]:hover+.file-upload-label {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.05);
    color: var(--accent);
}

.upload-icon {
    margin-right: 10px;
    font-size: 26px;
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
}

.file-selected {
    border-color: var(--ok) !important;
    background: rgba(74, 222, 128, 0.08) !important;
    color: var(--ok) !important;
}

@media (max-width: 760px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

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

    .hello {
        display: none;
    }

    .exam-top {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-card {
        padding: 24px;
    }

    .q-block {
        padding: 16px;
    }

    .card {
        padding: 18px;
    }

    .q-options {
        grid-template-columns: 1fr;
    }
}

::-webkit-scrollbar {
    width: 10.5px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #101010;
    border-radius: 40px;
}

::-webkit-scrollbar-thumb:hover {
    background: #202020;
}

.btn-primary.btn-sm {
    box-shadow: 0 4px 14px rgba(56, 189, 248, .25);
}

.progress-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.progress-track {
    height: 8px;
    background: var(--bg-soft);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--ok));
    border-radius: 99px;
    transition: width 0.4s ease;
    width: 0%;
}

body.light-theme {
    --bg: #f5f5f5;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --card-2: #f0f0f0;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --muted: #666666;
}

body.light-theme .exam-top {
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--border);
}

body.light-theme .bg-glow {
    display: none;
}

body.light-theme .topbar {
    background: rgba(255, 255, 255, .95);
    border-bottom-color: #e0e0e0;
}

body.light-theme .topbar-actions .hello {
    color: #666666;
}

body.light-theme .btn-ghost {
    color: #1a1a1a;
    border-color: #e0e0e0;
}

body.light-theme .btn-ghost:hover {
    background: #f0f0f0;
}

body.light-theme .input {
    background: #ffffff;
    border-color: #d0d0d0;
    color: #1a1a1a;
}

body.light-theme .input:focus {
    background: #fafafa;
}

body.light-theme .flash.ok {
    background: rgba(74, 222, 128, .15);
}

body.light-theme .flash.err {
    background: rgba(248, 113, 113, .15);
}

body.light-theme .profile-card,
body.light-theme .settings-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

body.light-theme .danger-zone {
    background: rgba(248, 113, 113, .03);
}

.theme-toggle-btn {
    position: fixed;
    bottom: 15px;
    left: 15px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
    transition: all .25s ease;
    z-index: 100;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent);
    box-shadow: 0 6px 24px rgba(56, 189, 248, .3);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    font-size: 14px;
    color: var(--muted);
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.info-username {
    font-family: 'JB', 'IRANYekan';
    direction: ltr;
    background: var(--bg-soft);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.settings-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.settings-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.settings-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.settings-title {
    font-size: 17px;
    font-weight: bold;
    margin: 0 0 4px 0;
}

.settings-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

.danger-zone {
    border-color: rgba(248, 113, 113, .3);
    background: rgba(248, 113, 113, .02);
}

.danger-zone .settings-header {
    border-bottom-color: rgba(248, 113, 113, .15);
}

b {
    font-family: 'IRANYekanEB';
    font-weight: 900;
}

.support-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    margin-top: 24px;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.support-card:hover {
    border-color: var(--accent);
    background: var(--bg-soft);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15);
}

.support-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.support-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.support-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--text);
}

.support-desc {
    font-size: 13px;
    color: var(--muted);
}

.support-arrow {
    font-size: 20px;
    color: var(--muted);
    transition: transform 0.25s ease;
}

.support-card:hover .support-arrow {
    transform: translateX(-6px);
    color: var(--accent);
}

body.light-theme .support-card:hover {
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.1);
}

body.light-theme .support-icon {
    background: rgba(56, 189, 248, 0.15);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 26px;
}

.admin-section {
    margin-top: 24px;
}

.admin-table {
    min-width: 600px;
}

.admin-table .td-name {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table .td-username {
    direction: ltr;
    text-align: right;
    font-family: 'JB', monospace;
    font-size: 13px;
}

.admin-table .td-center {
    text-align: right;
}

.admin-table .td-date {
    white-space: nowrap;
}

.admin-chip {
    background: rgba(74, 222, 128, 0.1);
    color: var(--ok);
    border-color: rgba(74, 222, 128, 0.3);
    font-size: 11px;
}

.admin-hello {
    font-weight: bold;
    color: var(--warn);
}

@media (max-width: 480px) {
    .hide-mobile {
        display: none;
    }

    .admin-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-num {
        font-size: 20px;
    }

    .admin-table {
        min-width: 350px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .admin-table .td-name {
        max-width: 120px;
    }

    .btn-sm {
        height: 34px;
        padding: 0 10px;
        font-size: 11px;
    }

    .page-title {
        font-size: 18px;
    }

    .page-sub {
        font-size: 12px;
    }

    .card {
        padding: 14px;
    }

    .card-title {
        font-size: 15px;
        margin-bottom: 14px;
    }

    .hello {
        display: none;
    }

    .admin-hello {
        display: inline;
        font-size: 12px;
    }
}

.q-option.is-wrong {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(248, 113, 113, 0.08);
}

.q-option.is-wrong .opt-label {
    background: var(--err);
    color: #050505;
    border-color: var(--err);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.4);
}

.q-option.is-wrong .opt-value {
    font-weight: bold;
    color: var(--err);
}

.wrong-badge {
    font-size: 11px;
    background: var(--err);
    color: #050505;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: bold;
    white-space: nowrap;
    margin-right: auto;
}

.quiz-actions form {
    width: 100%;
    margin: 0;
    display: flex;
}

.quiz-actions form .btn {
    width: 100%;
}

.btn-copy {
    background: rgba(247, 255, 3, 0.1);
    border: 1.5px dashed rgba(254, 254, 3, 0.5);
    color: #fbbf24;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-copy:hover {
    background: rgba(237, 245, 2, 0.18);
    border-color: rgba(255, 251, 2, 0.7);
    color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.2);
}

body.light-theme .btn-copy {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
    color: #d97706;
}

body.light-theme .btn-copy:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(245, 158, 11, 0.6);
    color: #b45309;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}

.landing-hero {
    text-align: center;
    padding: 80px 0 60px;
    position: relative;
}

.landing-badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 13px;
    margin-bottom: 20px;
}

.landing-title {
    font-size: 40px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.3;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.landing-subtitle {
    font-size: 17px;
    color: var(--muted);
    max-width: 650px;
    margin: 0 auto 30px;
    line-height: 1.8;
}

.landing-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-section-title {
    text-align: center;
    margin-bottom: 40px;
}

.landing-section-title h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.landing-section-title p {
    color: var(--muted);
    font-size: 15px;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 80px;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.1);
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size: 17px;
    margin-bottom: 10px;
    color: var(--text);
}

.feature-card p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
}

.landing-faq {
    max-width: 800px;
    margin: 0 auto 80px;
}

.landing-faq h2 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 30px;
}

.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 14px;
}

.faq-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--accent);
}

.faq-item p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
}

.landing-final-cta {
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 50px 30px;
    margin-bottom: 40px;
}

.landing-final-cta h2 {
    font-size: 26px;
    margin-bottom: 10px;
}

.landing-final-cta p {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .landing-hero {
        padding: 50px 0 40px;
    }

    .landing-title {
        font-size: 28px;
    }

    .landing-subtitle {
        font-size: 15px;
    }

    .landing-features {
        grid-template-columns: 1fr;
    }

    .landing-section-title h2,
    .landing-faq h2 {
        font-size: 22px;
    }
}

.qt {
    font-family: "JB";
    color: #0284c7;
    display: inline;
}

.btn-lock {
    background: rgba(251, 191, 36, 0.1);
    border: 1.5px solid rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-lock:hover {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.7);
    color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.2);
}

.btn-unlock {
    background: rgba(74, 222, 128, 0.1);
    border: 1.5px solid rgba(74, 222, 128, 0.5);
    color: #4ade80;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-unlock:hover {
    background: rgba(74, 222, 128, 0.18);
    border-color: rgba(74, 222, 128, 0.7);
    color: #22c55e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(74, 222, 128, 0.2);
}

body.light-theme .btn-lock {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
    color: #d97706;
}

body.light-theme .btn-lock:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(245, 158, 11, 0.6);
    color: #b45309;
}

body.light-theme .btn-unlock {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(22, 163, 74, 0.4);
    color: #15803d;
}

body.light-theme .btn-unlock:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(22, 163, 74, 0.6);
    color: #166534;
}

.quiz-locked {
    opacity: 0.75;
    border-color: rgba(251, 191, 36, 0.3);
}

.lock-badge {
    display: inline-block;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 6px;
    margin-right: 8px;
    font-weight: bold;
    vertical-align: middle;
}

body.light-theme .lock-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.score-summary {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-soft);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.summary-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
}

.q-score-badge {
    display: inline-block;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    margin-right: auto;
    font-weight: bold;
}

.q-result {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.result-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.result-badge.correct {
    background: rgba(74, 222, 128, 0.15);
    color: var(--ok);
}

.result-badge.wrong {
    background: rgba(248, 113, 113, 0.15);
    color: var(--err);
}

.result-badge.blank {
    background: rgba(148, 163, 184, 0.15);
    color: var(--muted);
}

.q-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.q-title-header .q-badge,
.q-title-header .q-score-badge {
    min-width: auto;
    text-align: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px 7px;
    margin: 2.5px;
    border-radius: 10px;
}

.q-text-content {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    margin: 10px 0;
    margin-bottom: 16px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text);
}

.q-score-badge {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
    font-weight: bold;
}

.shuffle-note {
    background: rgba(251, 191, 36, 0.1) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}

.info-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.info-chips .badge,
.info-chips .mini-chip {
    margin: 0;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
}

.btn-link-detail {
    background: rgba(6, 182, 212, 0.1);
    border: 1.5px solid rgba(6, 182, 212, 0.5);
    color: #22d3ee;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-link-detail:hover {
    background: rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.7);
    color: #67e8f9;
}

body.light-theme .btn-link-detail {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.4);
    color: #0284c7;
}

body.light-theme .btn-link-detail:hover {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.6);
    color: #0369a1;
}