/* ASMA Learning Hub (LMS)
   Reuses the site's brand tokens from main.css; falls back if absent. */

:root {
    --lms-primary: var(--brand-primary, #C1274C);
    --lms-dark:    var(--brand-primary-dark, #8F1C38);
    --lms-soft:    #fdf2f6;
    --lms-line:    #eadfe4;
    --lms-muted:   #6b7280;
}

.lms-narrow { max-width: 900px; }

.lms-h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--lms-dark);
    margin: 2.5rem 0 1rem;
}
.lms-empty {
    background: var(--lms-soft);
    border: 1px dashed var(--lms-line);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    color: var(--lms-muted);
    text-align: center;
}
.lms-prose { line-height: 1.85; color: #374151; margin-bottom: 1.5rem; }
.lms-prose p { margin-bottom: .9rem; }

/* ───────────── buttons ───────────── */
.lms-btn-sm    { padding: .6rem 1.25rem !important; font-size: .95rem !important; display: inline-block; }
.lms-btn-block { display: block; width: 100%; text-align: center; margin-top: .5rem; }
.is-disabled   { opacity: .45; pointer-events: none; }

/* ───────────── forms ───────────── */
.lms-auth-section { padding-top: 3rem; }
.lms-auth-card, .lms-card {
    background: #fff;
    border: 1px solid var(--lms-line);
    border-radius: 22px;
    padding: 2.25rem;
    box-shadow: 0 12px 30px rgba(193, 39, 76, .07);
}
.lms-auth-card { max-width: 520px; margin: 0 auto; }
.lms-card { margin-bottom: 1.5rem; }
.lms-auth-head { text-align: center; margin-bottom: 1.75rem; }
.lms-auth-head h1 { font-size: 1.6rem; color: var(--lms-dark); margin-bottom: .5rem; }
.lms-auth-head p  { color: var(--lms-muted); font-size: .95rem; }
.lms-auth-alt     { text-align: center; margin-top: 1.25rem; color: var(--lms-muted); font-size: .95rem; }
.lms-auth-alt a   { color: var(--lms-primary); font-weight: 700; }

.lms-field { margin-bottom: 1.15rem; }
.lms-field label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: .4rem;
    color: #374151;
}
.lms-field input[type=text],
.lms-field input[type=email],
.lms-field input[type=password],
.lms-field input[type=tel] {
    width: 100%;
    padding: .8rem 1rem;
    border: 1.5px solid var(--lms-line);
    border-radius: 12px;
    font: inherit;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.lms-field input:focus {
    outline: none;
    border-color: var(--lms-primary);
    box-shadow: 0 0 0 3px rgba(193, 39, 76, .12);
}
.lms-hint { display: block; font-size: .8rem; color: var(--lms-muted); margin-top: .35rem; }

.lms-choice-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.lms-choice {
    flex: 1 1 160px;
    display: flex;
    align-items: center;
    gap: .55rem;
    border: 1.5px solid var(--lms-line);
    border-radius: 12px;
    padding: .75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: border-color .2s, background .2s;
}
.lms-choice:has(input:checked) { border-color: var(--lms-primary); background: var(--lms-soft); }
.lms-choice input { accent-color: var(--lms-primary); width: 18px; height: 18px; }

.lms-form-msg {
    border-radius: 12px;
    padding: .8rem 1rem;
    font-size: .92rem;
    margin-bottom: 1rem;
}
.lms-form-msg.is-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.lms-form-msg.is-ok    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ───────────── progress bars ───────────── */
.lms-bar {
    display: block;
    background: #f0e4e9;
    border-radius: 99px;
    height: 12px;
    overflow: hidden;
    width: 100%;
}
.lms-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(to right, var(--lms-primary), var(--lms-dark));
    border-radius: 99px;
    transition: width .5s ease;
}
.lms-bar-sm { height: 7px; margin: .5rem 0; }

.lms-progress-card {
    background: var(--lms-soft);
    border: 1px solid var(--lms-line);
    border-radius: 16px;
    padding: 1.15rem 1.4rem;
    margin-bottom: 1.75rem;
}
.lms-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .6rem;
    font-size: .95rem;
    color: #374151;
}

/* ───────────── course cards ───────────── */
.lms-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.lms-course-card {
    display: block;
    background: #fff;
    border: 1px solid var(--lms-line);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .25s, box-shadow .25s;
}
.lms-course-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(193, 39, 76, .13); }
.lms-course-cover { display: block; aspect-ratio: 16/9; background: var(--lms-soft); overflow: hidden; }
.lms-course-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lms-course-body { display: block; padding: 1.1rem 1.25rem; }
.lms-course-body strong { display: block; font-size: 1.05rem; color: var(--lms-dark); margin-bottom: .4rem; }
.lms-course-meta { display: block; font-size: .85rem; color: var(--lms-muted); line-height: 1.6; }

