/* =========================================================
   SLM Student Dashboard — نسخه کامل و تمیز
========================================================= */

/* ---------------------------------------------------------
   ۱) متغیرها و پایه
--------------------------------------------------------- */

.slm-dashboard {
    --slm-orange: #f97316;
    --slm-orange-soft: #fff7ed;
    --slm-navy: #1e3152;
    --slm-text: #111827;
    --slm-muted: #64748b;
    --slm-bg: #f8fafc;
    --slm-white: #fff;
    --slm-border: #e5e7eb;
    --slm-green: #16a34a;
    --slm-red: #dc2626;

    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    background: var(--slm-bg);
    color: var(--slm-text);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* ---------------------------------------------------------
   ۲) هدر داشبورد
--------------------------------------------------------- */

.slm-header {
    background: linear-gradient(135deg, #17243b, #263d61);
    color: #fff;
    padding: 18px 20px;
}

.slm-header-inner {
    max-width: 1050px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.slm-user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slm-user-badge img {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.slm-user-badge strong {
    display: block;
    font-size: 16px;
}

.slm-level-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    margin-top: 4px;
}

.slm-logout {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    transition: 0.2s;
}

.slm-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------------------------------------------------------
   ۳) استیج‌ها و کارت‌ها
--------------------------------------------------------- */

.slm-stage {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

.slm-card {
    background: var(--slm-white);
    border: 1px solid var(--slm-border);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
    margin-bottom: 20px;
}

.slm-card h2,
.slm-card h3 {
    margin: 0 0 12px;
    color: var(--slm-navy);
}

.slm-muted {
    color: var(--slm-muted);
    font-size: 14px;
    line-height: 1.9;
}

/* ---------------------------------------------------------
   ۴) انتخاب پایه
--------------------------------------------------------- */

.slm-grade-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.slm-grade-btn {
    background: var(--slm-orange-soft);
    border: 2px solid transparent;
    color: var(--slm-navy);
    padding: 22px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s;
}

.slm-grade-btn:hover {
    border-color: var(--slm-orange);
    transform: translateY(-2px);
}

/* ---------------------------------------------------------
   ۵) مقدمه آزمون
--------------------------------------------------------- */

.slm-stage-intro .slm-card {
    text-align: center;
    padding: 45px 30px;
}

.slm-intro-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.slm-current-grade {
    display: inline-block;
    background: var(--slm-orange-soft);
    color: var(--slm-orange);
    padding: 10px 24px;
    border-radius: 30px;
    margin: 20px 0 25px;
    font-size: 14px;
}

.slm-current-grade strong {
    color: var(--slm-navy);
    margin-right: 6px;
}

.slm-intro-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.slm-secondary-btn {
    background: transparent;
    border: 1px solid var(--slm-border);
    color: var(--slm-muted);
    padding: 14px 26px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.slm-secondary-btn:hover {
    border-color: var(--slm-orange);
    color: var(--slm-orange);
    background: var(--slm-orange-soft);
}

/* ---------------------------------------------------------
   ۶) اجرای آزمون
--------------------------------------------------------- */

.slm-exit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--slm-border);
    border-radius: 12px;
    padding: 10px 18px;
    margin-bottom: 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    color: var(--slm-muted);
    cursor: pointer;
    transition: 0.2s;
}

.slm-exit-btn:hover {
    border-color: #fca5a5;
    color: var(--slm-red);
    background: #fef2f2;
}

.slm-exit-btn::before {
    content: "←";
    font-size: 16px;
}

.slm-run-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.slm-progress {
    flex: 1;
    min-width: 200px;
}

.slm-progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 8px;
}

.slm-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #f97316, #fb923c);
    border-radius: inherit;
    transition: width 0.3s;
}

.slm-progress-text {
    font-size: 13px;
    color: var(--slm-muted);
}

.slm-run-mode {
    background: var(--slm-orange-soft);
    color: var(--slm-orange);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: bold;
}

/* ---------------------------------------------------------
   ۷) تایمر آزمون
--------------------------------------------------------- */

.slm-run-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid var(--slm-border);
    border-radius: 30px;
    padding: 8px 16px;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: var(--slm-navy);
    min-width: 100px;
    justify-content: center;
}

.slm-timer-icon {
    font-size: 16px;
    color: var(--slm-orange);
}

.slm-timer-value {
    direction: ltr;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.slm-run-timer.slm-timer-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: var(--slm-orange);
}

