/* ==========================================================================
   Courselord Token Utilities (ut-*)
   Replaces ad-hoc inline styles across learning/programming views.
   Backed by local tokens so the sheet is self-contained (loaded globally
   via layouts/app.php); design-system `--color-*` tokens still apply on top.
   ========================================================================== */

:root {
    /* Brand / text / surface palette (mirrors learn-system brand) */
    --ut-brand: #5E256D;
    --ut-brand-2: #7B2D8F;
    --ut-brand-3: #9d2fa1;
    --ut-brand-deep: #2D2640;
    --ut-brand-dark: #3A1645;
    --ut-text-muted: #8A82A3;
    --ut-text-subtle: #6B5080;
    --ut-border: #f0ecf3;
    --ut-border-soft: #e8d5f5;
    --ut-bg-pail: #faf8fc;
    --ut-bg-pale: #ede5f3;
    --ut-bg-surface: #fff;
    --ut-overlay: #140d1e;
    --ut-success: #10B981;
    --ut-success-dark: #059669;
    --ut-success-deep: #166534;
    --ut-warning: #D97706;
    --ut-warning-deep: #B45309;
    --ut-warn-dark: #92400e;
    --ut-info: #3B82F6;
    --ut-gold: #f0c040;
    --ut-gold-light: #f1c85c;
    --ut-grad: linear-gradient(135deg, #5E256D, #7B2D8F);
    --ut-grad-bright: linear-gradient(135deg, #5E256D, #9d2fa1);
    --ut-maxw: 1180px;
}

/* ---------- Layout / display ---------- */
.ut-hide { display: none !important; }
.ut-show { display: block !important; }
.ut-flex { display: flex; }
.ut-inline-flex { display: inline-flex; }
.ut-flex-col { display: flex; flex-direction: column; }
.ut-items-center { align-items: center; }
.ut-items-start { align-items: flex-start; }
.ut-justify-center { justify-content: center; }
.ut-justify-between { justify-content: space-between; }
.ut-justify-end { justify-content: flex-end; }
.ut-wrap { flex-wrap: wrap; }
.ut-flex-1 { flex: 1; min-width: 0; }
.ut-shrink-0 { flex-shrink: 0; }
.ut-fill { width: 100%; height: 100%; }
.ut-w-full { width: 100%; }
.ut-h-cc { display: flex; align-items: center; justify-content: center; }

/* ---------- Layout spacing (fixed px, match pre-conversion values) ---------- */
.ut-gap-6 { gap: 6px; }
.ut-gap-8 { gap: 8px; }
.ut-gap-10 { gap: 10px; }
.ut-gap-12 { gap: 12px; }
.ut-gap-14 { gap: 14px; }
.ut-gap-16 { gap: 16px; }
.ut-gap-18 { gap: 18px; }
.ut-gap-20 { gap: 20px; }
.ut-gap-24 { gap: 24px; }
.ut-pt-0 { padding-top: 0; }
.ut-pt-24 { padding-top: 24px; }
.ut-pt-28 { padding-top: 28px; }
.ut-bb { border-bottom: none; }
.ut-p-16 { padding: 16px; }
.ut-p-24 { padding: 24px; }
.ut-px-24 { padding-left: 24px; padding-right: 24px; }
.ut-py-16 { padding-top: 16px; padding-bottom: 16px; }
.ut-mt-4 { margin-top: 4px; }
.ut-mt-6 { margin-top: 6px; }
.ut-mt-8 { margin-top: 8px; }
.ut-mt-10 { margin-top: 10px; }
.ut-mt-14 { margin-top: 14px; }
.ut-mt-16 { margin-top: 16px; }
.ut-mt-20 { margin-top: 20px; }
.ut-mt-24 { margin-top: 24px; }
.ut-mt-36 { margin-top: 36px; }
.ut-mt-40 { margin-top: 40px; }
.ut-mb-10 { margin-bottom: 10px; }
.ut-mb-14 { margin-bottom: 14px; }
.ut-mt-12 { margin-top: 12px; }
.ut-mt-16 { margin-top: 16px; }
.ut-mb-8 { margin-bottom: 8px; }
.ut-mb-12 { margin-bottom: 12px; }
.ut-mb-16 { margin-bottom: 16px; }
.ut-mb-20 { margin-bottom: 20px; }
.ut-mb-36 { margin-bottom: 36px; }
.ut-gap-30 { gap: 30px; }
.ut-mr-4 { margin-right: 4px; }
.ut-mr-8 { margin-right: 8px; }
.ut-mx-auto { margin-left: auto; margin-right: auto; }
.ut-ml-auto { margin-left: auto; }
.ut-mt-auto { margin-top: auto; }
.ut-m-0 { margin: 0; }
.ut-block { display: block; }
.ut-wh-52 { width: 52px; height: 52px; }

/* ---------- Backgrounds ---------- */
.ut-bg-brand { background: var(--ut-brand); }
.ut-bg-white { background: var(--ut-bg-surface); }
.ut-bg-pail { background: var(--ut-bg-pail); }
.ut-bg-pale { background: var(--ut-bg-pale); }
.ut-bg-grad { background: var(--ut-grad); }
.ut-bg-grad-bright { background: var(--ut-grad-bright); }
.ut-bg-success-light { background: rgba(5, 150, 105, .08); }
.ut-bg-success-soft { background: rgba(16, 185, 129, .06); }
.ut-bg-success-tint { background: rgba(5, 150, 105, .06); }
.ut-bg-warn-light { background: rgba(249, 158, 11, .08); }
.ut-bg-blue-light { background: rgba(59, 130, 246, .06); }
.ut-bg-brand-soft { background: rgba(94, 37, 109, .06); }
.ut-bg-brand-tint { background: rgba(139, 63, 184, .12); }
.ut-bg-brand-tint-2 { background: rgba(139, 63, 184, .07); }
.ut-bg-brand-tint-3 { background: rgba(94, 37, 109, .08); }
.ut-bg-overlay { background: var(--ut-overlay); }

/* ---------- Text color & alignment ---------- */
.ut-text-brand { color: var(--ut-brand); }
.ut-text-brand-2 { color: var(--ut-brand-2); }
.ut-text-deep { color: var(--ut-brand-deep); }
.ut-text-dark { color: var(--ut-brand-dark); }
.ut-text-muted { color: var(--ut-text-muted); }
.ut-text-subtle { color: var(--ut-text-subtle); }
.ut-text-white { color: #fff; }
.ut-text-success { color: var(--ut-success); }
.ut-text-success-dark { color: var(--ut-success-dark); }
.ut-text-success-deep { color: var(--ut-success-deep); }
.ut-text-warning { color: var(--ut-warning); }
.ut-text-warning-deep { color: var(--ut-warning-deep); }
.ut-text-warn-dark { color: var(--ut-warn-dark); }
.ut-text-info { color: var(--ut-info); }
.ut-text-gold { color: var(--ut-gold); }
.ut-text-center { text-align: center; }
.ut-text-left { text-align: left; }
.ut-text-right { text-align: right; }

/* ---------- Font size / weight ---------- */
.ut-fs-xs { font-size: .7rem; }
.ut-fs-sm { font-size: .72rem; }
.ut-fs-sm-2 { font-size: .75rem; }
.ut-fs-sm-3 { font-size: .78rem; }
.ut-fs-base { font-size: .8rem; }
.ut-fs-md { font-size: .85rem; }
.ut-fs-md-2 { font-size: .86rem; }
.ut-fs-base-2 { font-size: .88rem; }
.ut-fs-base-3 { font-size: .9rem; }
.ut-fs-base-4 { font-size: .92rem; }
.ut-fs-base-5 { font-size: .95rem; }
.ut-fs-dot82 { font-size: .82rem; }
.ut-fs-dot84 { font-size: .84rem; }
.ut-fs-dot86 { font-size: .86rem; }
.ut-fs-dot92 { font-size: .92rem; }
.ut-fs-dot93 { font-size: .93rem; }
.ut-fs-dot98 { font-size: .98rem; }
.ut-fs-lg { font-size: 1rem; }
.ut-fs-lg-2 { font-size: 1.1rem; }
.ut-fs-lg-3 { font-size: 1.2rem; }
.ut-fs-xl { font-size: 1.3rem; }
.ut-fs-xl-2 { font-size: 1.35rem; }
.ut-fs-xl-3 { font-size: 1.4rem; }
.ut-fs-2xl { font-size: 1.5rem; }
.ut-fs-2xl-2 { font-size: 1.55rem; }
.ut-fs-2xl-3 { font-size: 1.6rem; }
.ut-fs-2xl-4 { font-size: 1.7rem; }
.ut-fs-3xl { font-size: 1.8rem; }
.ut-fs-4xl { font-size: 2.2rem; }
.ut-fw-500 { font-weight: 500; }
.ut-fw-600 { font-weight: 600; }
.ut-fw-700 { font-weight: 700; }
.ut-fw-800 { font-weight: 800; }
.ut-tt-up { text-transform: uppercase; }
.ut-ls-wide { letter-spacing: .04em; }
.ut-ls-wider { letter-spacing: .06em; }
.ut-nowrap { white-space: nowrap; }
.ut-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Borders / radius ---------- */
.ut-br { border: 1px solid var(--ut-border); }
.ut-br-soft { border: 1px solid var(--ut-border-soft); }
.ut-br-none { border: none; }
.ut-bt { border-top: 1px solid var(--ut-border); }
.ut-r-6 { border-radius: 6px; }
.ut-r-8 { border-radius: 8px; }
.ut-r-10 { border-radius: 10px; }
.ut-r-12 { border-radius: 12px; }
.ut-r-14 { border-radius: 14px; }
.ut-r-16 { border-radius: 16px; }
.ut-r-18 { border-radius: 18px; }
.ut-r-24 { border-radius: 24px; }
.ut-r-pill { border-radius: 999px; }
.ut-shadow-1 { box-shadow: 0 4px 16px rgba(94, 37, 109, .25); }

/* ---------- Links / anchors ---------- */
.ut-a { color: var(--ut-brand); text-decoration: none; font-weight: 600; }
.ut-a-subtle { color: var(--ut-brand); text-decoration: none; font-weight: 600; font-size: var(--ut-fs-sub, .85rem); }
.ut-underline { text-decoration: none; }
.ut-hover-underline:hover { text-decoration: underline; }

/* ---------- Compound components ---------- */
.ut-btn-brand {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--ut-brand); color: #fff;
    padding: 10px 20px; border-radius: 10px;
    text-decoration: none; font-weight: 600; font-size: .88rem;
    transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ut-btn-brand:hover { background: #4a1d58; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(94, 37, 109, .18); }
.ut-btn-brand:active { background: #3A1645; transform: translateY(0); box-shadow: none; }
.ut-btn-brand:focus-visible { outline: 3px solid rgba(157, 47, 161, .35); outline-offset: 2px; }
.ut-btn-grad {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--ut-grad); color: #fff;
    padding: 12px 28px; border-radius: 10px;
    text-decoration: none; font-weight: 700; font-size: .88rem;
    box-shadow: 0 4px 12px rgba(94, 37, 109, .2);
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ut-btn-grad:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(94, 37, 109, .28); }
.ut-btn-grad:active { filter: brightness(.97); transform: translateY(0); box-shadow: 0 4px 12px rgba(94, 37, 109, .2); }
.ut-btn-grad:focus-visible { outline: 3px solid rgba(157, 47, 161, .35); outline-offset: 2px; }
.ut-icon-sq {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--ut-bg-brand-tint);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.ut-icon-sq-2 {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--ut-bg-brand-tint-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.ut-card-sub { margin: 4px 0 0; color: var(--ut-text-muted); font-size: .9rem; }
.ut-h-lg { font-size: 1.4rem; }
.ut-h-xl { font-size: 1.6rem; }
.ut-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 600;
}
.ut-pill-sm { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 600; }
.ut-pill-success { background: rgba(5, 150, 105, .08); color: var(--ut-success-dark); }
.ut-pill-warning { background: rgba(249, 158, 11, .08); color: var(--ut-warning); }
.ut-pill-info { background: rgba(59, 130, 246, .06); color: var(--ut-info); }
.ut-pill-warn-soft { background: rgba(252, 211, 77, .25); color: var(--ut-warn-dark); }
.ut-pill-brand-bright { background: rgba(209, 112, 225, .1); color: var(--ut-brand-2); }
.ut-chip-status { padding: 2px 8px; font-size: .7rem; border-radius: 999px; }
.ut-card {
    max-width: var(--lnk-max-w, var(--ut-maxw));
    background: var(--ut-bg-surface); border: 1px solid #eee; border-radius: 12px;
}
.ut-maxw { max-width: var(--lnk-max-w, var(--ut-maxw)); margin-left: auto; margin-right: auto; }
.ut-fs-sub { font-size: var(--ut-fs-sub, .85rem); }