/* =========================================================================
   Components - each class block is one reusable component.
   Reference page: /ui-kit
   ========================================================================= */

/* ---- Button ------------------------------------------------------------ */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r-md);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 650; font-size: var(--fs-sm); letter-spacing: -0.005em; line-height: 1;
  white-space: nowrap; text-decoration: none !important; user-select: none;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t), transform var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-disabled { opacity: 0.55; pointer-events: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: var(--on-brand); --btn-bd: transparent; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-700); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 10px 28px -10px color-mix(in oklab, var(--accent) 70%, transparent); }
.btn-accent:hover { background: var(--accent-700); }
.btn-dark { --btn-bg: var(--ink-brand); --btn-fg: #fff; --btn-bd: transparent; }
.btn-dark:hover { background: color-mix(in oklab, var(--ink-brand) 85%, #fff); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { --btn-bg: var(--brand-50); --btn-fg: var(--brand-700); --btn-bd: transparent; }
.btn-soft:hover { background: var(--brand-100); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: transparent; }
.btn-danger:hover { background: color-mix(in oklab, var(--danger) 88%, #000); }
:root[data-theme="dark"] .btn-danger { --btn-fg: #2a0a0a; }
.btn-sm { height: 36px; padding: 0 12px; border-radius: var(--r-sm); }
.btn-lg { height: 52px; padding: 0 24px; font-size: var(--fs-base); border-radius: var(--r-md); }
.btn-xl { height: 58px; padding: 0 28px; font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); }

/* ---- Card -------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: clamp(18px, 2.5vw, 28px); }
.card-hover { transition: transform var(--t), box-shadow var(--t), border-color var(--t); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* ---- Badge / chip -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-full); font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-accent { background: var(--accent-50); color: var(--accent-700); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-dark { background: rgb(10 16 32 / 0.72); color: #fff; backdrop-filter: blur(6px); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; text-decoration: none !important; transition: all var(--t-fast); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .count { font-size: 12px; color: inherit; opacity: 0.65; }

/* ---- Forms -------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.label { font-size: var(--fs-sm); font-weight: 650; color: var(--text); display: flex; justify-content: space-between; align-items: baseline; }
.label a { font-weight: 600; font-size: var(--fs-sm); }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover { border-color: color-mix(in oklab, var(--border-strong) 60%, var(--text-3)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input-group { position: relative; }
.input-group > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group > .input { padding-left: 42px; }
.input-group > .input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.help { font-size: var(--fs-xs); color: var(--text-3); }
.field-error { display: flex; gap: 6px; align-items: center; font-size: var(--fs-xs); font-weight: 600; color: var(--danger); }
.input.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 25%, transparent); }
.strength { display: grid; gap: 6px; }
.strength-bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.strength-bar span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 250ms var(--ease), background 250ms; }
.strength[data-level="1"] .strength-bar span { width: 25%; background: var(--danger); }
.strength[data-level="2"] .strength-bar span { width: 50%; background: var(--warning); }
.strength[data-level="3"] .strength-bar span { width: 75%; background: color-mix(in oklab, var(--success) 70%, var(--warning)); }
.strength[data-level="4"] .strength-bar span { width: 100%; background: var(--success); }
.otp-input { height: 64px; text-align: center; font-family: var(--font-mono); font-size: 1.9rem; font-weight: 700; letter-spacing: 0.55em; padding-left: 0.55em; }
.otp-input::placeholder { letter-spacing: 0.55em; color: var(--border-strong); }
details > summary.btn { list-style: none; width: fit-content; }
details > summary.btn::-webkit-details-marker { display: none; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.icon-hero { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); margin-bottom: 20px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---- Alerts / toasts ----------------------------------------------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: var(--fs-sm); border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in oklab, var(--brand) 18%, transparent); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.toasts { position: fixed; z-index: 90; right: 16px; top: calc(var(--header-h) + 12px); display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); animation: toast-in 280ms var(--ease) both; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--brand); }
.toast-success .dot { background: var(--success); } .toast-warning .dot { background: var(--warning); } .toast-error .dot { background: var(--danger); }
.toast.is-leaving { animation: toast-out 220ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ---- Avatar ------------------------------------------------------------- */
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 0.02em; flex: none; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ---- Progress ----------------------------------------------------------- */
.progress { height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), color-mix(in oklab, var(--brand) 60%, var(--accent))); transition: width 600ms var(--ease); }
.progress-sm { height: 5px; }
.ring { --p: 0; --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); font-size: 11px; font-weight: 750; color: var(--text); flex: none; transition: --p 600ms; }
.ring::before { content: ""; grid-area: 1/1; width: calc(var(--size) - 8px); height: calc(var(--size) - 8px); border-radius: 50%; background: var(--surface); }
.ring > span { grid-area: 1/1; position: relative; }

/* ---- Tabs ---------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; padding: 12px 14px; font-weight: 650; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }

/* ---- Accordion (native <details>) --------------------------------------- */
.accordion { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.accordion details + details { border-top: 1px solid var(--border); }
.accordion summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; font-weight: 650; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { background: var(--surface-2); }
.accordion summary .chev { margin-left: auto; transition: transform var(--t); color: var(--text-3); }
.accordion details[open] summary .chev { transform: rotate(180deg); }
.accordion .panel { padding: 0 18px 14px; }

/* ---- Lists -------------------------------------------------------------- */
.check-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; }
.check-list .icon { color: var(--success); margin-top: 3px; }
.meta-list { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-2); font-size: var(--fs-sm); }
.meta-list > span { display: inline-flex; align-items: center; gap: 6px; }
.meta-list .icon { width: 16px; height: 16px; color: var(--text-3); }

/* ---- Pagination ---------------------------------------------------------- */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); }
.pagination a:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.pagination .is-current { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---- Empty state --------------------------------------------------------- */
.empty { text-align: center; padding: clamp(32px, 6vw, 64px) 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl); background: var(--surface); }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }

/* ---- Stat ---------------------------------------------------------------- */
.stat { display: grid; gap: 2px; }
.stat-value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.03em; color: var(--ink); line-height: 1.05; }
.stat-label { color: var(--text-3); font-size: var(--fs-sm); }

/* ---- Course card -------------------------------------------------------- */
.course-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; color: inherit; text-decoration: none !important; }
.course-card .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.course-card:hover .thumb img { transform: scale(1.04); }
.course-card .thumb .badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.course-card .body { display: flex; flex-direction: column; gap: 10px; padding: 18px; flex: 1; }
.course-card h3 { font-size: 1.075rem; }
.course-card .desc { color: var(--text-2); font-size: var(--fs-sm); }
.course-card .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .now { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -0.02em; }
.price .was { color: var(--text-3); text-decoration: line-through; font-size: var(--fs-sm); }
.price .off { color: var(--success); font-weight: 700; font-size: var(--fs-xs); }
.price-free { color: var(--success); }
.emi-hint { font-size: var(--fs-xs); color: var(--text-3); }

/* Placeholder cover when no image / image fails */
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; text-align: center; color: #fff; font-family: var(--font-display); font-weight: 750; font-size: 1.05rem; letter-spacing: -0.01em;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in oklab, var(--brand) 90%, #fff) 0%, var(--brand-800) 55%, var(--ink-brand) 100%); }
.cover-fallback::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 100% 100%, color-mix(in oklab, var(--accent) 55%, transparent), transparent 70%); }
.cover-fallback span { position: relative; z-index: 1; }

/* ---- Skeleton ------------------------------------------------------------ */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Table ---------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 650; color: var(--text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table td { padding: 14px; border-bottom: 1px solid var(--border); }

/* ---- Dropdown (details based) ------------------------------------------- */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; padding: 6px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); z-index: 60; animation: toast-in 160ms var(--ease) both; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; text-align: left; }
.menu-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-head { padding: 10px 12px 8px; }

