*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    direction: rtl;
    background: #111827;
    color: #f9fafb;
    line-height: 1.8;
}

/* فونت B-Zar */
@font-face {
    font-family: "BZarCustom";
    src: url("fonts/BZar.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: "BZarCustom", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 100%;
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */

.main-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(18px);
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.95), rgba(24, 24, 27, 0.96));
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 0;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: radial-gradient(circle at 20% 10%, #facc15 0, #eab308 40%, #78350f 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #111827;
    font-size: 1.1rem;
    box-shadow: 0 12px 35px rgba(250, 204, 21, 0.6);
}

.logo-title {
    font-weight: 700;
    letter-spacing: .08em;
    font-size: 1rem;
    text-transform: uppercase;
}

.logo-subtitle {
    font-size: .74rem;
    color: #9ca3af;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
}

.nav-link {
    position: relative;
    padding: .35rem .75rem;
    border-radius: 999px;
    color: #e5e7eb;
    transition: color .18s ease, background .18s ease, transform .12s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    inset-inline: .9rem;
    bottom: .2rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #facc15, #f97316);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .18s ease;
}

.nav-link:hover {
    color: #facc15;
    transform: translateY(-1px);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-btn {
    margin-inline-start: .4rem;
}

/* Buttons */

.btn {
    border-radius: 999px;
    padding: .4rem 1.15rem;
    font-size: .86rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    white-space: nowrap;
    transition: transform .1s ease, box-shadow .18s ease, background .2s ease, color .2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #facc15, #f97316);
    color: #111827;
    box-shadow: 0 12px 30px rgba(250, 204, 21, 0.65);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(234, 179, 8, 0.9);
}

.btn-outline {
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: transparent;
    color: #e5e7eb;
}

.btn-outline:hover {
    background: #facc15;
    color: #111827;
    box-shadow: 0 10px 28px rgba(250, 204, 21, 0.45);
}

.btn-ghost {
    border-radius: 999px;
    border: 1px solid rgba(75, 85, 99, 0.9);
    background: rgba(15, 23, 42, 0.4);
    color: #e5e7eb;
}

.btn-ghost:hover {
    background: rgba(250, 204, 21, 0.1);
    color: #facc15;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.btn-disabled {
    background: #4b5563;
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-full-width {
    width: 100%;
}

/* Layout */

.page-content {
    padding: 2.2rem 0 3rem;
    background: radial-gradient(circle at top, #020617 0, #020617 18%, #111827 48%, #020617 100%);
}

/* Animations */

@keyframes floatCard {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0px); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 12px 28px rgba(250, 204, 21, 0.4); }
    50% { box-shadow: 0 16px 40px rgba(250, 204, 21, 0.8); }
    100% { box-shadow: 0 12px 28px rgba(250, 204, 21, 0.4); }
}

.pulse-glow {
    animation: pulseGlow 2.4s ease-in-out infinite;
}

/* Scroll reveal */

.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s ease, transform .5s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Hero */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
    gap: 1.7rem;
    align-items: stretch;
    margin-top: 1.3rem;
}

.hero-text {
    padding: 1rem 0;
}

.hero-text h1 {
    margin: 0 0 .5rem;
    font-size: 2.1rem;
    color: #f9fafb;
}

.hero-text p {
    margin: 0 0 1rem;
    color: #e5e7eb;
    font-size: .95rem;
}

.hero-highlight {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .22rem .7rem;
    border-radius: 999px;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.4);
    font-size: .78rem;
    color: #facc15;
    margin-bottom: .6rem;
}

.hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #facc15;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-bottom: 1.2rem;
}

.hero-note {
    font-size: .8rem;
    color: #9ca3af;
}

.hero-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    font-size: .88rem;
    color: #e5e7eb;
}

.hero-list li {
    margin-bottom: .35rem;
    position: relative;
    padding-right: 1.2rem;
}

.hero-list li::before {
    content: "";
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #facc15, #f97316);
    position: absolute;
    right: 0;
    top: .55rem;
}

/* Hero card */

.hero-card {
    background: radial-gradient(circle at top right, #fefce8 0, #f3f4f6 40%, #e5e7eb 100%);
    border-radius: 1.7rem;
    padding: 1.4rem 1.3rem;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.7);
    border: 1px solid #e5e7eb;
    color: #111827;
    position: relative;
    overflow: hidden;
    animation: floatCard 6s ease-in-out infinite;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at top right, rgba(234, 179, 8, 0.2), transparent 55%);
    opacity: .9;
    pointer-events: none;
}

.hero-card > * {
    position: relative;
    z-index: 1;
}

.hero-card h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

.hero-card p {
    margin-top: .1rem;
    font-size: .9rem;
    color: #374151;
}

.hero-card-list {
    list-style: none;
    padding: 0;
    margin: .8rem 0 0;
    font-size: .86rem;
    color: #4b5563;
}

.hero-card-list li {
    margin-bottom: .3rem;
}

/* Features */

.features-grid {
    margin-top: 2.3rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
}

