:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --surface-alt: #eef4ff;

    --primary: #0f5fd7;
    --primary-hover: #0b4eb3;
    --primary-dark: #0f172a;
    --primary-deep: #163a63;

    --accent: #14b8a6;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;

    --text: #1f2937;
    --muted: #667085;
    --border: #e7edf5;

    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 22px 48px rgba(15, 23, 42, 0.12);

    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;

    --container: 1180px;
}

/* ---------- RESET ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---------- BASE ---------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    padding-bottom: 32px;
}

h1, h2, h3 {
    color: var(--primary-dark);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

h4, h5, h6 {
    color: var(--primary-dark);
    margin-bottom: 8px;
}

p {
    color: var(--muted);
    margin-bottom: 12px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.25s ease;
}

a:hover {
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ---------- GLOBAL LAYOUT ---------- */
main {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem;
}

.page-container,
.analytics-page-container,
.team-page-container,
.course-builder-container,
.module-page-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 24px;
}

.admin-container,
.question-builder-container,
.quiz-page-container,
.user-builder-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
}

.section-spacing {
    margin-bottom: 64px;
}

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

.text-muted {
    color: var(--muted);
}

.mb-0 {
    margin-bottom: 0;
}

/* ---------- NAVIGATION ---------- */
nav {
    background: rgba(15, 95, 215, 0.94);
    backdrop-filter: blur(12px);
    color: white;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 5%;
    position: relative;
    min-height: 82px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

nav .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

nav .logo img {
    height: 60px;
    width: auto;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

nav .logo img:hover {
    transform: scale(1.02);
    opacity: 0.92;
}

nav .welcome-text {
    position: absolute;
    left: 5%;
    color: rgba(255,255,255,0.88);
    font-size: 0.95rem;
    font-weight: 500;
}

nav .nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

nav .nav-links a,
nav .nav-links span {
    color: #fff;
    margin-left: 12px;
    font-weight: 600;
    opacity: 0.96;
}

nav .nav-links a:hover {
    opacity: 1;
}

.nav-admin-link {
    color: #ffd666 !important;
}

.nav-password-link {
    color: #b7fff7 !important;
}

.nav-logout-link {
    color: #ffe0e0 !important;
}

.nav-portal-link {
    background: #ffffff;
    color: var(--primary) !important;
    padding: 9px 15px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(255,255,255,0.18);
}

.nav-portal-link:hover {
    background: #f8fbff;
    transform: translateY(-1px);
}

/* ---------- LIGHT PREMIUM HEADER CARDS ---------- */
.premium-header-card,
.dashboard-header-card,
.analytics-header-card,
.team-hero-section,
.course-builder-header,
.question-builder-header,
.quiz-header-card,
.module-header-card,
.user-builder-header,
.login-card,
.password-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 55%, #eef4ff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ---------- HOMEPAGE HERO ---------- */
.hero-section {
    padding: 88px 32px;
    margin-bottom: 60px;
    overflow: hidden;
    background: linear-gradient(135deg, #163a63 0%, #1f5b95 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero-premium-layout {
    display: grid;
    grid-template-columns: 1.6fr 0.9fr;
    gap: 34px;
    align-items: center;
}

.hero-main-content {
    text-align: left;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.16);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,0.18);
}

.dashboard-badge {
    background: #eef4ff;
    color: var(--primary);
    border: 1px solid #dbeafe;
}

.hero-title {
    font-size: 3.3rem;
    font-weight: 800;
    max-width: 860px;
    margin: 0 0 24px 0;
    color: #ffffff;
}

.hero-text {
    font-size: 1.12rem;
    max-width: 760px;
    margin: 0;
    color: rgba(255,255,255,0.88);
    line-height: 1.8;
}

.hero-actions {
    margin-top: 36px;
    display: flex;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-btn {
    min-width: 240px;
    padding: 14px 26px;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 700;
}

.hero-side-card {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 22px;
    padding: 24px 22px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(10px);
}

.hero-side-card h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 14px;
}

.hero-feature-list {
    margin: 0;
    padding-left: 18px;
    color: rgba(255,255,255,0.92);
    line-height: 1.75;
}

.hero-feature-list li {
    margin-bottom: 2px;
}

/* ---------- STATS ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 0 0 56px 0;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    display: block;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.stat-label {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

/* ---------- TITLES ---------- */
.section-title {
    text-align: center;
    font-size: 2.35rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.section-subtitle {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 28px;
    color: var(--muted);
}

/* ---------- GENERIC CARDS ---------- */
.card,
.feature-card,
.dashboard-module-card,
.chart-card,
.team-card,
.quiz-question-card,
.form-container,
.course-builder-form-wrap,
.question-builder-form-wrap,
.quiz-form-wrap,
.user-builder-form-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card,
.chart-card,
.dashboard-module-card,
.form-container,
.course-builder-form-wrap,
.question-builder-form-wrap,
.quiz-form-wrap,
.user-builder-form-wrap {
    padding: 28px;
}

.card:hover,
.feature-card:hover,
.dashboard-module-card:hover,
.chart-card:hover,
.team-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ---------- OFFERS GRID ---------- */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 22px;
    margin-top: 28px;
}

.feature-card {
    padding: 28px 22px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #fbfdff 100%);
}

.feature-card:hover {
    border-color: #cfe0fb;
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #e8f0ff 0%, #f2f7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 18px;
    transition: transform 0.25s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.08);
}

