/* =====================================================
   سامانه کلاس‌های خصوصی فیزیک — استاد نژاداسد
   فایل اصلی استایل‌ها
   ===================================================== */


/* ── متغیرهای CSS ── */
:root {
    --color-primary:      #1B3A7A;
    --color-primary-dark: #122860;
    --color-accent:       #3B82F6;
    --color-accent-dark:  #2563EB;
    --color-amber:        #F59E0B;
    --color-amber-dark:   #D97706;
    --color-bg:           #F8FAFC;
    --color-card:         #FFFFFF;
    --color-text:         #1E293B;
    --color-muted:        #64748B;
    --color-border:       #E2E8F0;
    --color-success:      #10B981;
    --color-error:        #EF4444;

    --font-fa: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    --font-en: 'Inter', system-ui, -apple-system, sans-serif;

    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 100px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(27,58,122,0.10), 0 2px 6px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(27,58,122,0.14), 0 4px 12px rgba(0,0,0,0.08);

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --nav-height:  72px;
    --content-max: 1200px;
    --section-py:  80px;
}

/* ── ریست پایه ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-fa);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.75;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-fa); }

/* ── ابزارها ── */
.container {
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.section {
    padding-block: var(--section-py);
}

.section--alt {
    background-color: #FFFFFF;
}

/* عنوان بخش‌ها */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 56px;
    height: 4px;
    background: linear-gradient(to left, var(--color-accent), #93C5FD);
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

.section-subtitle {
    color: var(--color-muted);
    font-size: 1rem;
    margin-top: 0.75rem;
}

/* ── ناوبار ── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow var(--transition);
}

.site-nav.is-scrolled {
    box-shadow: var(--shadow-md);
}

.site-nav .container {
    width: 100%;
}

.site-nav__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

/* برند ناوبار */
.site-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.site-nav__icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.atom-svg {
    width: 44px;
    height: 44px;
}

.site-nav__brand:hover .atom-svg ellipse {
    stroke: rgba(255, 255, 255, 0.55);
    transition: stroke 0.3s ease;
}

.site-nav__name {
    font-size: .82rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.site-nav__tagline {
    font-size: 0.72rem;
    color: var(--color-muted);
    font-weight: 400;
}

/* لینک‌های ناوبار */
.site-nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-nav__links a {
    padding: 0.5rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-muted);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.site-nav__links a:hover,
.site-nav__links a.is-active {
    color: var(--color-primary);
    background: rgba(27, 58, 122, 0.06);
}

/* همبرگر موبایل */
.site-nav__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.site-nav__hamburger:hover {
    background: rgba(27, 58, 122, 0.06);
}

.site-nav__hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.site-nav__hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.site-nav__hamburger.is-open span:nth-child(2) {
    opacity: 0;
}
.site-nav__hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── هیرو ── */
.hero {
    min-height: 68vh;
    background: linear-gradient(140deg, #0F2557 0%, #1B3A7A 45%, #2D68C4 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    color: white;
}

/* الگوی پس‌زمینه فیزیکی */
.hero__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero__bg svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.055;
}

.hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
    margin-inline: auto;
    padding-block: 4rem;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 1.3rem;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: 2.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.5rem;
    backdrop-filter: none;
    background: none;
    letter-spacing: .01rem;
}

.hero__badge-dot {
    width: 11px;
    height: 11px;
    background: #4ADE80;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.hero__title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.hero__title em {
    font-style: normal;
    color: #93C5FD;
}

.hero__desc {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.80);
    max-width: 540px;
    margin-inline: auto;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero__cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero__grades {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 3.5rem;
    flex-wrap: wrap;
}

.hero__grade-chip {
    padding: 0.35rem 1rem;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.80);
}

/* ── ویژگی‌ها ── */
.features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-card);
    text-align: center;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: #BFDBFE;
}

.feature-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #EFF6FF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline: auto;
    margin-bottom: 1.25rem;
    color: var(--color-accent);
    transition: background var(--transition);
}

.feature-card:hover .feature-card__icon {
    background: #DBEAFE;
}

.feature-card__icon svg {
    width: 26px;
    height: 26px;
}

.feature-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.6rem;
}