.feature-card {
    background: radial-gradient(circle at top, rgba(24, 24, 27, 0.9) 0, #020617 55%);
    border-radius: 1.4rem;
    padding: 1rem 1rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(55, 65, 81, 0.8);
    font-size: .9rem;
    color: #e5e7eb;
}

.feature-card h3 {
    margin-top: 0;
    margin-bottom: .25rem;
    font-size: 1rem;
    color: #facc15;
}

/* General text */

.page-title {
    margin-top: 0;
    margin-bottom: .3rem;
    font-size: 1.5rem;
    color: #facc15;
}

.page-subtitle {
    margin-top: 0;
    margin-bottom: 1.3rem;
    color: #9ca3af;
    font-size: .88rem;
}

/* Forms */

.auth-section {
    display: flex;
    justify-content: center;
    padding-top: 1.8rem;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: radial-gradient(circle at top, rgba(24, 24, 27, 0.98) 0, #020617 60%);
    border-radius: 1.7rem;
    padding: 1.6rem 1.4rem 1.9rem;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.9);
}

.auth-subtitle {
    margin-top: .15rem;
    color: #9ca3af;
    font-size: .85rem;
}

.form {
    display: grid;
    gap: .9rem;
    margin-top: 1rem;
}

.form label {
    font-size: .86rem;
    color: #e5e7eb;
    display: grid;
    gap: .35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select,
input[type="datetime-local"] {
    border-radius: .9rem;
    border: 1px solid #4b5563;
    padding: .55rem .8rem;
    font-family: inherit;
    font-size: .9rem;
    background-color: rgba(15, 23, 42, 0.85);
    color: #f9fafb;
    transition: border .15s ease, box-shadow .15s ease, background .15s ease, transform .09s ease;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #facc15;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.4), 0 0 30px rgba(250, 204, 21, 0.15);
    background-color: rgba(15, 23, 42, 1);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
}

.auth-footer {
    margin-top: 1rem;
    font-size: .8rem;
    color: #9ca3af;
}

.auth-footer a {
    color: #facc15;
}

/* Alerts */

.alert {
    border-radius: 1.1rem;
    padding: .6rem .85rem;
    font-size: .8rem;
    margin-bottom: .7rem;
}

.alert-error {
    background: rgba(127, 29, 29, 0.3);
    border: 1px solid #fecaca;
    color: #fee2e2;
}

/* Cards & dashboard */

.card {
    background: radial-gradient(circle at top, rgba(24, 24, 27, 0.98) 0, #020617 55%);
    border-radius: 1.4rem;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
    gap: 1.5rem;
}

.card-list {
    display: grid;
    gap: 1rem;
}

.exam-card {
    background: radial-gradient(circle at top, rgba(24, 24, 27, 0.95) 0, #020617 60%);
    border-radius: 1.4rem;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
    animation: floatCard 7s ease-in-out infinite;
}

.exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
    margin-top: .6rem;
    font-size: .8rem;
    color: #9ca3af;
}

.exam-footer {
    margin-top: .8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-pill {
    padding: .15rem .7rem;
    border-radius: 999px;
    font-size: .78rem;
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
}

/* Empty box */

.empty-box {
    padding: 1rem 1rem;
    border-radius: 1.1rem;
    border: 1px dashed rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.8);
    font-size: .86rem;
    color: #e5e7eb;
}

/* Text helpers */

.muted {
    color: #9ca3af;
}

.small {
    font-size: .78rem;
}

/* Tables */

.table-wrapper {
    background: radial-gradient(circle at top, rgba(24, 24, 27, 0.98) 0, #020617 60%);
    border-radius: 1.4rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.data-table th,
.data-table td {
    padding: .55rem .9rem;
    text-align: right;
}

.data-table thead {
    background: linear-gradient(90deg, #020617, #111827);
    color: #f9fafb;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.9);
}

.data-table tbody tr:nth-child(odd) {
    background: rgba(17, 24, 39, 0.9);
}

.link {
    color: #facc15;
    font-weight: 500;
}

/* Stats */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: radial-gradient(circle at top, rgba(24, 24, 27, 0.98) 0, #020617 65%);
    border-radius: 1.4rem;
    padding: .9rem 1rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
}

.stat-label {
    font-size: .78rem;
    color: #9ca3af;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: .2rem;
    color: #facc15;
}

/* Toolbar */

.toolbar {
    margin: 1rem 0;
    display: flex;
    gap: .6rem;
}

/* Exam page */

.exam-section {
    background: radial-gradient(circle at top, rgba(24, 24, 27, 0.98) 0, #020617 60%);
    border-radius: 1.7rem;
    padding: 1.25rem 1.1rem 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(55, 65, 81, 0.95);
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.1rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.8);
    padding-bottom: .8rem;
    margin-bottom: 1rem;
}

.exam-timer {
    background: linear-gradient(135deg, #020617, #111827);
    color: #f9fafb;
    border-radius: 1.1rem;
    padding: .55rem .9rem;
    text-align: center;
    min-width: 140px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.9);
}

#timer-display {
    margin-top: .15rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .05em;
}

.timer-warning {
    margin-top: .25rem;
    font-size: .76rem;
    color: #facc15;
}

.timer-warning.hidden {
    display: none;
}

.question-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .9rem;
}

.question-item {
    padding: .8rem .85rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.9);
}

.question-text {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    margin-bottom: .4rem;
}

.q-number {
    font-weight: 600;
    color: #facc15;
}

.q-mark {
    font-size: .8rem;
    color: #9ca3af;
}

.options-group {
    display: grid;
    gap: .25rem;
}

.option-row {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .88rem;
}

.option-row input[type="radio"] {
    accent-color: #facc15;
}

.exam-footer-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
}

.autosave-status {
    font-size: .78rem;
    color: #9ca3af;
}

/* Footer */

.main-footer {
    margin-top: 1rem;
    background: #020617;
    color: #d1d5db;
    position: relative;
    border-top: 1px solid #111827;
}

.footer-gradient {
    height: 3px;
    background: linear-gradient(90deg, #facc15, #f97316, #a855f7);
}

.footer-inner {
    padding: .7rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .78rem;
}

.footer-meta {
    color: #9ca3af;
}

/* Grid helpers */

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
}

.options-editor {
    display: grid;
    gap: .4rem;
}

.options-editor .option-row input[type="text"] {
    flex: 1;
}

/* Responsive */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .features-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .exam-header {
        flex-direction: column;
        align-items: stretch;
    }
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