/* ===================================================================== */
/* Ratings, reviews, feedback forms, leaderboards, compliance, coding tasks */
/* ===================================================================== */
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.rating strong { color: var(--text); }
.rating .count { color: var(--text-3); font-size: var(--fs-xs); }
.rating-lg { font-size: var(--fs-md); }
.stars { --rating: 0; position: relative; display: inline-block; letter-spacing: 1px; line-height: 1;
  background: linear-gradient(90deg, #f59e0b calc(var(--rating) / 5 * 100%), var(--border-strong) 0);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars-inline { color: #f59e0b; letter-spacing: 1px; }
.stars-inline .subtle { color: var(--border-strong); }
.rating-new { font-size: var(--fs-xs); }
.course-card .rating, .course-card .rating-new { margin-top: 4px; align-self: flex-start; width: auto; }

.reviews-top { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 20px; align-items: start; }
.review-summary { text-align: center; position: sticky; top: calc(var(--header-h) + 16px); }
.review-score { font-family: var(--font-display); font-size: var(--fs-4xl); font-weight: 800; line-height: 1; }
.review-summary .stars { font-size: var(--fs-lg); margin-top: 6px; }
.dist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: var(--fs-xs); }
.dist li { display: grid; grid-template-columns: 28px 1fr 28px; gap: 8px; align-items: center; }
.dist-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.dist-track span { display: block; height: 100%; background: #f59e0b; border-radius: 99px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.review-card { margin: 0; display: flex; flex-direction: column; }
.review-card figcaption { display: grid; }
.review-card blockquote { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-normal); }
.review-photo, .review-initials { width: 52px; height: 52px; border-radius: 50%; flex: none; object-fit: cover; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand-100); }
.review-initials { display: grid; place-items: center; font-weight: 800; color: var(--on-brand); background: linear-gradient(135deg, var(--brand), var(--accent)); }
.review-form summary { cursor: pointer; }
@media (max-width: 760px) { .reviews-top { grid-template-columns: 1fr; } .review-summary { position: static; } }