.feature-card__text {
    font-size: 0.875rem;
    color: var(--color-muted);
    line-height: 1.7;
}

/* ── بخش ورود ── */
.login-section {
    background: var(--color-bg);
}

.login-section__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 860px;
    margin-inline: auto;
}

/* کارت ورود */
.login-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-accent);
    transition: box-shadow var(--transition), transform var(--transition);
}

.login-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.login-card--parent {
    border-top-color: var(--color-amber);
}

.login-card__icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #EFF6FF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--color-accent);
}

.login-card__icon-wrap svg {
    width: 28px;
    height: 28px;
}

.login-card--parent .login-card__icon-wrap {
    background: #FEF3C7;
    color: var(--color-amber);
}

.login-card__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.login-card__subtitle {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 1.75rem;
}

.login-card__forgot {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.82rem;
}

.login-card__forgot a {
    color: var(--color-muted);
    transition: color var(--transition);
}

.login-card__forgot a:hover {
    color: var(--color-accent);
}

.login-card--parent .login-card__forgot a:hover {
    color: var(--color-amber);
}

/* ── فرم ── */
.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.45rem;
}

.form-control {
    width: 100%;
    padding: 0.72rem 0.95rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-bg);
    font-family: var(--font-en);
    direction: ltr;
    text-align: right;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.login-card--parent .form-control:focus {
    border-color: var(--color-amber);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.form-control::placeholder {
    color: #B0BCCC;
    font-family: var(--font-fa);
    direction: rtl;
}

/* خطای فرم */
.form-error {
    display: none;
    font-size: 0.8rem;
    color: var(--color-error);
    margin-top: 0.35rem;
}

/* پیام flash */
.flash-message {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    border: 1px solid;
}

.flash-message--error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
}

.flash-message--success {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #15803D;
}

/* ── دکمه‌ها ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-fa);
    border: none;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition), color var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* دکمه اصلی آبی */
.btn--primary {
    background: var(--color-accent);
    color: white;
    width: 100%;
}

.btn--primary:hover {
    background: var(--color-accent-dark);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.40);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn--primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* دکمه کهربایی (والدین) */
.btn--amber {
    background: var(--color-amber);
    color: white;
    width: 100%;
}

.btn--amber:hover {
    background: var(--color-amber-dark);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.40);
    transform: translateY(-1px);
}

.btn--amber:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn--amber:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* دکمه outline */
.btn--outline {
    background: transparent;
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.btn--outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.80);
}

/* دکمه ghost */
.btn--ghost {
    background: transparent;
    color: var(--color-accent);
    border: 1.5px solid var(--color-accent);
}

.btn--ghost:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* ── فوتر ── */
.site-footer {
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.75);
}

.site-footer__main {
    padding-block: 3rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.site-footer__brand-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1rem;
}

.site-footer__brand-icon svg {
    width: 22px;
    height: 22px;
}

.site-footer__brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.site-footer__brand-text {
    font-size: 0.85rem;
    line-height: 1.75;
}

.site-footer__heading {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.2rem;
}

.site-footer__links li {
    margin-bottom: 0.6rem;
}

.site-footer__links a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.60);
    transition: color var(--transition);
}

.site-footer__links a:hover {
    color: white;
}

.site-footer__contact-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 0.65rem;
    direction: ltr;
    text-align: right;
}

.site-footer__contact-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.50);
}

.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    padding-block: 1.25rem;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
}

/* ── داشبورد ── */
.dashboard-page {
    min-height: calc(100vh - var(--nav-height));
    background: var(--color-bg);
    padding-block: 2rem;
}

