/* -------------------------------------------------------------------------
   Course completion badge, credential page and shared buttons.
   Used by free_online_course.php and course_certificate_verify.php.
   ------------------------------------------------------------------------- */

/* ---- buttons ------------------------------------------------------------- */
.course-btn { display: inline-block; background: #41b7a5; color: #fff; border: none; border-radius: 5px;
              padding: 0.65rem 1.4rem; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.course-btn:hover { background: #369385; color: #fff; }
/* style.css sets `a:link { color: var(--text-dark) }`, whose specificity beats
   a plain .course-btn rule; match the anchor states so button links stay legible. */
a.course-btn, a.course-btn:link, a.course-btn:visited,
a.course-btn:hover, a.course-btn:active { color: #fff; text-decoration: none; }
.course-btn.secondary { background: #6c757d; }
.course-btn.secondary:hover { background: #57606a; }
.course-btn.linkedin { background: #0a66c2; }
.course-btn.linkedin:hover { background: #084d92; }
.course-btn:disabled { opacity: 0.5; cursor: default; }
.btn-ico { vertical-align: -0.18em; margin-right: 0.45rem; }

/* ---- alerts -------------------------------------------------------------- */
.course-alert { padding: 0.75rem 1rem; border-radius: 5px; margin-bottom: 1rem; }
.course-alert.error { background: #fbeaea; border: 1px solid #e0b4b4; color: #9f3a38; }
.course-alert.success { background: #e7f6ef; border: 1px solid #a6dcc0; color: #1e7a52; }
.course-alert ul { margin: 0; padding-left: 1.2rem; }

/* ---- completion badge ---------------------------------------------------- */
.course-badge { margin: 0.5rem auto 2rem; padding: 2rem 1.5rem; max-width: 520px; text-align: center;
                border: 1px solid #cdeae4; border-radius: 12px;
                background: linear-gradient(180deg, #f4fbf9 0%, #ffffff 100%); }
.badge-seal { display: block; margin: 0 auto 1rem; filter: drop-shadow(0 4px 10px rgba(65, 183, 165, 0.35)); }
.badge-kicker { font-family: 'Lato', sans-serif; font-size: 0.8rem; font-weight: 900; letter-spacing: 0.18em;
                text-transform: uppercase; color: #369385; margin: 0 0 0.4rem; }
.badge-title { font-size: 1.4rem; line-height: 1.3; margin: 0 0 0.6rem; color: #212529; }
.badge-meta { font-size: 0.95rem; color: #6f767c; margin: 0 0 1.5rem; }
.course-badge .course-btn { margin: 0 0.25rem 0.5rem; }
.badge-note { font-size: 0.85rem; color: #6f767c; margin: 0.75rem 0 0; }

/* Share row inside the badge */
.badge-share { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #dcefea; }
.badge-share .share-label { font-size: 0.85rem; color: #6f767c; margin: 0 0 0.75rem; }

/* The course page wraps this badge in .online_course, whose style.css rules
   (`.online_course h3 { color: #41b7a5 !important }` and
   `.online_course p { font-size: 1.2rem !important }`) would otherwise reset
   the badge typography. An !important declaration only loses to another
   !important, so match them and win on specificity. */
.course-badge .badge-kicker { font-size: 0.8rem !important; line-height: 1.4 !important; margin: 0 0 0.4rem !important; }
.course-badge .badge-title  { font-size: 1.4rem !important; color: #212529 !important; margin: 0 0 0.6rem !important; }
.course-badge .badge-meta   { font-size: 0.95rem !important; margin: 0 0 1.5rem !important; }
.course-badge .badge-note   { font-size: 0.85rem !important; line-height: 1.5 !important; margin: 0.75rem 0 0 !important; }
.course-badge .share-label  { font-size: 0.85rem !important; line-height: 1.5 !important; margin: 0 0 0.75rem !important; }

/* ---- "already earned" banner above the modules --------------------------- */
.course-earned { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
                 border: 1px solid #cdeae4; border-left: 5px solid #41b7a5; border-radius: 8px;
                 background: #f4fbf9; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.course-earned .badge-seal { margin: 0; flex: 0 0 auto; filter: none; }
.course-earned .earned-copy { flex: 1 1 220px; }
.course-earned .earned-copy strong { display: block; color: #1e7a52; font-size: 1.05rem; }
.course-earned .earned-copy span { font-size: 0.9rem; color: #6f767c; }
.course-earned .course-btn { flex: 0 0 auto; }

/* ---- public credential page ---------------------------------------------- */
.credential { max-width: 640px; margin: 0 auto; text-align: center; }
.credential .badge-seal { margin-bottom: 1.25rem; }
.credential-name { font-size: 2rem; line-height: 1.2; margin: 0 0 0.75rem; color: #212529; }
.credential-lead { font-size: 1rem; color: #6f767c; margin: 0 0 0.35rem; }
.credential-course { font-size: 1.35rem; line-height: 1.3; margin: 0 0 1.5rem; color: #25665c; }

.credential-facts { list-style: none; margin: 0 0 1.75rem; padding: 1.25rem;
                    border: 1px solid #e4e7e8; border-radius: 10px; background: #fafbfb; text-align: left; }
.credential-facts li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
                       padding: 0.5rem 0; border-bottom: 1px solid #eef1f1; font-size: 0.95rem; }
.credential-facts li:last-child { border-bottom: none; }
.credential-facts .k { color: #6f767c; }
.credential-facts .v { color: #212529; font-weight: 600; text-align: right; word-break: break-word; }

.credential-verified { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1.75rem;
                       padding: 0.5rem 1rem; border-radius: 999px; background: #e7f6ef;
                       border: 1px solid #a6dcc0; color: #1e7a52; font-size: 0.9rem; font-weight: 600; }

.credential-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 1.5rem; }
.credential-copy { display: flex; gap: 0.5rem; max-width: 480px; margin: 0 auto 1.5rem; }
.credential-copy input { flex: 1 1 auto; min-width: 0; padding: 0.6rem 0.7rem; border: 1px solid #ccc;
                         border-radius: 5px; font-size: 0.9rem; color: #6f767c; background: #fff; }
.credential-copy .course-btn { flex: 0 0 auto; white-space: nowrap; }
.credential-foot { font-size: 0.9rem; color: #6f767c; }

/* ---- entrance animation, motion-preference aware ------------------------- */
@keyframes badgePop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes badgeDraw { to { stroke-dashoffset: 0; } }
.course-badge .badge-seal, .credential .badge-seal { animation: badgePop 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
.course-badge .badge-check, .credential .badge-check { stroke-dasharray: 60; stroke-dashoffset: 60; animation: badgeDraw 0.45s ease-out 0.45s forwards; }
@media (prefers-reduced-motion: reduce) {
  .course-badge .badge-seal, .credential .badge-seal { animation: none; }
  .course-badge .badge-check, .credential .badge-check { stroke-dashoffset: 0; animation: none; }
}