/* feedback questions */
.fb-q { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.fb-q legend { font-weight: 700; margin-bottom: 8px; display: flex; gap: 10px; align-items: baseline; }
.fb-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-size: var(--fs-xs); }
.fb-q .req { color: var(--danger); }
.fb-stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.fb-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fb-stars label { font-size: 34px; line-height: 1; cursor: pointer; color: var(--border-strong); transition: color var(--t-fast), transform var(--t-fast); }
.fb-stars label:hover, .fb-stars label:hover ~ label, .fb-stars input:checked ~ label { color: #f59e0b; }
.fb-stars label:hover { transform: scale(1.12); }
.fb-stars input:focus-visible + label { outline: 2px solid var(--ring); border-radius: 4px; }
.fb-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; }
.fb-scale label { position: relative; }
.fb-scale input { position: absolute; opacity: 0; }
.fb-scale span { display: grid; place-items: center; height: 40px; border-radius: 10px; border: 1px solid var(--border); font-weight: 700; cursor: pointer; background: var(--surface); }
.fb-scale input:checked + span { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.fb-scale input:focus-visible + span { outline: 2px solid var(--ring); }
.fb-options { display: grid; gap: 8px; }
.fb-texts { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.fb-texts li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: var(--fs-sm); }

/* leaderboards */
.lb-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.lb-row { display: grid; grid-template-columns: 40px 1fr auto 64px; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.lb-row.rank-1 { background: linear-gradient(90deg, #fef3c7, var(--surface-2)); }
.lb-row.rank-2 { background: linear-gradient(90deg, #e5e7eb, var(--surface-2)); }
.lb-row.rank-3 { background: linear-gradient(90deg, #fde2cc, var(--surface-2)); }
.lb-row.is-me { box-shadow: inset 0 0 0 2px var(--brand); }
.lb-rank { font-size: 22px; text-align: center; font-weight: 800; }
.lb-score { text-align: right; font-size: var(--fs-md); }
.lb-pulse { animation: lbPulse 1.6s ease-in-out infinite; }
@keyframes lbPulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .lb-pulse { animation: none; } }
[data-theme="dark"] .lb-row.rank-1, [data-theme="dark"] .lb-row.rank-2, [data-theme="dark"] .lb-row.rank-3 { background: var(--surface-2); }

/* compliance + declaration */
.compliance-steps { list-style: none; counter-reset: st; padding: 0; margin: 0; display: grid; gap: 10px; }
.compliance-steps li { counter-increment: st; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); }
.compliance-steps li::before { content: counter(st); grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); font-weight: 800; }
.compliance-steps li.is-done::before { content: "✓"; background: var(--success); color: #fff; }
.compliance-steps span { color: var(--text-3); font-size: var(--fs-sm); }
.declaration { margin: 0; padding: 18px 20px; border-left: 4px solid var(--brand); background: var(--brand-50); border-radius: 0 12px 12px 0; line-height: var(--lh-normal); }
[data-theme="dark"] .declaration { background: var(--surface-2); }

/* coding tasks */
.subj-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .subj-grid { grid-template-columns: 1fr; } }
.code-input, .code-block { font-family: var(--font-mono); font-size: 13px; line-height: 1.55; tab-size: 4; }
.code-block { white-space: pre-wrap; word-break: break-word; background: #0b1220; color: #e2e8f0; padding: 16px; border-radius: 12px; max-height: 520px; overflow: auto; }
.crit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.crit-list li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); }
.crit-list li.is-met { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); background: var(--success-bg); }
.crit-list li.is-miss { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); background: var(--warning-bg); }

/* report filter bar + numeric columns */
.report-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.report-filters .field { margin: 0; }
.report-apply .btn { width: 100%; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* scheduled jobs */
.job-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.job-facts dt { color: var(--text-3); }
.job-facts dd { margin: 0; }

/* page header on learner pages that reuse the staff layout blocks (e.g. My report card) */
.app-main .page-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 8px; }
.app-main .page-title h1 { font-size: var(--fs-2xl); }
.app-main .page-title .crumb { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.row-muted td { color: var(--text-3); }

/* ===== Trainer network ===== */
.skill-picker { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.skill-groups { display: grid; gap: 12px; max-height: 360px; overflow-y: auto; padding: 4px 2px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.skill-cat { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip { position: relative; cursor: pointer; }
.skill-chip input { position: absolute; opacity: 0; pointer-events: none; }
.skill-chip span { display: inline-block; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-sm); transition: background var(--t-fast), border-color var(--t-fast); }
.skill-chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.skill-chip input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.skill-chip input:disabled + span { opacity: .45; cursor: not-allowed; }
.skill-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.skill-tag { font-size: var(--fs-xs); padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.skill-tag.is-match { background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.input-sm { padding: 8px 12px; font-size: var(--fs-sm); }
.talent-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .talent-grid { grid-template-columns: 1fr; } }
.fact-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: var(--fs-sm); }
.fact-list dt { color: var(--text-3); }
.fact-list dd { margin: 0; }
.recon { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.recon div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.recon strong { display: block; font-size: var(--fs-lg); }
.recon span { font-size: var(--fs-xs); color: var(--text-3); }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.doc-expired { color: var(--danger); font-weight: 700; }
.doc-soon { color: var(--warning); font-weight: 700; }
.hero-trainers { padding: clamp(32px, 6vw, 72px) 0; background: linear-gradient(135deg, var(--brand-50), var(--surface)); }

/* ===== Tracks ===== */
.track-modules { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.track-modules li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.track-step { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 800; }
/* learner roadmap: hero box + step path (1 - 2 - 3 ... finish) + one card per step */
.track-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 20px 28px; padding: clamp(20px, 3vw, 32px);
  background: radial-gradient(120% 140% at 100% 0%, var(--brand-100), transparent 55%), linear-gradient(180deg, var(--brand-50), var(--surface)); border-color: var(--brand-200); }
.track-hero h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; }
.track-hero-stats { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 14px; }
.track-hero-stats > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }
.track-hero-stats strong { color: var(--text); }
.track-hero-ring { display: grid; justify-items: center; align-content: center; gap: 6px; }
.ring.ring-xl { --size: 104px; font-size: 20px; font-weight: 800; }
.ring.ring-xl::before { width: calc(var(--size) - 16px); height: calc(var(--size) - 16px); }
.ring > span { grid-area: 1/1; position: relative; }

.track-path { grid-column: 1 / -1; list-style: none; margin: 4px 0 0; padding: 18px 4px 4px; display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x proximity;
  border-top: 1px dashed var(--brand-200); }
.tp-step { position: relative; flex: 1 1 0; min-width: 118px; scroll-snap-align: start; }
.tp-step::before { content: ""; position: absolute; top: 22px; left: calc(-50% + 26px); right: calc(50% + 26px); height: 4px; border-radius: 4px; background: var(--surface-3); }
.tp-step:first-child::before { display: none; }
.tp-step.is-done::before, .tp-step.is-current::before { background: var(--success); }
.tp-finish.is-done::before { background: var(--success); }
.tp-link { display: grid; justify-items: center; gap: 8px; text-align: center; color: inherit; text-decoration: none !important; padding: 0 6px; }
.tp-node { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-3);
  box-shadow: var(--shadow-xs); transition: transform var(--t-fast); }
.tp-node .icon { width: 20px; height: 20px; }
a.tp-link:hover .tp-node { transform: translateY(-2px); }
.tp-step.is-done .tp-node { background: var(--success); border-color: var(--success); color: #fff; }
.tp-step.is-current .tp-node { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 0 0 6px var(--brand-100); animation: tp-pulse 2.4s var(--ease) infinite; }
.tp-step.is-optional .tp-node { border-style: dashed; }
.tp-finish .tp-node { background: var(--warning-bg, var(--surface-2)); border-color: var(--warning, var(--border-strong)); color: var(--warning, var(--text-2)); }
.tp-finish.is-done .tp-node { background: var(--warning); color: #fff; }
.tp-label { display: grid; gap: 2px; }
.tp-num { font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tp-step.is-current .tp-num { color: var(--brand-700); }
.tp-step.is-done .tp-num { color: var(--success); }
.tp-name { font-size: var(--fs-sm); font-weight: 650; color: var(--text); line-height: 1.3; }
@keyframes tp-pulse { 0%, 100% { box-shadow: 0 0 0 6px var(--brand-100); } 50% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .tp-step.is-current .tp-node { animation: none; } }
@media (max-width: 640px) { .track-hero { grid-template-columns: 1fr; } .track-hero-ring { justify-items: start; align-items: center; grid-auto-flow: column; justify-content: start; gap: 12px; } .tp-step { min-width: 104px; } .ring.ring-xl { --size: 76px; font-size: 16px; } }

.roadmap { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; position: relative; }
.roadmap > li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 14px; scroll-margin-top: 90px; }
.roadmap > li:not(:last-child)::after { content: ""; position: absolute; left: 20px; top: 46px; bottom: -14px; width: 3px; border-radius: 3px; background: var(--surface-3); }
.roadmap > li.is-done:not(:last-child)::after { background: var(--success); }
.roadmap .track-step { width: 42px; height: 42px; position: relative; z-index: 1; background: var(--surface); color: var(--text-2); border: 2px solid var(--border-strong); }
.roadmap .is-current .track-step { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.roadmap .is-done .track-step { background: var(--success); border-color: var(--success); color: #fff; }
.roadmap-card { display: grid; gap: 12px; border-left: 4px solid var(--border-strong); transition: box-shadow var(--t-fast), transform var(--t-fast); }
.roadmap-card:hover { box-shadow: var(--shadow-sm); }
.is-current .roadmap-card { border-left-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-200), var(--shadow-sm); }
.is-done .roadmap-card { border-left-color: var(--success); }
.rm-kicker { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.rm-next { color: var(--brand-700); }
.rm-hint { display: flex; align-items: center; gap: 6px; color: var(--brand-700); font-weight: 600; }
.rm-title { font-size: var(--fs-md); margin-top: 2px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-sm); color: var(--text-2); }
.mini-stats strong { color: var(--text); }

/* ===== Public track page: learning path (start -> courses -> finish) + savings ===== */
.tpath-save { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 18px 22px;
  background: linear-gradient(135deg, var(--success-bg), var(--surface)); border-color: color-mix(in oklab, var(--success) 35%, transparent); }
.tpath-save-col { display: grid; gap: 2px; }
.tpath-save-was { font-size: var(--fs-lg); font-weight: 750; color: var(--text-3); text-decoration: line-through; }
.tpath-save-now { font-size: var(--fs-xl); font-weight: 850; color: var(--text); }
.tpath-save-arrow { color: var(--text-3); }
.tpath-save-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--r-full);
  background: var(--success); color: #fff; font-weight: 800; }
.tpath-save-badge span { font-weight: 600; opacity: .9; }
.tpath { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; position: relative; }
.tpath::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--brand), var(--brand-300) 70%, var(--warning, var(--brand-300))); }
.tpath > li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.tpath > li.tpath-cap { grid-template-columns: 44px auto 1fr; gap: 12px; align-items: center; }
.tpath-cap > strong { font-size: var(--fs-md); }
.tpath-node { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); font-weight: 850; font-size: 18px; box-shadow: 0 0 0 5px var(--bg, var(--surface)); }
.tpath-node .icon { width: 20px; height: 20px; }
.tpath-node.is-cap { background: var(--surface); color: var(--brand); border: 2px solid var(--brand); }
.tpath-node.is-finish { background: var(--warning, var(--brand)); color: #fff; }
.tpath-card { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; overflow: hidden; transition: box-shadow var(--t-fast), transform var(--t-fast); }
.tpath-card:hover { box-shadow: var(--shadow-md, var(--shadow-sm)); transform: translateY(-2px); }
.tpath-thumb { position: relative; align-self: start; aspect-ratio: 16 / 9; min-width: 0; margin: 14px 0 14px 14px; border-radius: var(--r-md);
  background: var(--surface-2); overflow: hidden; }
.tpath-body .rating, .tpath-body .badge { justify-self: start; }
.tpath-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tpath-thumb .cover-fallback { position: absolute; inset: 0; }
.tpath-thumb .badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
.tpath-body { display: grid; gap: 8px; align-content: start; padding: 18px 20px; }
.tpath-body h3 { font-size: var(--fs-md); line-height: 1.3; }
.tpath-kicker { font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-700); }
.tpath-foot { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.tpath-foot .price { margin-top: 2px; }
@media (max-width: 720px) {
  .tpath-card { grid-template-columns: 1fr; }
  .tpath-thumb { margin: 0; border-radius: 0; }
  .tpath-save-badge { margin-left: 0; }
  .tpath > li { grid-template-columns: 36px 1fr; gap: 10px; }
  .tpath-node { width: 36px; height: 36px; font-size: 15px; }
  .tpath::before { left: 17px; }
  .tpath > li.tpath-cap { grid-template-columns: 36px auto 1fr; }
}
:root[data-theme="dark"] .tpath-save-badge, :root[data-theme="dark"] .tpath-node.is-finish { color: #06210f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tpath-save-badge, :root:not([data-theme="light"]) .tpath-node.is-finish { color: #06210f; } }

/* ===== Confirm dialog (app.js ask()) - replaces the browser's confirm()/prompt() ===== */
.lms-dialog { position: fixed; inset: 0; margin: auto; height: fit-content; border: 0; padding: 0; background: transparent; overflow: visible; max-width: min(440px, calc(100vw - 32px)); width: 100%; color: var(--text); }
.lms-dialog::backdrop { background: rgb(8 14 30 / 0.55); backdrop-filter: blur(2px); }
.lms-dialog-box { display: grid; gap: 18px; padding: 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg, 0 20px 50px rgb(0 0 0 / .25)); animation: lms-dialog-in 160ms var(--ease) both; }
.lms-dialog-msg { margin: 0; font-size: var(--fs-md); line-height: 1.5; font-weight: 600; white-space: pre-line; }
.lms-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.lms-dialog-actions .btn { min-width: 108px; min-height: 44px; }
.lms-dialog-input { width: 100%; font-family: var(--font-mono, monospace); }
html.has-dialog { overflow: hidden; }
@keyframes lms-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lms-dialog-box { animation: none; } }
@media (max-width: 560px) {   /* phones: bottom sheet, big full-width buttons, main action on top */
  .lms-dialog { margin: auto auto 0; max-width: 100vw; }
  .lms-dialog-box { border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
  .lms-dialog-actions { flex-direction: column-reverse; }
  .lms-dialog-actions .btn { width: 100%; min-height: 48px; }
}