.feature-card h3 {
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 1.06rem;
    font-weight: 700;
}

.feature-card p {
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 0;
}

/* ---------- CTA ---------- */
.home-cta-section {
    background: linear-gradient(135deg, #163a63 0%, #1f5b95 100%);
    border-radius: var(--radius-lg);
    padding: 58px 28px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.home-cta-title {
    color: #ffffff;
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.home-cta-text {
    color: rgba(255,255,255,0.88);
    max-width: 760px;
    margin: 0 auto 26px auto;
    font-size: 1.02rem;
    line-height: 1.75;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #12833d;
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #111827;
}

.btn-warning:hover {
    background: #dd9f09;
    color: #111827;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    color: #fff;
}

.btn-info {
    background: var(--accent);
    color: #fff;
}

.btn-info:hover {
    background: #0f9f91;
    color: #fff;
}

.btn-secondary {
    background: #64748b;
    color: #fff;
}

.btn-secondary:hover {
    background: #475569;
    color: #fff;
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.88rem;
}

.btn-full {
    width: 100%;
}

.btn-inline {
    width: auto;
}

/* ---------- FORMS ---------- */
.form-container {
    max-width: 460px;
    margin: 20px auto;
}

.form-container.wide {
    max-width: 100%;
}

.form-group {
    margin-bottom: 16px;
}

label {
    font-weight: 600;
    color: #475467;
    display: inline-block;
    margin-bottom: 7px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d9e3ef;
    border-radius: 12px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    color: var(--text);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 95, 215, 0.14);
}

/* ---------- ALERTS ---------- */
.alert-success {
    color: #166534;
    background: #ebfaee;
    padding: 12px 14px;
    border: 1px solid #86efac;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-error {
    color: #991b1b;
    background: #fef2f2;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

/* ---------- TABLES ---------- */
.table-responsive {
    overflow-x: auto;
    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    background: var(--primary-dark);
    color: #fff;
    font-weight: 700;
}

tr:hover td {
    background: #fbfdff;
}

/* ---------- FOOTER ---------- */
footer {
    text-align: center;
    padding: 20px 16px;
    background: #102c4f;
    color: rgba(255,255,255,0.85);
    margin-top: 56px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ---------- DASHBOARD ---------- */
.dashboard-header-card {
    padding: 32px 28px;
    margin-bottom: 30px;
}

.dashboard-header-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px;
    flex-wrap: wrap;
}

.dashboard-title {
    font-size: 2.15rem;
    font-weight: 800;
}

.dashboard-subtitle {
    max-width: 760px;
    margin-bottom: 0;
}

.dashboard-quick-info {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.dashboard-mini-stat {
    min-width: 140px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.dashboard-mini-label {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-mini-value {
    display: block;
    font-size: 1.05rem;
    color: var(--primary-dark);
    font-weight: 800;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
}

.dashboard-module-card {
    padding: 26px;
}

.module-card-top {
    margin-bottom: 12px;
}

.module-card-title {
    font-size: 1.24rem;
    margin-bottom: 12px;
}

.module-role-badge {
    display: inline-block;
    background: #eef4ff;
    color: #28456b;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.module-card-summary {
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.7;
    margin-bottom: 16px;
    min-height: 76px;
}

.module-date {
    font-size: 0.92rem;
    margin-bottom: 18px;
}

.action-row {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    text-align: center;
    min-width: 160px;
}

.form-reset {
    margin: 0;
}

.role-admin {
    color: var(--danger);
    font-weight: 700;
}

.role-service-user {
    color: var(--accent);
    font-weight: 700;
}

.role-staff {
    color: #374151;
    font-weight: 600;
}

/* ---------- ANALYTICS ---------- */
.analytics-header-card {
    padding: 32px 28px;
    margin-bottom: 26px;
}

.analytics-header-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.analytics-title {
    font-size: 2.1rem;
    font-weight: 800;
}

.analytics-subtitle {
    max-width: 760px;
    margin-bottom: 0;
}

.analytics-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.analytics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.analytics-stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analytics-stat-label {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.analytics-stat-value {
    color: var(--primary-dark);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.analytics-chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    border-radius: var(--radius-md);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.chart-kicker {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 8px;
}

.chart-title {
    font-size: 1.18rem;
    color: var(--primary-dark);
    margin-bottom: 0;
}

.chart-canvas-wrapper {
    position: relative;
    width: 100%;
}

.chart-small {
    height: 280px;
}

.chart-medium {
    height: 320px;
}

.chart-large {
    height: 340px;
}

.analytics-timeline-card {
    margin-top: 4px;
}

/* ---------- TEAM ---------- */
.team-hero-section {
    text-align: center;
    padding: 38px 24px;
    margin-bottom: 34px;
}

.team-page-title {
    font-size: 2.25rem;
    font-weight: 800;
}

.team-page-subtitle {
    max-width: 760px;
    margin: 0 auto;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    margin-top: 20px;
}

.team-card {
    padding: 30px 22px;
    text-align: center;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.team-card:hover {
    border-color: #cfe0fb;
}

.team-photo {
    width: 145px;
    height: 145px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 18px auto;
    border: 4px solid #f3f7fd;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    transition: transform 0.25s ease;
}

.team-card:hover .team-photo {
    transform: scale(1.04);
}

.team-card h3 {
    font-size: 1.32rem;
}

.team-card h4 {
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 700;
}

.team-bio {
    line-height: 1.72;
    margin-bottom: 16px;
}

.team-fact {
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
}

/* ---------- LOGIN / PASSWORD / USER ---------- */
.login-page-container,
.password-page-container {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.login-card,
.password-card {
    width: 100%;
    max-width: 500px;
    padding: 34px 28px;
}

.login-header,
.password-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-title,
.password-title,
.user-builder-title,
.question-builder-title,
.course-builder-title,
.quiz-page-title,
.module-page-title {
    font-size: 2rem;
    font-weight: 800;
}

.login-subtitle,
.password-subtitle,
.user-builder-subtitle,
.question-builder-subtitle,
.course-builder-subtitle,
.quiz-page-subtitle,
.module-page-description {
    line-height: 1.75;
    margin-bottom: 0;
}

.password-divider {
    height: 1px;
    background: #dbe3ea;
    margin: 20px 0;
}

.password-actions,
.user-builder-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* ---------- USER BUILDER ---------- */
.user-builder-header {
    padding: 30px 26px;
    margin-bottom: 24px;
}

.user-builder-form-wrap {
    max-width: 100%;
    padding: 28px;
}

/* ---------- COURSE / QUESTION / QUIZ / MODULE ---------- */
.course-builder-header,
.question-builder-header,
.quiz-header-card,
.module-header-card {
    padding: 30px 26px;
    margin-bottom: 24px;
}

.edit-course-header {
    border-left: 6px solid var(--warning);
}

.course-builder-form-wrap,
.question-builder-form-wrap,
.quiz-form-wrap {
    max-width: 100%;
    padding: 28px;
}

.course-settings-card {
    background: var(--surface-soft);
    border: 2px solid var(--primary);
    margin-top: 0;
}

.edit-course-settings-card {
    border: 2px solid var(--warning);
}

.builder-section-title {
    font-size: 1.28rem;
    margin-bottom: 18px;
}

.checkbox-group-label {
    display: block;
    margin-bottom: 10px;
}

.audience-options {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #dbe3ea;
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    min-width: 180px;
}

.checkbox-card input {
    margin: 0;
}

.slides-section-header {
    margin-top: 30px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dbe3ea;
}

.slides-section-text {
    margin-bottom: 0;
}

.course-slide-card {
    border-radius: var(--radius-md);
}

.slide-card-spacing {
    margin-top: 16px;
}

.slide-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.slide-number {
    margin-bottom: 0;
}

.media-config-box {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.media-type-selector {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #cfd6de;
    border-radius: 12px;
    background: #ffffff;
    font-size: 1rem;
}

.media-box-hidden {
    display: none;
}

.file-input {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px dashed #cbd5e1;
    background: #ffffff;
    border-radius: 12px;
}

.current-media-preview {
    margin-bottom: 12px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: 12px;
}

.current-media-thumb {
    max-height: 50px;
    border-radius: 6px;
    display: block;
}

.current-media-label {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.add-slide-btn {
    margin-top: 18px;
}

.builder-submit-wrap {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #dbe3ea;
}

.builder-submit-btn {
    font-size: 1.05rem;
    padding: 14px;
}

.question-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 6px;
}

.option-card {
    background: #f8fbff;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 0;
}

.correct-answer-box {
    margin-top: 18px;
    background: #f1f5f9;
    padding: 16px;
    border-radius: 14px;
}

/* ---------- MODULE VIEW ---------- */
.module-top-bar {
    margin-bottom: 20px;
}

.module-player-card {
    padding: 28px;
}

.module-player-meta {
    margin-bottom: 24px;
}

.module-progress-bar {
    width: 100%;
    height: 10px;
    background: #e7edf5;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}

.module-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 0.3s ease;
}

.module-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dbe3ea;
    flex-wrap: wrap;
}

.slide-nav-btn {
    min-width: 140px;
    text-align: center;
}

.slide-counter-text {
    font-weight: 700;
    color: #4b5563;
    font-size: 1.05rem;
    text-align: center;
}

.slide-content-card {
    animation: fade 0.35s ease;
}

.slide-visible {
    display: block;
}

.slide-hidden {
    display: none;
}

.slide-title {
    margin-bottom: 18px;
    padding-bottom: 10px;
    font-size: 1.36rem;
    border-bottom: 1px solid #edf2f7;
}

.slide-image-wrapper {
    text-align: center;
    margin-bottom: 22px;
}

.slide-image {
    max-width: 100%;
    max-height: 360px;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
    margin: 0 auto;
}

.slide-text-content {
    font-size: 1.06rem;
    line-height: 1.85;
    color: var(--text);
}

.video-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
    margin-bottom: 22px;
    background: #000;
}

.video-embed-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-error {
    color: var(--danger);
    font-weight: 700;
    margin-bottom: 16px;
}

.slide-nav-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.finish-btn-hidden {
    display: none;
}

.finish-btn-visible {
    display: inline-block;
}

/* ---------- QUIZ ---------- */
.quiz-meta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.quiz-meta-pill {
    background: #eef4ff;
    color: var(--primary);
    border: 1px solid #dbeafe;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.quiz-question-card {
    padding: 22px 20px;
    margin-bottom: 18px;
}

.quiz-question-title {
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 1.02rem;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    background: #eef6ff;
    border-color: #bfd7f5;
}

.quiz-option input[type="radio"] {
    margin-top: 3px;
    width: auto;
    flex-shrink: 0;
}

.quiz-option span {
    color: #374151;
    line-height: 1.6;
}

.quiz-result-card {
    padding: 36px 28px;
    text-align: center;
}

.quiz-result-title {
    font-size: 2rem;
    margin-bottom: 22px;
}

.quiz-score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto 22px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
}

.quiz-pass {
    background: #e9fbe9;
    color: #15803d;
    border: 6px solid #22c55e;
}

.quiz-fail {
    background: #fee2e2;
    color: #b91c1c;
    border: 6px solid #ef4444;
}

.quiz-result-text {
    font-size: 1rem;
    line-height: 1.7;
    max-width: 620px;
    margin: 0 auto 20px auto;
}

.quiz-return-btn {
    min-width: 220px;
}

/* ---------- EMPTY STATES ---------- */
.empty-state-card {
    text-align: center;
    padding: 40px 25px;
}

/* ---------- REVEAL ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- ANIMATIONS ---------- */
@keyframes fade {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* =========================================================
   FOOTER ACTIONS
========================================================= */
.footer-subtext {
    font-size: 0.75rem;
    margin: 6px 0 12px 0;
    color: #dbe4f0;
}

.footer-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.footer-btn {
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.25s ease;
    border: none;
}

.footer-btn-contrast {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.35);
    color: #ffffff;
}

.footer-btn-contrast:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.footer-btn-exit {
    background: #dc2626;
    border: 1px solid #b91c1c;
    color: #ffffff;
    font-weight: 700;
}

.footer-btn-exit:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* =========================================================
   FOOTER ACTIONS (HIGH CONTRAST + QUICK EXIT)
========================================================= */
.footer-subtext {
    font-size: 0.75rem;
    margin: 6px 0 12px 0;
    color: #dbe4f0;
}

.footer-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.footer-btn {
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.25s ease;
    border: none;
}

.footer-btn-contrast {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.35);
    color: #ffffff;
}

.footer-btn-contrast:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.footer-btn-exit {
    background: #dc2626;
    border: 1px solid #b91c1c;
    color: #ffffff;
    font-weight: 700;
}

.footer-btn-exit:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* =========================================
   HIGH CONTRAST MODE – CLEAN FINAL
========================================= */

html.colorblind-mode body {
    background: #ffffff !important;
    color: #000000 !important;
}

/* text general */
html.colorblind-mode h1,
html.colorblind-mode h2,
html.colorblind-mode h3,
html.colorblind-mode h4,
html.colorblind-mode h5,
html.colorblind-mode h6,
html.colorblind-mode p,
html.colorblind-mode span,
html.colorblind-mode label,
html.colorblind-mode li,
html.colorblind-mode td,
html.colorblind-mode th {
    color: #000000 !important;
}

/* links */
html.colorblind-mode a {
    color: #000000 !important;
    text-decoration: underline !important;
}

/* navbar + footer */
html.colorblind-mode nav,
html.colorblind-mode footer {
    background: #000000 !important;
    color: #ffffff !important;
}

html.colorblind-mode nav .nav-links a,
html.colorblind-mode footer *,
html.colorblind-mode .footer-subtext {
    color: #ffffff !important;
}

/* training portal button in nav */
html.colorblind-mode .nav-portal-link {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    text-decoration: none !important;
}

/* keep hero white, not black */
html.colorblind-mode .hero-section,
html.colorblind-mode .home-cta-section,
html.colorblind-mode .cta-section,
html.colorblind-mode .hero-side-card,
html.colorblind-mode .hero-box {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

/* text inside hero */
html.colorblind-mode .hero-title,
html.colorblind-mode .hero-text,
html.colorblind-mode .hero-side-card h3,
html.colorblind-mode .hero-feature-list,
html.colorblind-mode .home-cta-title,
html.colorblind-mode .home-cta-text {
    color: #000000 !important;
}

/* cards */
html.colorblind-mode .card,
html.colorblind-mode .feature-card,
html.colorblind-mode .team-card,
html.colorblind-mode .dashboard-module-card,
html.colorblind-mode .chart-card,
html.colorblind-mode .form-container,
html.colorblind-mode .quiz-question-card,
html.colorblind-mode .course-builder-form-wrap,
html.colorblind-mode .question-builder-form-wrap,
html.colorblind-mode .quiz-form-wrap,
html.colorblind-mode .user-builder-form-wrap,
html.colorblind-mode .dashboard-mini-stat,
html.colorblind-mode .analytics-stat-card,
html.colorblind-mode .stat-card {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

/* buttons */
html.colorblind-mode .btn,
html.colorblind-mode button {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

html.colorblind-mode .btn:hover,
html.colorblind-mode button:hover {
    background: #f3f3f3 !important;
    color: #000000 !important;
}

/* tables */
html.colorblind-mode th {
    background: #000000 !important;
    color: #ffffff !important;
}

html.colorblind-mode td {
    background: #ffffff !important;
    color: #000000 !important;
}

html.colorblind-mode tr:hover td {
    background: #f3f3f3 !important;
}

/* forms */
html.colorblind-mode input,
html.colorblind-mode textarea,
html.colorblind-mode select {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

/* icons */
html.colorblind-mode .feature-icon,
html.colorblind-mode .icon {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

/* remove shadows only from main UI blocks */
html.colorblind-mode .card,
html.colorblind-mode .feature-card,
html.colorblind-mode .team-card,
html.colorblind-mode .dashboard-module-card,
html.colorblind-mode .chart-card,
html.colorblind-mode .hero-section,
html.colorblind-mode .home-cta-section,
html.colorblind-mode .hero-side-card,
html.colorblind-mode .hero-box,
html.colorblind-mode .btn,
html.colorblind-mode button {
    box-shadow: none !important;
}
/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
    .offers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-premium-layout {
        grid-template-columns: 1fr;
    }

    .hero-main-content {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

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

@media (max-width: 900px) {
    .analytics-chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .question-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        justify-content: center;
        padding: 1rem;
        min-height: auto;
    }

    nav .logo {
        position: relative;
        left: auto;
        transform: none;
        margin-bottom: 15px;
    }

    nav .welcome-text {
        position: relative;
        left: auto;
        margin-bottom: 10px;
        text-align: center;
    }

    nav .nav-links {
        justify-content: center;
    }

    main,
    .page-container,
    .admin-container,
    .module-page-container,
    .analytics-page-container,
    .team-page-container,
    .course-builder-container,
    .question-builder-container,
    .quiz-page-container,
    .user-builder-container {
        width: 95%;
        padding: 15px;
        margin: 0 auto;
    }

    .hero-section,
    .dashboard-header-card,
    .module-header-card,
    .module-player-card,
    .analytics-header-card,
    .team-hero-section,
    .course-builder-header,
    .question-builder-header,
    .quiz-header-card,
    .quiz-result-card,
    .login-card,
    .password-card,
    .user-builder-header,
    .user-builder-form-wrap,
    .course-builder-form-wrap,
    .question-builder-form-wrap,
    .quiz-form-wrap {
        padding: 22px 18px;
    }

    .hero-title,
    .dashboard-title,
    .analytics-title,
    .team-page-title,
    .course-builder-title,
    .question-builder-title,
    .quiz-page-title,
    .quiz-result-title,
    .login-title,
    .password-title,
    .user-builder-title,
    .module-page-title {
        font-size: 1.8rem;
    }

    .hero-text {
        font-size: 1rem;
    }

    .hero-btn {
        width: 100%;
        min-width: 0;
    }

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

    .dashboard-header-layout,
    .dashboard-quick-info,
    .analytics-header-layout,
    .module-player-header,
    .slide-card-header,
    .action-row,
    .chart-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-mini-stat,
    .slide-nav-btn,
    .action-btn,
    .card .btn,
    .admin-box .btn {
        width: 100%;
        min-width: 0;
        flex: none;
    }

    .slide-counter-text {
        order: -1;
        margin-bottom: 6px;
    }

    .slide-title {
        font-size: 1.2rem;
    }

    .slide-text-content {
        font-size: 1rem;
    }

    .slide-image {
        max-height: 260px;
    }

    .analytics-stat-value {
        font-size: 1.7rem;
    }

    .chart-small,
    .chart-medium,
    .chart-large {
        height: 260px;
    }

    .offers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-photo {
        width: 125px;
        height: 125px;
    }

    .login-page-container,
    .password-page-container {
        min-height: auto;
        padding: 20px 15px;
    }

    .checkbox-card {
        width: 100%;
    }

    .quiz-score-circle {
        width: 140px;
        height: 140px;
        font-size: 1.6rem;
    }

    table,
    th,
    td {
        font-size: 0.92rem;
    }

    canvas {
        max-height: 250px !important;
    }

    footer {
        font-size: 0.9rem;
        padding: 1rem;
    }

    .home-cta-section {
        padding: 36px 18px;
    }

    .home-cta-title {
        font-size: 1.8rem;
    }
}

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

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

/* ---------- MODERN DASHBOARD FILTER / SEARCH ---------- */

.filter-form {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin: 1.25rem auto 2.2rem auto;
    padding: 1rem;
    max-width: 920px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.filter-search {
    flex: 1;
    min-width: 260px;
    position: relative;
}

.filter-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1rem;
    pointer-events: none;
}

.filter-search input {
    width: 100%;
    padding: 0.78rem 1rem 0.78rem 2.55rem;
    border: 1px solid #d9e3ef;
    border-radius: 999px;
    background: #ffffff;
    font-size: 0.95rem;
    color: var(--text);
    transition: all 0.25s ease;
}

.filter-search input::placeholder {
    color: #98a2b3;
}

.filter-select {
    min-width: 190px;
}

.filter-select select {
    width: 100%;
    padding: 0.78rem 1rem;
    border: 1px solid #d9e3ef;
    border-radius: 999px;
    background: #ffffff;
    font-size: 0.95rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-search input:focus,
.filter-select select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 95, 215, 0.14);
}

.filter-form .btn {
    width: auto;
    white-space: nowrap;
}

/* Dashboard card polish */
.dashboard-module-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.dashboard-module-card:hover {
    border-color: #cfe0fb;
}

.module-card-title {
    min-height: 2.8rem;
}

.module-date {
    color: #475467;
    font-weight: 600;
}

/* Empty state polish */
.empty-state-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* High contrast support */
html.colorblind-mode .filter-form {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

html.colorblind-mode .filter-icon {
    color: #000000 !important;
}

/* Mobile support */
@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search,
    .filter-select,
    .filter-form .btn {
        width: 100%;
    }
}

/* ---------- PRINT STYLES (CERTIFICATE) ---------- */
@media print {
    nav,
    footer,
    .btn {
        display: none !important;
    }

    body {
        background: white !important;
    }

    .card {
        box-shadow: none !important;
        border: 2px solid #000 !important;
    }
}