.slm-run-timer.slm-timer-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--slm-red);
    animation: slm-timer-pulse 1.5s infinite;
}

@keyframes slm-timer-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

/* ---------------------------------------------------------
   ۸) سؤال و گزینه‌ها
--------------------------------------------------------- */

.slm-question-text {
    font-size: 18px;
    line-height: 2;
    margin-bottom: 22px;
    color: var(--slm-text);
}

.slm-question-text img {
    max-width: 100%;
    border-radius: 12px;
    margin: 10px 0;
}

.slm-options-list {
    display: grid;
    gap: 12px;
}

.slm-option {
    display: block;
    width: 100%;
    text-align: right;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid var(--slm-border);
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    color: var(--slm-text);
    line-height: 1.7;
    transition: 0.2s;
}

.slm-option:hover:not(:disabled) {
    border-color: var(--slm-orange);
    background: var(--slm-orange-soft);
}

.slm-option.selected {
    border-color: var(--slm-orange);
    background: var(--slm-orange-soft);
}

.slm-option.correct {
    border-color: var(--slm-green);
    background: #ecfdf5;
    color: var(--slm-green);
}

.slm-option.wrong {
    border-color: var(--slm-red);
    background: #fef2f2;
    color: var(--slm-red);
}

.slm-option:disabled {
    cursor: default;
}

/* ---------------------------------------------------------
   ۹) فیدبک
--------------------------------------------------------- */

.slm-feedback {
    padding: 18px 22px;
    border-radius: 15px;
    margin-top: 20px;
    line-height: 1.9;
}

.slm-feedback.ok {
    background: #ecfdf5;
    color: var(--slm-green);
    border: 1px solid #bbf7d0;
}

.slm-feedback.err {
    background: #fef2f2;
    color: var(--slm-red);
    border: 1px solid #fecaca;
}

/* ---------------------------------------------------------
   ۱۰) نتیجه آزمون
--------------------------------------------------------- */

.slm-stage-result .slm-card {
    text-align: center;
    padding: 45px 30px;
}

.slm-result-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.slm-result-level {
    display: inline-block;
    background: var(--slm-orange-soft);
    color: var(--slm-orange);
    padding: 12px 34px;
    border-radius: 40px;
    font-size: 22px;
    font-weight: bold;
    margin: 20px 0;
}

.slm-result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 25px;
}

.slm-result-stats strong {
    display: block;
    font-size: 28px;
    color: var(--slm-navy);
}

.slm-result-stats span {
    font-size: 12px;
    color: var(--slm-muted);
}

/* ---------------------------------------------------------
   ۱۱) تب‌های داشبورد
--------------------------------------------------------- */

.slm-tabs {
    display: flex;
    gap: 8px;
    background: var(--slm-white);
    padding: 8px;
    border-radius: 16px;
    margin-bottom: 20px;
    overflow-x: auto;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.05);
}

.slm-tab {
    background: transparent;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    color: var(--slm-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.slm-tab.active {
    background: var(--slm-orange);
    color: #fff;
}

.slm-tab-content {
    display: none;
}

.slm-tab-content.active {
    display: block;
}

/* ---------------------------------------------------------
   ۱۲) کارت‌های خلاصه
--------------------------------------------------------- */

.slm-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.slm-summary-card {
    background: var(--slm-white);
    border: 1px solid var(--slm-border);
    border-radius: 18px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.04);
}

.slm-summary-card span {
    display: block;
    color: var(--slm-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.slm-summary-card strong {
    font-size: 22px;
    color: var(--slm-navy);
}

/* ---------------------------------------------------------
   ۱۳) فصل‌ها
--------------------------------------------------------- */

.slm-chapters-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.slm-chapter-card {
    background: #fff;
    border: 1px solid var(--slm-border);
    border-radius: 15px;
    padding: 18px;
    cursor: pointer;
    transition: 0.2s;
}

.slm-chapter-card:hover {
    border-color: var(--slm-orange);
    transform: translateY(-3px);
}

.slm-chapter-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slm-chapter-name {
    font-size: 15px;
    font-weight: bold;
    color: var(--slm-navy);
    display: block;
    margin-bottom: 10px;
}

.slm-chapter-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 8px;
}

.slm-chapter-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb923c);
    border-radius: inherit;
    transition: width 0.4s;
}

.slm-chapter-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--slm-muted);
}

