/* LMS styles – every rule is scoped under body.lms so the main site is unaffected.
   Uses the design tokens from ../css/styles.css (colours, radius, shadows, Poppins). */
body.lms { padding-top: 76px; }
body.lms main { min-height: 60vh; }
.lms .lms-banner { background: #FFF8E6; border-bottom: 1px solid #FFE2A0; color: #7A5200; font-size: .85rem; text-align: center; padding: 10px 20px; }
.lms .lms-banner strong { color: #5c3d00; }
.lms .lms-hero { padding: 70px 0 60px; text-align: center; background: var(--bg-white); }
.lms .lms-hero.has-banner { padding-top: 60px; }
.lms .lms-hero p { max-width: 640px; margin: 16px auto 0; color: var(--text-secondary); }
.lms .lms-section { padding: 60px 0; background: var(--bg-white); }
.lms .lms-section.alt { background: var(--bg-page); }
.lms .lms-head { text-align: center; margin-bottom: 36px; }
.lms .lms-head p { color: var(--text-secondary); max-width: 620px; margin: 12px auto 0; }

/* buttons */
.lms .lms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--green); color: #fff; border: 2px solid var(--green); padding: 11px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: .92rem; transition: var(--transition); }
.lms .lms-btn:hover { background: var(--green-hover); border-color: var(--green-hover); transform: translateY(-1px); }
.lms .lms-btn.blue { background: var(--blue); border-color: var(--blue); }
.lms .lms-btn.blue:hover { background: #17197f; border-color: #17197f; }
.lms .lms-btn.ghost { background: #fff; color: var(--blue); border-color: #ACDAF7; }
.lms .lms-btn.ghost:hover { border-color: var(--blue); }
.lms .lms-btn:disabled, .lms .lms-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.lms .lms-btn.sm { padding: 7px 16px; font-size: .82rem; }
.lms a:focus-visible, .lms button:focus-visible, .lms input:focus-visible, .lms select:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 2px; }

/* toolbar */
.lms .lms-toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.lms .lms-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lms .lms-chip { background: #fff; border: 1px solid #D5DCE6; color: var(--text-secondary); border-radius: 100px; padding: 7px 18px; font-size: .85rem; font-weight: 600; transition: var(--transition); }
.lms .lms-chip:hover { border-color: var(--blue); color: var(--blue); }
.lms .lms-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.lms .lms-search { flex: 1 1 240px; max-width: 360px; padding: 11px 18px; border: 1px solid #D5DCE6; border-radius: 100px; font: inherit; font-size: .9rem; background: #fff; }

/* course cards */
.lms .lms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
.lms .lms-card { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; transition: var(--transition); }
.lms .lms-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.lms .lms-card-img { aspect-ratio: 16/9; background: var(--blue); overflow: hidden; }
.lms .lms-card-img img { width: 100%; height: 100%; object-fit: cover; }
.lms .lms-card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.lms .lms-card-body h3 { color: var(--blue); font-size: 1.1rem; line-height: 1.3; }
.lms .lms-card-body p { color: var(--text-secondary); font-size: .88rem; flex: 1; }
.lms .lms-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-tertiary); font-size: .78rem; }
.lms .lms-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.lms .lms-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 4px 12px; border-radius: 100px; background: rgba(34,36,169,.08); color: var(--blue); }
.lms .lms-tag.draft { background: #FFF1CC; color: #7A5200; }
.lms .lms-tag.green { background: rgba(31,122,63,.1); color: var(--green); }
.lms .lms-card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.lms .lms-empty { grid-column: 1/-1; text-align: center; padding: 50px 20px; color: var(--text-secondary); background: var(--bg-page); border: 1px dashed #D5DCE6; border-radius: var(--radius-md); }
.lms .lms-empty .lms-btn { margin-top: 16px; }

/* progress */
.lms .lms-bar { height: 8px; background: #E5EAF1; border-radius: 100px; overflow: hidden; }
.lms .lms-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 100px; }
.lms .lms-pct { font-size: .78rem; color: var(--text-secondary); display: flex; justify-content: space-between; margin-bottom: 6px; }

/* steps */
.lms .lms-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.lms .lms-step { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 28px; }
.lms .lms-step b { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 50%; background: var(--blue); color: #fff; margin-bottom: 14px; }
.lms .lms-step h4 { color: var(--blue); margin-bottom: 6px; }
.lms .lms-step p { color: var(--text-secondary); font-size: .9rem; }

/* course detail & layouts */
.lms .lms-crumbs { font-size: .82rem; color: var(--text-tertiary); margin-bottom: 18px; }
.lms .lms-crumbs a { color: var(--blue); }
.lms .lms-detail { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; }
.lms .lms-detail h1 { color: var(--blue); font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.2; margin: 10px 0 14px; }
.lms .lms-detail h2 { color: var(--blue); font-size: 1.3rem; margin: 32px 0 14px; }
.lms .lms-detail p, .lms .lms-detail li { color: var(--text-secondary); }
.lms .lms-checks li { list-style: none; padding-left: 28px; position: relative; margin-bottom: 8px; }
.lms .lms-checks li::before { content: "\2713"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.lms .lms-side { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 24px; position: sticky; top: 100px; box-shadow: var(--shadow-lg); }
.lms .lms-side img { border-radius: var(--radius-sm); margin-bottom: 18px; }
.lms .lms-side .lms-btn { width: 100%; margin-top: 12px; }
.lms .lms-side ul { margin-top: 14px; font-size: .85rem; color: var(--text-secondary); }
.lms .lms-side li { padding: 6px 0; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; }
.lms .lms-module { border: 1px solid var(--border-light); border-radius: var(--radius-sm); margin-bottom: 12px; background: #fff; overflow: hidden; }
.lms .lms-module summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--blue); display: flex; justify-content: space-between; gap: 12px; }
.lms .lms-module ol { list-style: none; border-top: 1px solid var(--border-light); }
.lms .lms-module li { padding: 10px 18px; font-size: .88rem; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--border-light); }
.lms .lms-module li:last-child { border-bottom: 0; }
.lms .lms-module li a:hover { color: var(--blue); }
.lms .lms-done { color: var(--green); font-weight: 700; }
.lms .lms-note { background: var(--bg-page); border: 1px solid #D5DCE6; border-left: 4px solid var(--blue); border-radius: var(--radius-sm); padding: 14px 18px; font-size: .85rem; color: var(--text-secondary); margin: 18px 0; }
.lms .lms-note.warn { border-left-color: var(--amber); background: #FFF8E6; }
.lms .lms-note.ok { border-left-color: var(--green); background: #EEF8F1; }
.lms .lms-note.err { border-left-color: var(--rose); background: #FFF0F2; }

/* lesson viewer */
.lms .lms-learn { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
.lms .lms-outline { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 20px; position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; }
.lms .lms-outline h4 { color: var(--blue); margin-bottom: 10px; }
.lms .lms-outline h5 { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-tertiary); margin: 16px 0 6px; }
.lms .lms-outline a { display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: .85rem; color: var(--text-secondary); }
.lms .lms-outline a:hover { background: var(--bg-page); }
.lms .lms-outline a.current { background: rgba(34,36,169,.08); color: var(--blue); font-weight: 600; }
.lms .lms-lesson { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 32px; }
.lms .lms-lesson h1 { color: var(--blue); font-size: 1.6rem; margin: 8px 0 18px; }
.lms .lms-video { aspect-ratio: 16/9; background: var(--blue); color: #fff; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; margin-bottom: 20px; font-size: .9rem; }
.lms .lms-lesson p { color: var(--text-secondary); margin-bottom: 14px; }
.lms .lms-lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-light); }

/* dashboard & admin */
.lms .lms-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 36px; }
.lms .lms-stat { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 20px; }
.lms .lms-stat b { display: block; font-size: 1.8rem; color: var(--blue); line-height: 1.2; }
.lms .lms-stat span { font-size: .8rem; color: var(--text-secondary); }
.lms .lms-panel { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 24px; margin-bottom: 28px; }
.lms .lms-panel h2 { color: var(--blue); font-size: 1.2rem; margin-bottom: 16px; }
.lms .lms-tablewrap { overflow-x: auto; }
.lms table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.lms th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-tertiary); padding: 10px 12px; border-bottom: 2px solid var(--border-light); }
.lms td { padding: 12px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); vertical-align: middle; }
.lms td strong { color: var(--text-primary); }
.lms .lms-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }

/* auth forms (reuse .form-group / .form-submit from inner-pages.css) */
.lms .lms-auth { max-width: 460px; margin: 0 auto; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 36px; box-shadow: var(--shadow-lg); }
.lms .lms-auth h1 { color: var(--blue); font-size: 1.6rem; margin-bottom: 6px; }
.lms .lms-auth > p { color: var(--text-secondary); margin-bottom: 22px; font-size: .9rem; }
.lms .lms-auth .form-submit { width: 100%; }
.lms .lms-auth .alt { text-align: center; margin-top: 18px; font-size: .88rem; color: var(--text-secondary); }
.lms .lms-auth .alt a { color: var(--green); font-weight: 600; }
.lms .field-err { color: var(--rose); font-size: .78rem; margin-top: 4px; min-height: 1em; }

/* loading / error */
.lms .lms-loading { text-align: center; padding: 60px 0; color: var(--text-secondary); }
.lms .lms-loading::before { content: ""; display: block; width: 32px; height: 32px; margin: 0 auto 14px; border: 3px solid #D5DCE6; border-top-color: var(--blue); border-radius: 50%; animation: lmsspin .8s linear infinite; }
@keyframes lmsspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lms .lms-loading::before { animation: none; } .lms .lms-card, .lms .lms-btn { transition: none; } }

@media (max-width: 1024px) { .lms .lms-detail, .lms .lms-learn { grid-template-columns: 1fr; } .lms .lms-side, .lms .lms-outline { position: static; max-height: none; } }
@media (max-width: 768px) { .lms .lms-section { padding: 40px 0; } .lms .lms-lesson { padding: 22px; } .lms .lms-auth { padding: 26px; } .lms .lms-toolbar { flex-direction: column; align-items: stretch; } .lms .lms-search { max-width: none; } }

/* admin + forms additions */
.lms .lms-lmeta { margin-left: auto; color: var(--text-tertiary); font-size: .78rem; }
.lms .lms-video iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); }
.lms .lms-video { padding: 0; overflow: hidden; }
.lms .lms-rowhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lms .lms-rowhead h2 { margin: 0; }
.lms .lms-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lms .lms-check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.lms .lms-check input { width: auto; }
.lms .lms-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.lms .lms-inline { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.lms .lms-inline input { flex: 1 1 240px; padding: 10px 14px; border: 1px solid #D5DCE6; border-radius: var(--radius-sm); font: inherit; }
.lms .lms-lrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: .9rem; }
.lms .lms-lessonform { background: var(--bg-page); border: 1px solid #D5DCE6; border-radius: var(--radius-sm); padding: 18px; margin-top: 14px; }
.lms .lms-lessonform h4 { color: var(--blue); margin-bottom: 10px; }
.lms .lms-panel textarea, .lms .lms-panel select, .lms .lms-panel input:not([type=checkbox]) { width: 100%; }
.lms #lms-flash:empty { display: none; }
.lms .lms-auth .forgot { display: block; text-align: right; font-size: .82rem; margin: -6px 0 14px; color: var(--green); font-weight: 600; }
@media (max-width: 768px) { .lms .lms-two { grid-template-columns: 1fr; } }

/* form labels: the shared .form-group styles are for the dark contact panel, so restyle them for white cards */
.lms .form-group { margin-bottom: 16px; }
.lms .form-group label { color: var(--text-primary); font-size: .85rem; font-weight: 600; }
.lms .form-group input, .lms .form-group select, .lms .form-group textarea { border: 1.5px solid #D5DCE6; background: #fff; font-size: .92rem; padding: 12px 16px; }
.lms .form-group input:disabled { background: var(--bg-page); color: var(--text-tertiary); }
.lms .form-group textarea { min-height: 90px; }
.lms .lms-check { font-weight: 500 !important; }
