/* ==========================================================================
   ABCL TECH — learner pages: dashboard.html, exam.html, certificate.html
   ========================================================================== */
.ac-page [hidden] { display: none !important; }
.ac-page main { margin: 0; }
.ac-hero { background: linear-gradient(135deg, #0b1830 0%, #10284a 58%, #0d3a2a 100%); color: #cbd5e1; padding: 2rem 1rem 4.2rem; }
.ac-wrap { max-width: 1120px; margin: 0 auto; }
.ac-hero h1 { color: #fff; font-size: clamp(1.45rem, 3vw, 2rem); margin: 0 0 .3rem; line-height: 1.3; }
.ac-hero p { margin: 0; }
.ac-body { padding: 0 1rem 3rem; margin-top: -3rem; }
.ac-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.ac-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 1.25rem 1.3rem; box-shadow: 0 6px 22px rgba(15, 23, 42, .06); min-width: 0; }
.ac-card + .ac-card { margin-top: 1.2rem; }
.ac-card h2 { font-size: 1.1rem; margin: 0 0 .9rem; color: #0f172a; display: flex; align-items: center; gap: .5rem; }
.ac-card h2 i { color: #39b549; }
.ac-muted { color: #64748b; font-size: .9rem; }
.ac-loading { padding: 3rem 1rem; text-align: center; color: #64748b; }

/* profile */
.ac-me { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; }
.ac-av { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: #39b549; color: #fff; font: 700 2rem Roboto, sans-serif; overflow: hidden; border: 4px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.ac-av img { width: 100%; height: 100%; object-fit: cover; }
.ac-name { font-size: 1.2rem; font-weight: 700; color: #0f172a; overflow-wrap: anywhere; }
.ac-email { color: #64748b; font-size: .9rem; overflow-wrap: anywhere; }
.ac-facts { list-style: none; padding: 0; margin: .8rem 0 0; width: 100%; text-align: left; font-size: .9rem; }
.ac-facts li { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem 0; border-top: 1px solid #f1f5f9; }
.ac-facts b { color: #0f172a; text-align: right; }
.ac-name-edit { display: flex; gap: .4rem; width: 100%; }
.ac-name-edit input { flex: 1; min-width: 0; padding: .5rem .7rem; border: 1.5px solid #cbd5e1; border-radius: 9px; font: 1rem var(--font-family); }

/* buttons */
.ac-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: 10px; border: 0; background: #39b549; color: #fff; font: 600 .92rem var(--font-family); text-decoration: none; cursor: pointer; line-height: 1.3; }
.ac-btn:hover { background: #2d8c3a; color: #fff; }
.ac-btn.is-ghost { background: transparent; color: #2d8c3a; border: 1.5px solid #bbf7d0; }
.ac-btn.is-ghost:hover { background: #f0fdf4; }
.ac-btn.is-small { padding: .35rem .7rem; font-size: .84rem; }
.ac-btn:disabled { opacity: .55; cursor: not-allowed; }
.ac-link { background: none; border: 0; color: #2d8c3a; font: 600 .88rem var(--font-family); cursor: pointer; padding: .2rem; }
.ac-btn:focus-visible, .ac-link:focus-visible, .ex-opt:focus-visible, .ex-pal button:focus-visible { outline: 3px solid #86efac; outline-offset: 2px; }

/* stats */
.ac-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.ac-stat { background: #f8fafc; border-radius: 12px; padding: .85rem; text-align: center; }
.ac-stat b { display: block; font: 800 1.6rem Roboto, sans-serif; color: #0f172a; }
.ac-stat span { font-size: .82rem; color: #64748b; }

/* courses */
.ac-course { border: 1px solid #e2e8f0; border-radius: 14px; padding: 1rem 1.1rem; }
.ac-course + .ac-course { margin-top: .8rem; }
.ac-course-h { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.ac-course-h h3 { margin: 0; font-size: 1.05rem; }
.ac-course-h h3 a { color: #0f172a; text-decoration: none; }
.ac-bar { height: 10px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: .6rem 0 .4rem; }
.ac-bar span { display: block; height: 100%; background: linear-gradient(90deg, #39b549, #4ade80); border-radius: 99px; }
.ac-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .7rem; }
.ac-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; margin-top: .7rem; }
.ac-mod { font-size: .8rem; background: #f8fafc; border-radius: 8px; padding: .4rem .55rem; }
.ac-mod b { display: block; color: #334155; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-mod i { display: block; height: 5px; background: #e2e8f0; border-radius: 99px; margin-top: .3rem; overflow: hidden; }
.ac-mod i span { display: block; height: 100%; background: #39b549; }
.ac-empty { text-align: center; padding: 1.5rem .5rem; color: #64748b; }

/* exams table */
.ac-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ac-table th, .ac-table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ac-table th { color: #64748b; font-weight: 600; font-size: .8rem; }
.ac-tag { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #f1f5f9; color: #475569; white-space: nowrap; }
.ac-tag.is-pass { background: #dcfce7; color: #166534; }
.ac-tag.is-fail { background: #fef2f2; color: #991b1b; }
.ac-scroll { overflow-x: auto; overflow-y: hidden; }
.ac-scroll > p { margin: 0; }
.ac-cert { display: flex; gap: 1rem; align-items: center; padding: 1rem; border-radius: 14px; background: linear-gradient(135deg, #f0fdf4, #ecfeff); border: 1px solid #bbf7d0; }
.ac-cert i.fa-award { font-size: 2.2rem; color: #ca8a04; }
.ac-note { font-size: .82rem; color: #64748b; margin-top: .6rem; line-height: 1.55; }

/* ---------- exam ---------- */
.ex-box { max-width: 860px; margin: 0 auto; }
.ex-top { position: sticky; top: 70px; z-index: 5; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: .7rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; box-shadow: 0 4px 16px rgba(15,23,42,.06); }
.ex-timer { font: 700 1.1rem Roboto, sans-serif; color: #0f172a; display: flex; align-items: center; gap: .4rem; }
.ex-timer.is-low { color: #dc2626; }
.ex-prog { flex: 1; min-width: 140px; }
.ex-q { margin-top: 1rem; }
.ex-qn { color: #64748b; font-size: .88rem; margin-bottom: .4rem; }
.ex-qtext { font-size: 1.05rem; line-height: 1.7; color: #0f172a; overflow-wrap: anywhere; }
.ex-qtext pre, .ex-rev pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: .8rem 1rem; overflow-x: auto; font-size: .9rem; line-height: 1.55; }
.ex-qtext code, .ex-opt code, .ex-rev code { font-family: 'JetBrains Mono', monospace; font-size: .92em; }
.ex-qtext :not(pre) > code, .ex-opt code, .ex-rev :not(pre) > code { background: #f1f5f9; color: #0f172a; padding: 0 .25rem; border-radius: 4px; }
.ex-opts { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .55rem; }
.ex-opt { width: 100%; text-align: left; display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem; border: 1.5px solid #e2e8f0; border-radius: 12px; background: #fff; cursor: pointer; font: 1rem var(--font-family); color: #1f2937; line-height: 1.55; overflow-wrap: anywhere; }
.ex-opt:hover { border-color: #86efac; }
.ex-opt[aria-pressed="true"] { border-color: #39b549; background: #f0fdf4; }
.ex-opt .ex-k { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; font-weight: 700; color: #475569; }
.ex-opt[aria-pressed="true"] .ex-k { background: #39b549; color: #fff; }
.ex-nav { display: flex; justify-content: space-between; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.ex-pal { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1.2rem; }
.ex-pal button { width: 2.3rem; height: 2.3rem; border-radius: 8px; border: 1.5px solid #e2e8f0; background: #fff; font: 600 .85rem Roboto, sans-serif; cursor: pointer; color: #475569; }
.ex-pal button.is-done { background: #dcfce7; border-color: #86efac; color: #166534; }
.ex-pal button.is-cur { border-color: #0f172a; }
.ex-result { text-align: center; }
.ex-score { font: 800 3rem Roboto, sans-serif; color: #0f172a; margin: .2rem 0; }
.ex-rev { border: 1px solid #e2e8f0; border-radius: 12px; padding: .9rem 1rem; margin-top: .8rem; }
.ex-rev.is-right { border-left: 5px solid #39b549; }
.ex-rev.is-wrong { border-left: 5px solid #dc2626; }
.ex-rev ol { margin: .5rem 0 0; padding-left: 1.2rem; }
.ex-rev li { margin: .25rem 0; }
.ex-rev li.is-ans { color: #166534; font-weight: 600; }
.ex-rev li.is-mine { color: #991b1b; }
.ex-why { background: #f8fafc; border-radius: 8px; padding: .55rem .75rem; margin-top: .55rem; font-size: .92rem; color: #334155; }

/* ---------- certificate ---------- */
.ce-sheet { max-width: 1000px; margin: 1.5rem auto; background: #fff; border: 10px solid #0d3a2a; outline: 2px solid #39b549; outline-offset: -18px; padding: 3rem 3rem 2.4rem; text-align: center; color: #0f172a; position: relative; aspect-ratio: 1.414 / 1; display: flex; flex-direction: column; justify-content: center; }
.ce-logo { height: 54px; margin: 0 auto .8rem; }
.ce-kicker { font: 700 .95rem var(--font-family); color: #2d8c3a; }
.ce-kicker .ce-en { letter-spacing: .22em; text-transform: uppercase; font-family: Roboto, sans-serif; }
.ce-title { font-size: clamp(1.4rem, 3.4vw, 2.4rem); margin: .3rem 0 1rem; }
.ce-name { font-size: clamp(1.6rem, 4.4vw, 3rem); font-weight: 800; border-bottom: 2px solid #e2e8f0; display: inline-block; padding: 0 1.5rem .3rem; margin: .4rem auto 1rem; overflow-wrap: anywhere; }
.ce-course { font-size: clamp(1.05rem, 2.4vw, 1.5rem); font-weight: 700; color: #0d3a2a; }
.ce-meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; font-size: .9rem; color: #475569; flex-wrap: wrap; text-align: left; }
.ce-meta b { display: block; color: #0f172a; }
.ce-tools { max-width: 1000px; margin: 0 auto; display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }

@media (max-width: 860px) {
  .ac-grid { grid-template-columns: minmax(0, 1fr); }
  .ac-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ce-sheet { padding: 1.6rem 1.2rem; aspect-ratio: auto; border-width: 6px; outline-offset: -12px; }
}
@media print {
  .site-header, .site-footer, .ce-tools, .ac-hero, .abcl-toast { display: none !important; }
  body { padding: 0 !important; background: #fff; }
  .ce-sheet { margin: 0 auto; box-shadow: none; page-break-inside: avoid; }
  @page { size: A4 landscape; margin: 10mm; }
}