/* ---------------------------------------------------------
   ۱۴) من را بشناس — نوارها
--------------------------------------------------------- */

.slm-difficulty-list,
.slm-errors-list {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

.slm-bar-item {
    display: grid;
    grid-template-columns: 130px 1fr 60px;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.slm-bar-item .bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 30px;
    overflow: hidden;
}

.slm-bar-item .bar > div {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb923c);
    border-radius: inherit;
    transition: width 0.4s;
}

.slm-bar-item strong {
    color: var(--slm-orange);
    text-align: left;
    font-size: 13px;
}

/* ---------------------------------------------------------
   ۱۵) روند پیشرفت
--------------------------------------------------------- */

.slm-trend {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 180px;
    padding: 20px 10px;
    gap: 8px;
    background: #f8fafc;
    border-radius: 15px;
    margin-top: 15px;
}

.slm-trend-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.slm-trend-bar > div:first-child {
    width: 100%;
    max-width: 50px;
    background: linear-gradient(180deg, #f97316, #fb923c);
    border-radius: 8px 8px 0 0;
    transition: height 0.4s;
    min-height: 4px;
}

.slm-trend-bar span {
    font-size: 11px;
    color: var(--slm-muted);
}

/* ---------------------------------------------------------
   ۱۶) مودال دلیل اشتباه
--------------------------------------------------------- */

.slm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.slm-modal {
    background: #fff;
    border-radius: 22px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.slm-modal h3 {
    margin: 0 0 10px;
    color: var(--slm-navy);
}

.slm-reason-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.slm-reason-btn {
    background: #f8fafc;
    border: 1px solid var(--slm-border);
    border-radius: 12px;
    padding: 14px 10px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}

.slm-reason-btn:hover {
    background: var(--slm-orange-soft);
    border-color: var(--slm-orange);
    color: var(--slm-orange);
}

.slm-skip-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--slm-border);
    padding: 12px;
    border-radius: 10px;
    font-family: inherit;
    cursor: pointer;
    color: var(--slm-muted);
}

/* =========================================================
   ۱۷) صفحه ورود / ثبت‌نام — تم فیزیک
========================================================= */

.slm-login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
    overflow: hidden;
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    background: radial-gradient(
        ellipse at top,
        #1e3152 0%,
        #0d1a2e 50%,
        #060d18 100%
    );
    color: #e2e8f0;
}

/* ---------------------------------------------------------
   پس‌زمینه ستاره‌ای
--------------------------------------------------------- */

.slm-space-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.slm-particles {
    position: absolute;
    inset: 0;
}

.slm-particles i {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0.7;
    animation: slm-twinkle 3s infinite ease-in-out;
}

@keyframes slm-twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50%      { opacity: 0.9; transform: scale(1.5); }
}

/* ---------------------------------------------------------
   فرمول‌های شناور
--------------------------------------------------------- */

.slm-formula {
    position: absolute;
    left: var(--x);
    top: var(--y);
    font-family: 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-weight: bold;
    font-size: calc(22px * var(--s, 1));
    color: rgba(249, 115, 22, 0.18);
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
    animation: slm-float 18s ease-in-out infinite;
    animation-delay: var(--d, 0s);
    user-select: none;
    white-space: nowrap;
    letter-spacing: 1px;
}

@keyframes slm-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.15;
    }
    25% {
        transform: translate(20px, -25px) rotate(3deg);
        opacity: 0.35;
    }
    50% {
        transform: translate(-15px, 15px) rotate(-2deg);
        opacity: 0.25;
    }
    75% {
        transform: translate(15px, 20px) rotate(4deg);
        opacity: 0.3;
    }
}

/* ---------------------------------------------------------
   اتم چرخان
--------------------------------------------------------- */

.slm-atom {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    transform: translate(-50%, -50%);
    opacity: 0.25;
    pointer-events: none;
}

.slm-atom-nucleus {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 90px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, #fb923c, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 42px;
    font-weight: bold;
    font-family: 'Times New Roman', serif;
    font-style: italic;
    box-shadow:
        0 0 40px rgba(249, 115, 22, 0.6),
        0 0 80px rgba(249, 115, 22, 0.3);
    animation: slm-nucleus-pulse 4s infinite ease-in-out;
}

@keyframes slm-nucleus-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -50%) scale(1.08); }
}

.slm-atom-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1.5px solid rgba(249, 115, 22, 0.35);
    border-radius: 50%;
    transform-origin: center;
}