.dashboard-header {
    background: linear-gradient(135deg, var(--color-primary), #2D68C4);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.dashboard-header__welcome {
    font-size: 0.9rem;
    opacity: 0.80;
    margin-bottom: 0.25rem;
}

.dashboard-header__name {
    font-size: clamp(1.3rem, 3vw, 1.75rem);
    font-weight: 700;
}

.dashboard-header__meta {
    font-size: 0.82rem;
    opacity: 0.65;
    margin-top: 0.35rem;
    font-family: var(--font-en);
}

.dashboard-header__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.dashboard-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* کارت‌های آمار */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card__icon svg {
    width: 24px;
    height: 24px;
}

.stat-card__icon--blue   { background: #EFF6FF; color: var(--color-accent); }
.stat-card__icon--amber  { background: #FEF3C7; color: var(--color-amber); }
.stat-card__icon--green  { background: #F0FDF4; color: var(--color-success); }
.stat-card__icon--purple { background: #F5F3FF; color: #7C3AED; }

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    font-family: var(--font-en);
}

.stat-card__label {
    font-size: 0.82rem;
    color: var(--color-muted);
    margin-top: 0.2rem;
}

/* جدول پیام‌ها */
.messages-table-wrap {
    background: var(--color-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-sm);
}

.messages-table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.messages-table-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.messages-table {
    width: 100%;
    border-collapse: collapse;
}

.messages-table th {
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-muted);
    text-align: right;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.messages-table td {
    padding: 0.9rem 1.5rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

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

.messages-table tr:hover td {
    background: #FAFBFF;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--unread  { background: #EFF6FF; color: var(--color-accent); }
.badge--read    { background: var(--color-bg); color: var(--color-muted); border: 1px solid var(--color-border); }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-inline: auto;
    margin-bottom: 1rem;
    opacity: 0.35;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ── انیمیشن‌های کاهش حرکت ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    [data-aos] {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* ── ریسپانسیو: تبلت (768px) ── */
@media (max-width: 768px) {
    :root {
        --section-py: 52px;
    }

    /* ناوبار */
    .site-nav__hamburger {
        display: flex;
    }

    /* نام بلند برند روی موبایل پنهان — فقط آیکون اتم نشان داده می‌شود */
    .site-nav__name {
        display: none;
    }

    /* بخش احراز هویت دسکتاپ پنهان می‌شود — لینک‌ها داخل drawer هستند */
    .site-nav__auth {
        display: none;
    }

    .site-nav__links {
        position: fixed;
        inset: 0 0 0 25%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        background: white;
        padding: 5.5rem 1.5rem 2rem;
        transform: translateX(100%);
        transition: transform var(--transition);
        box-shadow: var(--shadow-lg);
        z-index: 99;
    }

    .site-nav__links.is-open {
        transform: translateX(0);
    }

    .site-nav__links a {
        font-size: 1.05rem;
        padding: 0.65rem 0.75rem;
        width: 100%;
    }

    /* لینک‌های احراز هویت در منوی موبایل */
    .nav-auth-sep {
        display: block;
        height: 1px;
        background: var(--color-border);
        margin-block: 0.5rem;
        width: 100%;
    }

    .nav-auth-item {
        display: block;
        width: 100%;
    }

    .nav-auth-item a {
        color: var(--color-accent) !important;
        font-weight: 600 !important;
    }

    /* هیرو */
    .hero__content {
        padding-block: 2.5rem;
    }

    /* ویژگی‌ها */
    .features__grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-inline: auto;
    }

    /* کارت‌های ورود */
    .login-section__grid {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    /* فوتر */
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* داشبورد */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    /* جدول پیام‌ها — اسکرول افقی روی موبایل */
    .messages-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .messages-table th,
    .messages-table td {
        padding-inline: 1rem;
        white-space: nowrap;
    }
}

/* ── ریسپانسیو: موبایل کوچک (480px) ── */
@media (max-width: 480px) {
    .hero__content {
        padding-block: 2rem;
    }

    .hero__cta {
        flex-direction: column;
        align-items: center;
    }

    .hero__cta .btn,
    .hero-btn {
        width: 100% !important;
        max-width: 280px;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
    }

    .site-nav__links {
        inset: 0 0 0 0;
    }

    .messages-table {
        font-size: 0.82rem;
    }
}


/* =====================================================
   سیستم حساب کاربری — auth pages, nav auth, profile
   ===================================================== */

/* ── بخش احراز هویت ناوبار (دسکتاپ) ── */
.site-nav__auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

/* آیتم‌های موبایل داخل navLinks — روی دسکتاپ پنهان */
.nav-auth-sep,
.nav-auth-item {
    display: none;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-fa);
    border: 1.5px solid transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    white-space: nowrap;
    cursor: pointer;
}

.btn-nav--primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.btn-nav--primary:hover {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}

.btn-nav--outline {
    background: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-nav--outline:hover {
    background: rgba(59, 130, 246, 0.07);
}

.btn-nav--ghost {
    background: transparent;
    color: var(--color-muted);
    border-color: var(--color-border);
}

.btn-nav--ghost:hover {
    color: var(--color-error);
    border-color: var(--color-error);
    background: rgba(239, 68, 68, 0.06);
}

/* نام کاربر لاگین‌کرده در ناوبار */
.nav-user__name {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0.3rem 0.5rem;
}

.nav-user__name a {
    color: inherit;
    transition: color var(--transition);
}

.nav-user__name a:hover {
    color: var(--color-accent);
}

/* ── صفحات ورود / ثبت‌نام ── */
.auth-section {
    background: var(--color-bg);
    padding-block: 3rem 4rem;
    min-height: calc(100vh - var(--nav-height));
}

.auth-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-accent);
    max-width: 520px;
    margin-inline: auto;
    width: 100%;
}

.auth-card__header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.3rem;
}

.auth-card__subtitle {
    font-size: 0.875rem;
    color: var(--color-muted);
}

.auth-card__switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-muted);
}

.auth-card__switch a {
    color: var(--color-accent);
    font-weight: 600;
    transition: color var(--transition);
}

.auth-card__switch a:hover {
    color: var(--color-accent-dark);
}

/* ستاره فیلد اجباری */
.form-required {
    color: var(--color-error);
    margin-right: 1px;
}

/* نمایش خطای سرور (form-error به‌صورت پیش‌فرض hidden است) */
.form-error.is-visible {
    display: block;
}

/* حالت خطا برای input */
.form-control.is-invalid {
    border-color: var(--color-error) !important;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14) !important;
}

/* استایل select — RTL و بدون direction:ltr ارثی */
select.form-control {
    direction: rtl;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: left 0.85rem center;
    padding-left: 2.5rem;
}

/* گروه رادیو برای انتخاب جنسیت */
.form-radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.form-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
    user-select: none;
}

