:root {
    --primary: #0bb3b8;
    --primary-600: #089ca1;
    --primary-700: #067e82;
    --primary-50: #e6f8f8;
    --accent: #0ea5e9;
    --accent-600: #0284c7;
    --accent-50: #e0f2fe;
    --yellow: #facc15;
    --yellow-600: #eab308;

    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --soft: #94a3b8;
    --line: #dfe5ec;
    --surface: #ffffff;
    --surface-2: #f2f5f8;
    --page: #ffffff;

    --danger: #ef4444;
    --danger-600: #dc2626;
    --danger-50: #fef2f2;
    --success: #10b981;
    --success-600: #059669;
    --success-50: #ecfdf5;
    --warning: #f59e0b;
    --warning-50: #fffbeb;
    --dark: #334155;
    --dark-50: #f1f5f9;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 25px 60px -15px rgba(15, 23, 42, .3);
    --ring: 0 0 0 4px rgba(11, 179, 184, .15);

    --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --font-display: 'Lalezar', 'Rubik', sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-600); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--primary); color: #fff; }
.text-warning { color: var(--warning); }
.text-muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: embed; }

.brand { display: inline-flex; align-items: center; justify-content: center; }
.brand img { height: 46px; width: auto; max-width: 200px; object-fit: contain; }
.brand__text {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.brand__text i { font-size: .8em; }
.brand--light .brand__text { color: #fff; }

.btn {
    --bg: var(--surface-2);
    --fg: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s, opacity .2s;
    position: relative;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(14, 165, 233, .25); }
.btn--primary { --bg: var(--accent); --fg: #fff; box-shadow: 0 8px 20px -10px rgba(14, 165, 233, .7); }
.btn--primary:hover { --bg: var(--accent-600); }
.btn--teal { --bg: var(--primary); --fg: #fff; }
.btn--teal:hover { --bg: var(--primary-600); }
.btn--warning { --bg: var(--yellow); --fg: #fff; }
.btn--warning:hover { --bg: var(--yellow-600); }
.btn--danger { --bg: var(--danger); --fg: #fff; }
.btn--danger:hover { --bg: var(--danger-600); }
.btn--success { --bg: var(--success); --fg: #fff; }
.btn--success:hover { --bg: var(--success-600); }
.btn--ghost { --bg: #fff; --fg: var(--text); border: 1px solid var(--line); }
.btn--ghost:hover { --bg: var(--surface-2); }
.btn--soft { --bg: var(--primary-50); --fg: var(--primary-700); }
.btn--soft:hover { --bg: #d3f2f3; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; gap: 7px; }
.btn--xs { min-height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn--icon { padding: 0; width: 38px; min-height: 38px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn--ghost.is-loading::after, .btn--soft.is-loading::after { border-color: var(--line); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.field { margin-bottom: 16px; }
.field__label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 7px; }
.field__label em { color: var(--danger); font-style: normal; }
.control {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-height: 52px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.control:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.control__icon {
    position: absolute;
    inset-inline-start: 16px;
    color: var(--primary);
    font-size: 15px;
    pointer-events: none;
    transition: color .2s;
}
.control input,
.control select,
.control textarea {
    width: 100%;
    height: 50px;
    border: 0;
    outline: 0;
    background: transparent;
    padding-inline: 44px 16px;
    font-size: 15px;
    color: var(--ink);
    border-radius: var(--radius);
}
.control > input:first-child,
.control > select:first-child,
.control > textarea:first-child { padding-inline-start: 16px; }
.control input::placeholder, .control textarea::placeholder { color: var(--muted); opacity: 1; }
.control input[dir="rtl"] { text-align: right; }
.control--textarea textarea { height: auto; min-height: 90px; padding-block: 12px; resize: vertical; line-height: 1.7; }
.control--sm { min-height: 42px; border-radius: 10px; }
.control--sm input, .control--sm select { height: 40px; font-size: 14px; }

.control--select select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 64px; }
.control--select select:invalid, .control--select select.is-empty { color: var(--muted); }
.control--select select:disabled { cursor: not-allowed; }
.control--select option { color: var(--ink); }
.control__arrow {
    position: absolute;
    inset-inline-end: 0;
    top: 10px; bottom: 10px;
    width: 46px;
    display: grid;
    place-items: center;
    border-inline-start: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    pointer-events: none;
}
.control--sm .control__arrow { top: 8px; bottom: 8px; width: 38px; }
.control--sm select { padding-inline-end: 50px; }

.control__toggle {
    position: absolute;
    inset-inline-end: 8px;
    width: 38px; height: 38px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
}
.control__toggle:hover { color: var(--primary); background: var(--primary-50); }
.control:has(.control__toggle) input { padding-inline-end: 52px; }

.hint, .error { display: block; font-size: 11.5px; margin-top: 6px; padding-inline-start: 4px; }
.hint { color: var(--muted); }
.error { color: var(--danger); display: none; }
.error::before { content: '\f06a'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-inline-end: 5px; }

.field.has-error .control { border-color: var(--danger); background: var(--danger-50); }
.field.has-error .control:focus-within { box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }
.field.has-error .control__icon { color: var(--danger); }
.field.has-error .error { display: block; animation: shake .35s; }
.field.has-error .hint { display: none; }
.field.is-valid .control { border-color: rgba(16, 185, 129, .55); }
.field.is-valid .control__icon { color: var(--success); }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text); user-select: none; position: relative; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
    flex: 0 0 20px;
    height: 20px;
    border: 1.5px solid #b8c2cf;
    border-radius: 5px;
    background: #fff;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 10px;
    transition: all .2s;
    margin-top: 1px;
}
.check__box i { transform: scale(0); transition: transform .2s var(--ease); }
.check input:checked + .check__box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .check__box i { transform: scale(1); }
.check input:focus-visible + .check__box { box-shadow: var(--ring); }
.check a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.check--card {
    background: #f1fbfe;
    border: 1px solid #b9e6f5;
    border-radius: var(--radius);
    padding: 16px;
    align-items: center;
}
.field.has-error .check__box { border-color: var(--danger); }
.field.has-error .check--card { border-color: var(--danger); background: var(--danger-50); }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span {
    width: 40px; height: 22px;
    border-radius: 22px;
    background: #cbd5e1;
    position: relative;
    transition: background .2s;
}
.switch span::after {
    content: '';
    position: absolute;
    top: 3px; right: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .2s var(--ease);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(-18px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }
.grid-2 > * { min-width: 0; }
.grid-2.single { grid-template-columns: minmax(0, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn--primary { flex: 1; }
.btn-row .btn--warning { flex: 0 0 150px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.4;
}
.badge i { font-size: 11px; }
.badge--warning { background: var(--warning-50); color: #b45309; }
.badge--success { background: var(--success-50); color: var(--success-600); }
.badge--danger { background: var(--danger-50); color: var(--danger-600); }
.badge--dark { background: var(--dark-50); color: var(--dark); }
.badge--primary { background: var(--primary-50); color: var(--primary-700); }
.badge--muted { background: var(--surface-2); color: var(--muted); }
.badge--info { background: #e0f2fe; color: #0369a1; }
html[data-theme="dark"] .badge--info { background: rgba(14, 165, 233, .15); color: #7dd3fc; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .2s;
}
.modal__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow: auto;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(16px) scale(.98);
    opacity: 0;
    transition: transform .25s var(--ease), opacity .2s;
}
.modal__dialog--sm { max-width: 420px; }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__dialog { transform: none; opacity: 1; }
.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.modal__head h3 { margin: 0; font-size: 17px; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.modal__head h3 i { color: var(--primary); }
.modal__close {
    width: 36px; height: 36px;
    border: 0;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    transition: all .2s;
}
.modal__close:hover { background: var(--danger-50); color: var(--danger); }
.modal__body { padding: 22px; }
.modal__foot {
    display: flex;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    position: sticky;
    bottom: 0;
}
.modal__foot .btn--primary { flex: 1; }

.confirm { padding: 30px 24px 24px; text-align: center; }
.confirm__icon {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 26px;
}
.confirm__icon--danger { background: var(--danger-50); color: var(--danger); }
.confirm__icon--success { background: var(--success-50); color: var(--success); }
.confirm__icon--primary { background: var(--accent-50); color: var(--accent); }
.confirm__icon--warning { background: var(--warning-50); color: var(--warning); }
.confirm__title { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.confirm__msg { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.confirm .field { text-align: start; }
.confirm__actions { display: flex; gap: 10px; }
.confirm__actions .btn { flex: 1; }

.toast-stack {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100% - 32px));
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    font-size: 14px;
    color: var(--ink);
    pointer-events: auto;
    animation: toastIn .35s var(--ease);
}
.toast i { font-size: 18px; margin-top: 2px; color: var(--primary); }
.toast--error { border-inline-start-color: var(--danger); }
.toast--error i { color: var(--danger); }
.toast--success { border-inline-start-color: var(--success); }
.toast--success i { color: var(--success); }
.toast--warning { border-inline-start-color: var(--warning); }
.toast--warning i { color: var(--warning); }
.toast.is-leaving { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 640px) {
    .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    body { font-size: 14.5px; }
    .btn-row .btn--warning { flex: 0 0 110px; }
    .modal { align-items: flex-end; padding: 0; }
    .modal__dialog { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; }
}

.cover { position: relative; aspect-ratio: 16 / 11.2; background: var(--surface-2); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.course:hover .cover img { transform: scale(1.04); }
.cover--auto {
    --h: 180;
    background:
        radial-gradient(circle at 20% 110%, hsla(var(--h), 90%, 60%, .55), transparent 55%),
        radial-gradient(circle at 90% 0%, hsla(calc(var(--h) + 30), 90%, 65%, .5), transparent 50%),
        linear-gradient(135deg, hsl(var(--h), 70%, 32%), hsl(calc(var(--h) + 20), 75%, 22%));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 26px;
    color: #fff;
}
.cover__atom { position: absolute; left: -24px; bottom: -34px; font-size: 170px; opacity: .14; transform: rotate(-15deg); transition: transform 1.2s var(--ease); }
.course:hover .cover__atom { transform: rotate(40deg); }
.cover__brand { font-family: var(--font-display); font-size: 17px; opacity: .85; margin-bottom: 6px; }
.cover__title { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.35; max-width: 88%; text-shadow: 0 4px 18px rgba(0, 0, 0, .25); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover__ribbon { position: absolute; top: 14px; right: 0; z-index: 2; background: #e11d48; color: #fff; font-size: 13px; font-weight: 700; padding: 5px 14px; border-radius: 8px 0 0 8px; box-shadow: 0 6px 14px -6px rgba(225, 29, 72, .7); }
.cover--thumb { width: 96px; flex: 0 0 96px; border-radius: 8px; aspect-ratio: 16 / 11.2; padding: 8px; }
.cover--thumb .cover__brand, .cover--thumb .cover__atom { display: none; }
.cover--thumb .cover__title { font-size: 11px; line-height: 1.3; max-width: 100%; }
.cover--thumb .cover__ribbon { display: none; }

.center-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--surface-2); }
.center-screen--plain { background: var(--page); }
.center-card { background: #fff; border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; max-width: 440px; width: 100%; box-shadow: var(--shadow); }
.center-card--plain { box-shadow: none; background: transparent; }
.center-card h1 { font-size: 20px; color: var(--ink); margin: 22px 0 8px; }
.center-card p { color: var(--muted); margin: 0 0 24px; }
.big-code { font-family: var(--font-display); font-size: 110px; line-height: 1; color: var(--primary); }

.iv { position: fixed; inset: 0; z-index: 5000; background: rgba(2, 6, 23, .92); display: flex; flex-direction: column; user-select: none; }
.iv[hidden] { display: none; }
.iv__stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.iv__stage img { max-width: 94vw; max-height: calc(100vh - 110px); border-radius: 8px; background: #fff; cursor: grab; transition: transform .12s ease-out; will-change: transform; }
.iv__stage img:active { cursor: grabbing; transition: none; }
.iv__bar { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.iv__bar button, .iv__x, .iv__nav { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 17px; cursor: pointer; display: inline-grid; place-items: center; transition: background .2s; }
.iv__bar button:hover, .iv__x:hover, .iv__nav:hover { background: rgba(255, 255, 255, .28); }
.iv__bar span { color: #e2e8f0; font-size: 13px; min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.iv__bar span:empty { display: none; }
.iv__x { position: absolute; top: 14px; inset-inline-end: 14px; width: 48px; height: 48px; font-size: 20px; }
.iv__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.iv__nav[hidden] { display: none; }
.iv__nav--prev { inset-inline-start: 14px; }
.iv__nav--next { inset-inline-end: 14px; }
.avatar.has-photo, .acc-hero__av.has-photo { padding: 0; overflow: hidden; background: #e2e8f0; }
.avatar.has-photo img, .acc-hero__av.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

.hs { position: relative; min-width: 0; max-width: 100%; }
.hs__btn { position: absolute; top: 50%; z-index: 4; width: 32px; height: 32px; margin-top: -16px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line, #e2e8f0); border-radius: 50%; background: var(--surface, #fff); color: var(--ink, #0f172a); box-shadow: 0 6px 16px -6px rgba(15, 23, 42, .35); cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s, background .15s; }
.hs__btn.is-on { opacity: 1; visibility: visible; }
.hs__btn:hover { background: var(--primary, #0bb3b8); border-color: var(--primary, #0bb3b8); color: #fff; }
.hs__btn--r { right: 4px; }
.hs__btn--l { left: 4px; }
.hs > .table-wrap + .hs__btn, .hs > .table-wrap ~ .hs__btn { top: 60px; margin-top: 0; }
@media print { .hs__btn { display: none !important; } }

.cblocks { display: flex; flex-direction: column; gap: 18px; padding: 26px 28px; margin-bottom: 20px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 20px; color: var(--text); line-height: 2; font-size: 16.5px; }
.cblocks--empty { flex-direction: row; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 15px; padding: 40px 20px; }
.cb-h { position: relative; margin: 6px 0 0; padding-inline-start: 16px; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.5; color: var(--ink); }
.cb-h::before { content: ''; position: absolute; inset-inline-start: 0; top: 6px; bottom: 6px; width: 5px; border-radius: 4px; background: var(--primary); }
.cb-h:first-child { margin-top: 0; }
.cb-p { white-space: normal; word-wrap: break-word; }
.cb-fig { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cb-fig img { display: block; width: 100%; max-height: 640px; object-fit: contain; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); cursor: zoom-in; }
.cb-fig figcaption { text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.cb-ti { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 22px; align-items: center; }
.cb-ti--end .cb-fig { order: 2; }
.cb-ti .cb-fig img { max-height: 440px; }
@media (max-width: 720px) {
    .cblocks { padding: 18px 16px; font-size: 15.5px; border-radius: 16px; }
    .cb-ti { grid-template-columns: 1fr; gap: 14px; }
    .cb-ti--end .cb-fig { order: 0; }
}

@media (hover: hover) and (pointer: fine) {
    .btn:not(:disabled):not(.is-loading):hover { transform: translateY(-2px); box-shadow: 0 12px 22px -14px rgba(15, 23, 42, .5); }
    .btn:not(:disabled):not(.is-loading):active { transform: translateY(0); }
    .btn i { transition: transform .25s var(--ease); }
    .btn:not(:disabled):hover i { transform: scale(1.1); }
}
