/* DigiMRT Course Portal - theme on top of Bootstrap 5 (colours from the DigiMRT logo and website) */

:root {
    --dm-teal: #0f93a3;
    --dm-teal-dark: #0b7785;
    --dm-teal-soft: #e5f5f7;
    --dm-orange: #f08804;
    --dm-orange-dark: #d77a04;
    --dm-orange-soft: #fef2e0;
    --dm-navy: #212f3d;
    --dm-navy-2: #283848;
    --dm-ink: #2b3a4a;
    --dm-muted: #6b7a89;
    --dm-line: #e3e9ef;
    --dm-bg: #f4f7fa;

    --bs-primary: #0f93a3;
    --bs-primary-rgb: 15, 147, 163;
    --bs-body-font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: #2b3a4a;
    --bs-body-bg: #f4f7fa;
    --bs-body-font-size: 1.03rem;
    --bs-link-color: #0b7785;
    --bs-link-color-rgb: 11, 119, 133;
    --bs-link-hover-color: #085a65;
    --bs-link-hover-color-rgb: 8, 90, 101;
    --bs-border-color: #e3e9ef;
    --bs-border-radius: 0.6rem;
}

h1, h2, h3, h4, h5, h6 { color: var(--dm-navy); font-weight: 700; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn, .nav-link, .dropdown-item, .navbar-brand, .list-group-item, .page-link { text-decoration: none !important; }
.text-muted { color: var(--dm-muted) !important; }

/* ---------- Buttons & forms ---------- */
.btn { font-weight: 600; border-radius: 0.55rem; }
.btn-lg { border-radius: 0.65rem; }
.btn-primary {
    --bs-btn-bg: var(--dm-teal); --bs-btn-border-color: var(--dm-teal);
    --bs-btn-hover-bg: var(--dm-teal-dark); --bs-btn-hover-border-color: var(--dm-teal-dark);
    --bs-btn-active-bg: var(--dm-teal-dark); --bs-btn-active-border-color: var(--dm-teal-dark);
    --bs-btn-disabled-bg: var(--dm-teal); --bs-btn-disabled-border-color: var(--dm-teal);
    --bs-btn-focus-shadow-rgb: 15, 147, 163;
}
.btn-outline-primary {
    --bs-btn-color: var(--dm-teal-dark); --bs-btn-border-color: var(--dm-teal);
    --bs-btn-hover-bg: var(--dm-teal); --bs-btn-hover-border-color: var(--dm-teal);
    --bs-btn-active-bg: var(--dm-teal-dark); --bs-btn-active-border-color: var(--dm-teal-dark);
    --bs-btn-focus-shadow-rgb: 15, 147, 163;
}
.btn-accent {
    --bs-btn-color: #fff; --bs-btn-bg: var(--dm-orange); --bs-btn-border-color: var(--dm-orange);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--dm-orange-dark); --bs-btn-hover-border-color: var(--dm-orange-dark);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--dm-orange-dark); --bs-btn-active-border-color: var(--dm-orange-dark);
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--dm-orange); --bs-btn-disabled-border-color: var(--dm-orange);
    --bs-btn-focus-shadow-rgb: 240, 136, 4;
    text-shadow: 0 1px 1px rgba(120, 60, 0, .35);
}
.form-control, .form-select { border-radius: 0.55rem; border-color: #d5dde5; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--dm-teal);
    box-shadow: 0 0 0 .2rem rgba(15, 147, 163, .18);
}
.form-check-input:checked { background-color: var(--dm-teal); border-color: var(--dm-teal); }
.form-label { font-weight: 600; color: var(--dm-navy); }
.input-group-text { background: #fff; border-color: #d5dde5; color: var(--dm-muted); }
.progress { --bs-progress-bar-bg: var(--dm-teal); --bs-progress-height: .55rem; --bs-progress-bg: #e6ecf1; border-radius: 1rem; }
.page-link { color: var(--dm-teal-dark); }
.active > .page-link { background: var(--dm-teal); border-color: var(--dm-teal); }

/* ---------- Soft badges ---------- */
.badge { font-weight: 600; letter-spacing: .01em; }
.badge-soft-teal { background: var(--dm-teal-soft); color: var(--dm-teal-dark); }
.badge-soft-orange { background: var(--dm-orange-soft); color: #a65b00; }
.badge-soft-success { background: #e3f6ea; color: #17733c; }
.badge-soft-muted { background: #edf1f5; color: var(--dm-muted); }
.badge-soft-danger { background: #fde8e8; color: #b42318; }

/* ---------- Navbar & footer ---------- */
.dm-navbar { background: #fff; border-bottom: 1px solid var(--dm-line); box-shadow: 0 2px 10px rgba(33, 47, 61, .05); padding-top: .55rem; padding-bottom: .55rem; }
.dm-navbar .nav-link { color: var(--dm-ink); font-weight: 600; border-radius: .5rem; padding-left: .85rem !important; padding-right: .85rem !important; }
.dm-navbar .nav-link:hover { color: var(--dm-teal-dark); background: var(--dm-teal-soft); }
.dm-navbar .nav-link.active { color: var(--dm-teal-dark); background: var(--dm-teal-soft); }
.dm-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--dm-teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.dm-nav-name { max-width: 180px; }
.dm-footer { background: var(--dm-navy); color: #c7d1db; padding: 1rem 0; font-size: .95rem; }
.dm-footer a { color: #fff; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--dm-line); border-radius: .9rem; box-shadow: 0 2px 10px rgba(33, 47, 61, .04); }
.card-header { background: #fff; border-bottom: 1px solid var(--dm-line); font-weight: 700; color: var(--dm-navy); border-radius: .9rem .9rem 0 0 !important; padding: .9rem 1.15rem; }
.table { --bs-table-color: var(--dm-ink); }
.table > thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--dm-muted); font-weight: 700; white-space: nowrap; background: #f8fafc; }
.table td, .table th { vertical-align: middle; }

/* ---------- Hero ---------- */
.dm-hero { background: linear-gradient(120deg, var(--dm-navy) 0%, var(--dm-navy-2) 55%, #1d5562 100%); color: #fff; border-radius: 1.1rem; padding: 1.75rem; position: relative; overflow: hidden; }
.dm-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(240, 136, 4, .16); }
.dm-hero::before { content: ""; position: absolute; right: 90px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgba(15, 147, 163, .28); }
.dm-hero > * { position: relative; z-index: 1; }
.dm-hero h1, .dm-hero h2 { color: #fff; }
.dm-hero .lead { color: #d3dde6; font-size: 1.08rem; }
.dm-hero .breadcrumb-link { color: #b9e4ea; font-weight: 600; }
.dm-stat { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: .8rem; padding: .7rem 1rem; min-width: 118px; }
.dm-stat .num { font-size: 1.55rem; font-weight: 700; line-height: 1.1; color: #fff; }
.dm-stat .lbl { font-size: .85rem; color: #c9d6e0; }
.dm-hero .progress { --bs-progress-bg: rgba(255, 255, 255, .2); --bs-progress-bar-bg: var(--dm-orange); }

/* ---------- Course cards ---------- */
.course-card { transition: transform .15s ease, box-shadow .15s ease; height: 100%; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(33, 47, 61, .1); }
.course-icon { width: 52px; height: 52px; border-radius: .9rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; flex: 0 0 auto; }
.course-icon.lg { width: 64px; height: 64px; font-size: 1.9rem; }
.tone-teal { background: var(--dm-teal-soft); color: var(--dm-teal-dark); }
.tone-orange { background: var(--dm-orange-soft); color: #c26d00; }
.tone-navy { background: #e8edf2; color: var(--dm-navy); }
.course-card .card-title { font-size: 1.2rem; line-height: 1.25; }
.course-meta { font-size: .9rem; color: var(--dm-muted); }
.course-meta i { color: var(--dm-teal); }

/* ---------- Chapter list ---------- */
.chapter-list .list-group-item { border-color: var(--dm-line); padding: .85rem 1rem; display: flex; align-items: center; gap: .85rem; color: var(--dm-ink); }
.chapter-list a.list-group-item:hover { background: #f7fbfc; }
.chapter-list .list-group-item.locked { color: #9aa7b3; background: #fafbfc; }
.chapter-list .list-group-item.current { background: var(--dm-teal-soft); border-color: #cfeaee; }
.chapter-num { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .92rem; flex: 0 0 auto; background: #edf1f5; color: var(--dm-muted); }
.done .chapter-num { background: var(--dm-teal); color: #fff; }
.open .chapter-num { background: var(--dm-orange); color: #fff; }
.chapter-list .title { font-weight: 600; line-height: 1.25; }
.chapter-list .sub { font-size: .85rem; color: var(--dm-muted); }
.chapter-list.compact .list-group-item { padding: .6rem .8rem; gap: .65rem; font-size: .96rem; }
.chapter-list.compact .chapter-num { width: 28px; height: 28px; font-size: .8rem; }
@media (min-width: 992px) { .sticky-lg { position: sticky; top: 84px; } }

/* ---------- Reading view ---------- */
.lesson { font-size: 1.12rem; line-height: 1.72; }
.lesson h3 { font-size: 1.38rem; margin-top: 2rem; margin-bottom: .7rem; padding-left: .75rem; border-left: 4px solid var(--dm-orange); }
.lesson h4 { font-size: 1.15rem; margin-top: 1.4rem; }
.lesson p { margin-bottom: 1.05rem; }
.lesson ul, .lesson ol { margin-bottom: 1.1rem; padding-left: 1.35rem; }
.lesson li { margin-bottom: .4rem; }
.lesson li::marker { color: var(--dm-teal); font-weight: 700; }
.lesson code { background: #eef2f6; color: #a4420b; padding: .1rem .35rem; border-radius: .3rem; font-size: .92em; }
.lesson blockquote { border-left: 4px solid var(--dm-teal); background: #f7fafc; padding: .8rem 1rem; margin: 1.2rem 0; border-radius: 0 .5rem .5rem 0; color: #455667; }
.lesson table { font-size: 1rem; margin: 1.2rem 0; }
.lesson .table-wrap { overflow-x: auto; }
.callout { border-radius: .7rem; padding: .95rem 1.1rem; margin: 1.3rem 0; border: 1px solid transparent; }
.callout > :last-child { margin-bottom: 0; }
.callout ol, .callout ul { margin-top: .5rem; }
.callout-tip { background: var(--dm-teal-soft); border-color: #c9e8ec; }
.callout-tip > strong:first-child { color: var(--dm-teal-dark); }
.callout-example { background: #f3f5f8; border-color: #dfe5ec; }
.callout-example > strong:first-child { color: var(--dm-navy); }
.callout-task { background: var(--dm-orange-soft); border-color: #f9dcae; }
.callout-task > strong:first-child { color: #a65b00; }

/* ---------- Test ---------- */
.quiz-question { border: 1px solid var(--dm-line); border-radius: .9rem; background: #fff; padding: 1.15rem 1.2rem; margin-bottom: 1rem; }
.quiz-question .q-num { color: var(--dm-teal-dark); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.quiz-question .q-text { font-weight: 600; font-size: 1.12rem; color: var(--dm-navy); margin: .2rem 0 .8rem; }
.quiz-option { display: flex; gap: .7rem; align-items: flex-start; border: 1px solid #d9e1e8; border-radius: .65rem; padding: .7rem .9rem; margin-bottom: .5rem; cursor: pointer; transition: border-color .12s, background .12s; }
.quiz-option:hover { border-color: var(--dm-teal); background: #f7fbfc; }
.quiz-option input { margin-top: .28rem; flex: 0 0 auto; }
.quiz-option:has(input:checked) { border-color: var(--dm-teal); background: var(--dm-teal-soft); }
.quiz-bar { position: sticky; bottom: 0; background: rgba(255, 255, 255, .96); border: 1px solid var(--dm-line); border-radius: .9rem; padding: .8rem 1rem; box-shadow: 0 -4px 18px rgba(33, 47, 61, .08); z-index: 5; }
.result-ring { width: 132px; height: 132px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 1rem; font-weight: 700; }
.result-ring .big { font-size: 2.3rem; line-height: 1; }
.result-ring .small { font-size: .9rem; font-weight: 600; }
.result-ring.pass { background: #e3f6ea; color: #17733c; border: 6px solid #9ad9b1; }
.result-ring.fail { background: #fde8e8; color: #b42318; border: 6px solid #f5b5b0; }

/* ---------- Certificate preview ---------- */
.cert-wrap { container-type: inline-size; max-width: 860px; margin: 0 auto; }
.cert { aspect-ratio: 842 / 595; background: #fff; border: .45cqw solid var(--dm-navy); outline: .15cqw solid var(--dm-orange); outline-offset: -1.5cqw; box-shadow: 0 14px 40px rgba(33, 47, 61, .16); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4cqw 6cqw; line-height: 1.25; }
.cert img { width: 18cqw; height: auto; margin-bottom: 1.6cqw; }
.cert .c-title { font-size: 3.5cqw; font-weight: 700; letter-spacing: .28cqw; color: var(--dm-navy); }
.cert .c-rule { width: 11cqw; height: .35cqw; background: var(--dm-orange); margin: 1.1cqw 0 2cqw; }
.cert .c-small { font-size: 1.7cqw; color: var(--dm-muted); }
.cert .c-name { font-size: 4.1cqw; font-weight: 700; color: var(--dm-teal); border-bottom: .12cqw solid #c8d0d8; padding: 0 3cqw .5cqw; margin: 1cqw 0 1.6cqw; }
.cert .c-course { font-size: 3cqw; font-weight: 700; color: var(--dm-navy); margin: 1cqw 0 1.3cqw; }
.cert .c-score { font-size: 2.5cqw; font-weight: 700; color: var(--dm-orange); margin-top: .8cqw; }
.cert .c-foot { display: flex; justify-content: space-between; align-items: flex-end; width: 100%; margin-top: 2.6cqw; font-size: 1.5cqw; color: var(--dm-navy); }
.cert .c-foot div { min-width: 22cqw; }
.cert .c-foot strong { display: block; border-bottom: .12cqw solid var(--dm-navy); padding-bottom: .5cqw; margin-bottom: .4cqw; font-size: 1.6cqw; }
.cert .c-foot span { color: var(--dm-muted); font-size: 1.25cqw; }
.cert .c-seal { width: 8.6cqw; height: 8.6cqw; min-width: 0 !important; border-radius: 50%; background: var(--dm-teal); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 2cqw; box-shadow: inset 0 0 0 .5cqw var(--dm-teal), inset 0 0 0 .65cqw #fff; }
.cert .c-seal small { font-size: .9cqw; letter-spacing: .12cqw; }

/* ---------- Login / installer ---------- */
.auth-page { min-height: 100vh; background: var(--dm-bg); }
.auth-side { background: linear-gradient(150deg, var(--dm-navy) 0%, var(--dm-navy-2) 50%, #17616e 100%); color: #fff; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; left: -90px; bottom: -90px; width: 320px; height: 320px; border-radius: 50%; background: rgba(240, 136, 4, .18); }
.auth-side::before { content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; border-radius: 50%; background: rgba(15, 147, 163, .32); }
.auth-side > div { position: relative; z-index: 1; }
.auth-side h1 { color: #fff; font-size: 2.3rem; line-height: 1.15; }
.auth-side .feature { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; color: #d7e0e8; }
.auth-side .feature i { width: 42px; height: 42px; border-radius: .75rem; background: rgba(255, 255, 255, .12); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #ffc46b; flex: 0 0 auto; }
.auth-side .feature strong { color: #fff; display: block; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card { border-radius: 1.1rem; box-shadow: 0 14px 44px rgba(33, 47, 61, .1); }
.auth-logo { height: 54px; width: auto; }

/* ---------- Admin ---------- */
.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; }
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: var(--dm-navy); line-height: 1.1; }
.stat-card .lbl { color: var(--dm-muted); font-size: .95rem; }
.mini-progress { min-width: 90px; }

@media (max-width: 575.98px) {
    .dm-hero { padding: 1.25rem; border-radius: .9rem; }
    .dm-hero h1 { font-size: 1.55rem; }
    .lesson { font-size: 1.06rem; }
    .lesson h3 { font-size: 1.25rem; }
    .dm-stat { min-width: 0; flex: 1 1 30%; padding: .6rem .7rem; }
    .dm-stat .num { font-size: 1.3rem; }
}