.slm-atom-orbit i {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fb923c;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(251, 146, 60, 0.9);
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.orbit-1 {
    width: 500px;
    height: 180px;
    animation: slm-orbit-spin-1 10s linear infinite;
}

.orbit-2 {
    width: 180px;
    height: 500px;
    animation: slm-orbit-spin-2 14s linear infinite;
}

.orbit-3 {
    width: 500px;
    height: 500px;
    animation: slm-orbit-spin-3 20s linear infinite;
}

@keyframes slm-orbit-spin-1 {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes slm-orbit-spin-2 {
    from { transform: translate(-50%, -50%) rotate(60deg); }
    to   { transform: translate(-50%, -50%) rotate(420deg); }
}

@keyframes slm-orbit-spin-3 {
    from { transform: translate(-50%, -50%) rotate(-45deg); }
    to   { transform: translate(-50%, -50%) rotate(315deg); }
}

/* ---------------------------------------------------------
   کارت اصلی — Glassmorphism
--------------------------------------------------------- */

.slm-auth-box {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    padding: 35px 30px 30px;
    max-width: 440px;
    width: 100%;
    box-sizing: border-box;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: slm-card-in 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slm-card-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------------------------------------------------------
   لوگو
--------------------------------------------------------- */

.slm-auth-logo {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slm-auth-logo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(249, 115, 22, 0.4);
    animation: slm-logo-ring 3s linear infinite;
}

.slm-auth-logo-ring::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #f97316;
    border-radius: 50%;
    box-shadow: 0 0 15px #f97316;
}

@keyframes slm-logo-ring {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.slm-auth-logo-icon {
    font-size: 40px;
    filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.6));
    animation: slm-logo-pulse 3s ease-in-out infinite;
}

@keyframes slm-logo-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.1); }
}

/* ---------------------------------------------------------
   عنوان‌های صفحه ورود
--------------------------------------------------------- */

.slm-auth-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
    letter-spacing: -0.5px;
}

.slm-auth-subtitle {
    margin: 0 0 25px;
    font-size: 13px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.5px;
}

/* ---------------------------------------------------------
   تب‌های ورود / ثبت‌نام
--------------------------------------------------------- */

.slm-auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.slm-auth-tab {
    flex: 1;
    background: transparent !important;
    border: none !important;
    padding: 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    z-index: 1;
    box-shadow: none !important;
    text-shadow: none !important;
}