.form-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── کارت پروفایل (dashboard.php) ── */
.profile-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-width: 680px;
}

.profile-card__header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
}

.profile-card__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-card__name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.profile-card__role {
    font-size: 0.85rem;
    opacity: 0.80;
}

.profile-card__body {
    padding: 0;
}

/* ردیف‌های اطلاعات پروفایل */
.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.925rem;
    gap: 1rem;
}

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

.profile-row__label {
    color: var(--color-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.profile-row__value {
    color: var(--color-text);
    font-weight: 500;
    text-align: left;
}

/* ریسپانسیو auth */
@media (max-width: 640px) {
    .auth-card {
        padding: 2rem 1.25rem;
    }

    .site-nav__auth {
        gap: 0.35rem;
        padding-right: 0.5rem;
    }

    .btn-nav {
        padding: 0.38rem 0.7rem;
        font-size: 0.78rem;
    }

    .nav-user__name {
        display: none; /* در موبایل فقط دکمه خروج نشان داده شود */
    }

    .profile-card__header {
        padding: 1.5rem;
    }

    .profile-row {
        padding-inline: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}


/* =====================================================
   سیستم گروه‌بندی دانش‌آموزان — v2
   ===================================================== */

/* ── نوار ناوبری پنل دانش‌آموز ── */
.student-nav {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: var(--nav-height);
    z-index: 90;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.student-nav__inner {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.student-nav__inner::-webkit-scrollbar { display: none; }

.student-nav__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    position: relative;
}

.student-nav__link:hover {
    color: var(--color-primary);
    background: rgba(27,58,122,.03);
}

.student-nav__link.is-active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}

.student-nav__link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 .35rem;
    background: var(--color-accent);
    color: white;
    border-radius: var(--radius-full);
    font-size: .68rem;
    font-weight: 700;
    font-family: var(--font-en);
    margin-right: .15rem;
}

/* ── صفحه انتخاب نقش ── */
.role-selection {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: var(--color-bg);
}

.role-selection__card {
    background: var(--color-card);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 580px;
    text-align: center;
    border: 1px solid var(--color-border);
}

.role-selection__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.role-selection__subtitle {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.role-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.role-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.75rem 1rem;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    position: relative;
    text-align: center;
}

.role-card:hover {
    border-color: var(--color-accent);
    background: #EFF6FF;
}

.role-card.is-selected {
    border-color: var(--color-accent);
    background: #EFF6FF;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.role-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.role-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-card__icon--leader { background: #EFF6FF; color: var(--color-accent); }
.role-card__icon--member { background: #F0FDF4; color: var(--color-success); }

.role-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.4rem;
}

.role-card__desc {
    font-size: 0.8rem;
    color: var(--color-muted);
    line-height: 1.6;
}

/* ── کارت گروه ── */
.group-card {
    background: var(--color-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.group-card__header {
    background: linear-gradient(135deg, var(--color-primary), #2D68C4);
    color: white;
    padding: 1.5rem;
}

.group-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.group-card__meta {
    font-size: 0.82rem;
    opacity: 0.75;
}

.group-card__body {
    padding: 1.5rem;
}

/* ── اعضای گروه ── */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: .5rem;
}

.member-item__info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-item__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), #93C5FD);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.member-item__name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
}

.member-item__role {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: .1rem;
}

/* دکمه حذف آیکونی */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-icon--danger {
    background: #FEF2F2;
    color: #DC2626;
}

.btn-icon--danger:hover {
    background: #FCA5A5;
}

/* ── برنامه هفتگی ── */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-day {
    background: var(--color-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.schedule-day__header {
    padding: 0.875rem 1.25rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-primary);
}

.schedule-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
    flex-wrap: wrap;
    gap: .5rem;
}

.schedule-slot:last-child { border-bottom: none; }

.schedule-slot--unavailable {
    background: #FAFAFA;
    opacity: .65;
}

.schedule-slot__time {
    font-family: var(--font-en);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    direction: ltr;
}

.schedule-slot__label {
    font-size: 0.78rem;
    color: var(--color-muted);
    margin-top: .15rem;
}

.schedule-slot__status {
    font-size: 0.8rem;
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.schedule-slot__status--available { background: #F0FDF4; color: #059669; }
.schedule-slot__status--booked    { background: #FEF2F2; color: #DC2626; }
.schedule-slot__status--mine      { background: #EFF6FF; color: var(--color-accent); }

/* ── کارت پرداخت ── */
.payment-card {
    background: var(--color-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.payment-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.payment-card__name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
}

.badge--paid      { background: #F0FDF4; color: #059669; border: 1px solid #BBF7D0; }
.badge--pending   { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }
.badge--cancelled { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }

.payment-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: linear-gradient(135deg, var(--color-primary), #2D68C4);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: opacity var(--transition), transform var(--transition);
    margin-top: 0.5rem;
}

.payment-link:hover {
    opacity: .9;
    transform: translateY(-1px);
}

/* ── فرم پیام ── */
.msg-compose {
    background: var(--color-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.msg-compose__header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-primary);
    background: var(--color-bg);
}

.msg-compose__body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.875rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-fa);
    font-size: 0.9rem;
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    resize: vertical;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
    background: white;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 18px;
    padding-left: 2.5rem;
    cursor: pointer;
}

/* گزینه‌های انتخاب گیرنده پیام */
.receiver-option {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-muted);
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.receiver-option:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.receiver-option.is-selected {
    border-color: var(--color-accent);
    background: #EFF6FF;
    color: var(--color-accent);
}

.receiver-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* ── هشدارها ── */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.65;
}

.alert--success { background: #F0FDF4; color: #059669; border: 1px solid #BBF7D0; }
.alert--error   { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.alert--info    { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
.alert--warning { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }

/* ── دسترسی‌های سریع در داشبورد ── */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    color: var(--color-text);
    gap: .75rem;
}

.quick-action-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: #BFDBFE;
}

.quick-action-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-action-card__title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--color-primary);
}

.quick-action-card__desc {
    font-size: .78rem;
    color: var(--color-muted);
    line-height: 1.5;
}

/* ── ریسپانسیو v2 ── */
@media (max-width: 768px) {
    .role-cards {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin-inline: auto;
    }

    .schedule-slot {
        flex-direction: column;
        align-items: flex-start;
    }

    .member-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-card__header {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .student-nav__link {
        padding: .75rem .875rem;
        font-size: .82rem;
        gap: .35rem;
    }
}