.lms-cta-card {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fdf2f8, #fff1f2);
    border: 1px solid var(--lms-line);
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2rem;
}
.lms-cta-card h3 { color: var(--lms-dark); margin-bottom: .35rem; font-size: 1.2rem; }
.lms-cta-card p  { color: var(--lms-muted); font-size: .93rem; }
.lms-cta-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ───────────── lesson list ───────────── */
.lms-lesson-list { list-style: none; padding: 0; margin: 0; }
.lms-lesson-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--lms-line);
    border-radius: 14px;
    padding: .95rem 1.15rem;
    margin-bottom: .7rem;
}
.lms-lesson-row.is-locked { opacity: .6; background: #fafafa; }
.lms-lesson-row.is-completed { border-color: #bbf7d0; background: #f8fffb; }
.lms-lesson-num {
    flex: 0 0 34px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--lms-soft);
    color: var(--lms-dark);
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
}
.lms-lesson-row.is-completed .lms-lesson-num { background: #dcfce7; color: #166534; }
.lms-lesson-main { flex: 1 1 auto; min-width: 0; }
.lms-lesson-main h3 { font-size: 1rem; font-weight: 700; color: #1f2937; margin: 0; }
.lms-lesson-action { flex: 0 0 auto; }

.lms-tag {
    display: inline-block;
    padding: .45rem .9rem;
    border-radius: 99px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}
.lms-tag-locked { background: #f3f4f6; color: #9ca3af; }
.lms-tag-done   { background: #dcfce7; color: #166534; }

/* ───────────── exam card on course page ───────────── */
.lms-exam-card {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 2px solid var(--lms-primary);
    border-radius: 18px;
    padding: 1.4rem 1.6rem;
}
.lms-exam-card.is-locked { border-color: var(--lms-line); opacity: .75; }
.lms-exam-info h3 { color: var(--lms-dark); margin-bottom: .3rem; font-size: 1.15rem; }
.lms-exam-info p  { color: var(--lms-muted); font-size: .9rem; }

/* ───────────── player ───────────── */
.lms-lesson-title { font-size: 1.6rem; color: var(--lms-dark); margin: 1rem 0 1.25rem; }
.lms-video-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.lms-video-wrap iframe,
.lms-video-wrap > div,
.lms-video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lms-video-missing {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #d1d5db; text-align: center; padding: 2rem;
}
.lms-watch-status { margin-bottom: 1.5rem; }
.lms-watch-status p { font-size: .88rem; color: var(--lms-muted); margin-top: .5rem; }
.lms-nav-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--lms-line);
}

/* ───────────── exam page ───────────── */
.lms-exam-head { margin-bottom: 1.25rem; }
.lms-exam-head h1 { font-size: 1.6rem; color: var(--lms-dark); margin-bottom: .5rem; }
.lms-exam-meta { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .92rem; color: var(--lms-muted); }
.lms-timer { font-weight: 800; color: var(--lms-primary); }

.lms-question {
    background: #fff;
    border: 1px solid var(--lms-line);
    border-radius: 16px;
    padding: 1.4rem 1.6rem;
    margin-bottom: 1rem;
}
.lms-question-stem { font-size: 1.05rem; font-weight: 700; color: #1f2937; margin-bottom: .9rem; line-height: 1.6; }
.lms-option {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    border: 1.5px solid var(--lms-line);
    border-radius: 12px;
    padding: .75rem 1rem;
    margin-bottom: .55rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    line-height: 1.5;
}
.lms-option:hover { border-color: var(--lms-primary); }
.lms-option:has(input:checked) { border-color: var(--lms-primary); background: var(--lms-soft); }
.lms-option input { accent-color: var(--lms-primary); width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }

.lms-result {
    text-align: center;
    background: #fff;
    border: 2px solid var(--lms-line);
    border-radius: 20px;
    padding: 2.5rem 2rem;
}
.lms-result.is-pass { border-color: #86efac; background: #f8fffb; }
.lms-result.is-fail { border-color: #fecaca; background: #fffafa; }
.lms-result-score { font-size: 3rem; font-weight: 800; color: var(--lms-primary); line-height: 1; margin-bottom: .5rem; }
.lms-result.is-pass .lms-result-score { color: #16a34a; }
.lms-result h2 { font-size: 1.35rem; margin-bottom: .5rem; color: var(--lms-dark); }
.lms-result p  { color: var(--lms-muted); margin-bottom: 1.25rem; }
.lms-review { text-align: start; margin-top: 2rem; }
.lms-review-item {
    border-inline-start: 4px solid #e5e7eb;
    padding: .6rem 1rem;
    margin-bottom: .6rem;
    background: #fafafa;
    border-radius: 0 10px 10px 0;
}
.lms-review-item.is-ok  { border-inline-start-color: #16a34a; }
.lms-review-item.is-bad { border-inline-start-color: #dc2626; }
.lms-review-item p { font-size: .88rem; margin-top: .35rem; color: var(--lms-muted); }

/* ───────────── dashboard ───────────── */
.lms-h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--lms-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 1.75rem 0 .85rem;
}

.lms-dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.lms-dash-stat {
    background: var(--lms-soft);
    border: 1px solid var(--lms-line);
    border-radius: 16px;
    padding: 1.1rem 1rem;
    text-align: center;
}
.lms-dash-num {
    display: block;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--lms-primary);
    line-height: 1.1;
}
.lms-dash-label { display: block; font-size: .82rem; color: var(--lms-muted); margin-top: .25rem; }

.lms-dash-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    border-bottom: 1px solid var(--lms-line);
    padding-bottom: .9rem;
}
.lms-dash-nav a {
    padding: .45rem 1rem;
    border-radius: 99px;
    background: #fff;
    border: 1px solid var(--lms-line);
    font-size: .9rem;
    font-weight: 600;
    color: var(--lms-dark);
    text-decoration: none;
    transition: background .2s, border-color .2s;
}
.lms-dash-nav a:hover { background: var(--lms-soft); border-color: var(--lms-primary); }

.lms-course-card.is-done { border-color: #bbf7d0; background: #f8fffb; }

/* Anchor targets must clear the sticky header. */
#lms-courses, #lms-certificates, #lms-account { scroll-margin-top: 110px; }

@media (max-width: 640px) {
    .lms-dash-stats { grid-template-columns: 1fr; gap: .6rem; }
    .lms-dash-stat  { display: flex; align-items: baseline; justify-content: space-between; text-align: start; }
    .lms-dash-num   { font-size: 1.4rem; }
}

/* ───────────── profile / certificates ───────────── */
.lms-cert-list { list-style: none; padding: 0; margin: 0; }
.lms-cert-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--lms-line);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: .7rem;
}
.lms-cert-icon { font-size: 1.6rem; flex: 0 0 auto; }
.lms-cert-main { flex: 1 1 auto; min-width: 0; }
.lms-cert-main strong { display: block; color: var(--lms-dark); margin-bottom: .25rem; }
.lms-signout { text-align: center; margin-top: 2rem; }
.lms-signout a { color: var(--lms-muted); text-decoration: underline; }

.lms-cert-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

/* ───────────── verification ───────────── */
.lms-verify-card {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    background: #fff;
    border: 2px solid var(--lms-line);
    border-radius: 22px;
    padding: 2.5rem 2rem;
}
.lms-verify-card.is-valid   { border-color: #86efac; }
.lms-verify-card.is-invalid { border-color: #fecaca; }
.lms-verify-icon {
    width: 66px; height: 66px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800;
    margin: 0 auto 1rem;
}
.lms-verify-card.is-valid   .lms-verify-icon { background: #dcfce7; color: #16a34a; }
.lms-verify-card.is-invalid .lms-verify-icon { background: #fee2e2; color: #dc2626; }
.lms-verify-card h1 { font-size: 1.4rem; color: var(--lms-dark); margin-bottom: .4rem; }
.lms-verify-sub { color: var(--lms-muted); font-size: .93rem; margin-bottom: 1.5rem; }
.lms-verify-table { width: 100%; text-align: start; border-collapse: collapse; margin-bottom: 1.5rem; }
.lms-verify-table th, .lms-verify-table td {
    padding: .7rem .5rem;
    border-bottom: 1px solid var(--lms-line);
    font-size: .93rem;
}
.lms-verify-table th { color: var(--lms-muted); font-weight: 600; width: 42%; }
.lms-verify-form { margin-top: 1rem; text-align: start; }

/* ───────────── certificate artwork ───────────── */
.lms-certificate { box-shadow: 0 18px 45px rgba(0, 0, 0, .12); }

/* ───────────── responsive ───────────── */
@media (max-width: 640px) {
    .lms-auth-card, .lms-card { padding: 1.5rem; }
    .lms-lesson-row { flex-wrap: wrap; }
    .lms-lesson-action { width: 100%; }
    .lms-lesson-action .btn-primary, .lms-tag { display: block; text-align: center; }
    .lms-cta-card, .lms-exam-card { flex-direction: column; align-items: stretch; }
    .lms-nav-row { flex-direction: column-reverse; }
    .lms-nav-row a { text-align: center; }
    .lms-certificate { padding: 18px 14px !important; border-width: 8px !important; }
    .lms-certificate h1 { font-size: 22px !important; }
}

/* ───────────── print ───────────── */
@media print {
    .site-header, .site-footer, .no-print, .breadcrumb, .scroll-top { display: none !important; }
    .section { padding: 0 !important; }
    .lms-certificate { box-shadow: none; border-width: 10px; page-break-inside: avoid; }
    @page { size: A4 landscape; margin: 10mm; }
}