.slm-auth-tab.active {
    background: linear-gradient(135deg, #f97316, #fb923c) !important;
    color: #ffffff !important;
    box-shadow:
        0 4px 20px rgba(249, 115, 22, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* ---------------------------------------------------------
   فرم‌های ورود
--------------------------------------------------------- */

.slm-auth-form {
    display: none;
}

.slm-auth-form.active {
    display: block;
    animation: slm-form-in 0.4s ease;
}

@keyframes slm-form-in {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.slm-auth-form h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #ffffff;
    text-align: center;
    font-weight: 700;
}

.slm-auth-desc {
    margin: 0 0 22px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    line-height: 1.8;
}

.slm-auth-form label {
    display: block;
    margin-bottom: 16px;
}

.slm-auth-form label > span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.75);
}

.slm-auth-form label small {
    font-weight: normal;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
}

.slm-auth-form input[type="text"],
.slm-auth-form input[type="email"],
.slm-auth-form input[type="password"] {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    font-family: inherit;
    font-size: 14px;
    color: #ffffff;
    box-sizing: border-box;
    transition: 0.25s;
}

.slm-auth-form input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.slm-auth-form input[type="text"]:focus,
.slm-auth-form input[type="email"]:focus,
.slm-auth-form input[type="password"]:focus {
    outline: none;
    border-color: rgba(249, 115, 22, 0.7);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

/* ---------------------------------------------------------
   چک‌باکس
--------------------------------------------------------- */

.slm-auth-checkbox {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px !important;
}

.slm-auth-checkbox input {
    width: 16px !important;
    height: 16px !important;
    accent-color: #f97316;
    margin: 0 !important;
    padding: 0 !important;
}

.slm-auth-checkbox span {
    margin: 0 !important;
}

/* ---------------------------------------------------------
   دکمه‌های ورود / ثبت‌نام — ضدگلوله
--------------------------------------------------------- */

.slm-login-page .slm-primary-btn,
.slm-login-page .slm-auth-submit,
.slm-login-page button[type="submit"] {
    all: unset;
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    padding: 15px 24px !important;
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    font-family: Tahoma, Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 1.5 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    box-shadow:
        0 8px 24px rgba(249, 115, 22, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
}

.slm-login-page .slm-primary-btn::before,
.slm-login-page .slm-auth-submit::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s;
}

.slm-login-page .slm-primary-btn:hover,
.slm-login-page .slm-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 32px rgba(249, 115, 22, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.slm-login-page .slm-primary-btn:hover::before,
.slm-login-page .slm-auth-submit:hover::before {
    left: 100%;
}

.slm-login-page .slm-primary-btn:active,
.slm-login-page .slm-auth-submit:active {
    transform: translateY(0);
}

.slm-login-page .slm-primary-btn:disabled,
.slm-login-page .slm-auth-submit:disabled {
    background: linear-gradient(135deg, #64748b, #94a3b8) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* ---------------------------------------------------------
   دکمه اصلی برای بقیه صفحات (داشبورد)
--------------------------------------------------------- */

.slm-dashboard .slm-primary-btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--slm-orange);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.slm-dashboard .slm-primary-btn:hover:not(:disabled) {
    background: #ea580c;
    transform: translateY(-2px);
}

.slm-dashboard .slm-primary-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* ---------------------------------------------------------
   پیام خطا در فرم ورود
--------------------------------------------------------- */

.slm-login-page .slm-auth-error {
    margin-top: 15px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.7;
    display: none;
    text-align: center;
    backdrop-filter: blur(10px);
}

.slm-login-page .slm-auth-error.show {
    display: block;
    animation: slm-error-in 0.3s ease;
}

@keyframes slm-error-in {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.slm-login-page .slm-auth-error.error {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.slm-login-page .slm-auth-error.success {
    background: rgba(22, 163, 74, 0.15);
    color: #86efac;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

/* ---------------------------------------------------------
   لینک فراموشی رمز
--------------------------------------------------------- */

.slm-auth-forgot {
    text-align: center;
    margin: 15px 0 0;
}

.slm-auth-forgot a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 2px;
    transition: 0.2s;
}

.slm-auth-forgot a:hover {
    color: #fb923c;
    border-bottom-color: #fb923c;
}

/* =========================================================
   ۱۸) موبایل
========================================================= */

@media (max-width: 900px) {

    .slm-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .slm-chapters-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {

    .slm-summary-cards,
    .slm-chapters-grid,
    .slm-grade-grid,
    .slm-reason-grid {
        grid-template-columns: 1fr;
    }

    .slm-bar-item {
        grid-template-columns: 100px 1fr 50px;
    }

    .slm-tabs {
        overflow-x: auto;
    }

    .slm-result-stats {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 600px) {

    .slm-run-timer {
        font-size: 13px;
        padding: 6px 12px;
        min-width: 85px;
    }
}

@media (max-width: 500px) {

    .slm-login-page {
        padding: 40px 15px 30px;
    }

    .slm-auth-box {
        padding: 28px 22px 25px;
        border-radius: 22px;
    }

    .slm-auth-title {
        font-size: 19px;
    }

    .slm-auth-form h2 {
        font-size: 18px;
    }

    .slm-atom {
        width: 400px;
        height: 400px;
    }

    .orbit-1 { width: 300px; height: 110px; }
    .orbit-2 { width: 110px; height: 300px; }
    .orbit-3 { width: 300px; height: 300px; }

    .slm-formula {
        font-size: calc(16px * var(--s, 1));
    }

    .slm-auth-logo {
        width: 65px;
        height: 65px;
    }

    .slm-auth-logo-icon {
        font-size: 32px;
    }
}
/* =========================================================
   FIX — موبایل: صفحه ورود حتماً تم فیزیکی داشته باشد
========================================================= */

@media (max-width: 900px) {

    /* خود صفحه — تضمین پس‌زمینه تیره */
    .slm-login-page {
        position: relative !important;
        min-height: 100vh !important;
        padding: 40px 20px 30px !important;
        background: radial-gradient(
            ellipse at top,
            #1e3152 0%,
            #0d1a2e 50%,
            #060d18 100%
        ) !important;
        color: #e2e8f0 !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        direction: rtl !important;
    }

    /* کارت شیشه‌ای */
    .slm-login-page .slm-auth-box {
        position: relative !important;
        z-index: 2 !important;
        width: 100% !important;
        max-width: 440px !important;
        padding: 28px 22px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-radius: 22px !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
        box-sizing: border-box !important;
    }

    /* عنوان‌ها */
    .slm-login-page .slm-auth-title {
        color: #ffffff !important;
        font-size: 19px !important;
        text-align: center !important;
    }

    .slm-login-page .slm-auth-subtitle {
        color: rgba(255, 255, 255, 0.55) !important;
        text-align: center !important;
    }

    .slm-login-page .slm-auth-form h2 {
        color: #ffffff !important;
        font-size: 18px !important;
    }

    .slm-login-page .slm-auth-desc {
        color: rgba(255, 255, 255, 0.5) !important;
    }

    /* برچسب‌ها */
    .slm-login-page .slm-auth-form label > span {
        color: rgba(255, 255, 255, 0.75) !important;
    }

    /* ورودی‌ها — این مهم‌ترینه */
    .slm-login-page .slm-auth-form input[type="text"],
    .slm-login-page .slm-auth-form input[type="email"],
    .slm-login-page .slm-auth-form input[type="password"] {
        width: 100% !important;
        padding: 13px 16px !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-radius: 12px !important;
        background: rgba(0, 0, 0, 0.25) !important;
        color: #ffffff !important;
        font-family: inherit !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }

    .slm-login-page .slm-auth-form input::placeholder {
        color: rgba(255, 255, 255, 0.25) !important;
    }

    .slm-login-page .slm-auth-form input:focus {
        outline: none !important;
        border-color: rgba(249, 115, 22, 0.7) !important;
        background: rgba(0, 0, 0, 0.4) !important;
        box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15) !important;
    }

    /* تب‌ها */
    .slm-login-page .slm-auth-tabs {
        background: rgba(0, 0, 0, 0.25) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 14px !important;
    }

    .slm-login-page .slm-auth-tab {
        color: rgba(255, 255, 255, 0.5) !important;
        background: transparent !important;
    }

    .slm-login-page .slm-auth-tab.active {
        background: linear-gradient(135deg, #f97316, #fb923c) !important;
        color: #ffffff !important;
    }

    /* دکمه */
    .slm-login-page .slm-auth-submit,
    .slm-login-page button[type="submit"] {
        display: block !important;
        width: 100% !important;
        padding: 15px 24px !important;
        background: linear-gradient(135deg, #f97316 0%, #fb923c 100%) !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 14px !important;
        font-family: Tahoma, Arial, sans-serif !important;
        font-size: 16px !important;
        font-weight: bold !important;
        text-align: center !important;
        cursor: pointer !important;
        opacity: 1 !important;
        visibility: visible !important;
        min-height: 52px !important;
        margin-top: 8px !important;
        box-sizing: border-box !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4) !important;
    }

    /* چک‌باکس */
    .slm-login-page .slm-auth-checkbox {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        color: rgba(255, 255, 255, 0.7) !important;
    }

    .slm-login-page .slm-auth-checkbox input {
        width: 16px !important;
        height: 16px !important;
        accent-color: #f97316 !important;
        margin: 0 !important;
    }

    /* لینک فراموشی رمز */
    .slm-login-page .slm-auth-forgot a {
        color: rgba(255, 255, 255, 0.5) !important;
    }

    /* آسمان و اتم کوچیک‌تر */
    .slm-login-page .slm-atom {
        width: 420px !important;
        height: 420px !important;
    }

    .slm-login-page .slm-atom-nucleus {
        width: 70px !important;
        height: 70px !important;
        font-size: 32px !important;
    }

    .slm-login-page .orbit-1 { width: 320px !important; height: 120px !important; }
    .slm-login-page .orbit-2 { width: 120px !important; height: 320px !important; }
    .slm-login-page .orbit-3 { width: 320px !important; height: 320px !important; }

    .slm-login-page .slm-formula {
        font-size: calc(16px * var(--s, 1)) !important;
    }
}

@media (max-width: 500px) {

    .slm-login-page {
        padding: 30px 15px 25px !important;
    }

    .slm-login-page .slm-auth-box {
        padding: 24px 18px !important;
        border-radius: 20px !important;
    }

    .slm-login-page .slm-auth-title {
        font-size: 17px !important;
    }

    .slm-login-page .slm-auth-logo {
        width: 65px !important;
        height: 65px !important;
    }

    .slm-login-page .slm-auth-logo-icon {
        font-size: 32px !important;
    }
}