/* =========================================================
   MHub Academy — Tutorial Page
   Randare blocuri • Mobile-first • Apple glass
   ========================================================= */

/* =========================================================
   VARIABILE
   ========================================================= */

:root {
  --bottom-nav-h: 0px;
}

@media (max-width: 899px) {
  :root {
    --bottom-nav-h: calc(78px + env(safe-area-inset-bottom, 0px));
  }
}

/* =========================================================
   LAYOUT PAGINĂ
   ========================================================= */

.tutorial-page {
  padding: 20px 0 60px;
}

/* =========================================================
   BACK LINK
   ========================================================= */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.back-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(-2px);
}

/* =========================================================
   COVER
   ========================================================= */

.tutorial-cover {
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.tutorial-cover img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

/* =========================================================
   HEADER
   ========================================================= */

.tutorial-header {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.tutorial-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.tutorial-header h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 14px;
}

.tutorial-lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.tutorial-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tutorial-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.tag-pill {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 4px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
}

/* =========================================================
   MATERIALS (aside)
   ========================================================= */

.tutorial-materials {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.materials-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.materials-header strong { color: var(--accent); font-weight: 700; }

.materials-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.materials-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.materials-list li .icon { color: var(--success); flex-shrink: 0; }

/* =========================================================
   PROGRESS BAR — sticky
   ========================================================= */

.tutorial-progress {
  position: sticky;
  top: calc(var(--header-h) + var(--header-top) + 8px);
  z-index: 40;
  max-width: 720px;
  margin: 0 auto 28px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.tutorial-progress.has-progress {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}
.tutorial-progress.is-complete {
  border-color: var(--success);
}

.progress-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.progress-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}
.progress-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.progress-counter {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  min-width: 100px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 999px;
  transition: width .4s var(--ease-out);
}
.tutorial-progress.is-complete .progress-fill {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.progress-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.progress-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 42px;
  text-align: right;
}
.tutorial-progress.is-complete .progress-label {
  color: var(--success);
}

.progress-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.progress-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* =========================================================
   BODY — BLOCURI (container)
   ========================================================= */

.tutorial-body {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text);
}
.tutorial-body > * + * {
  margin-top: 20px;
}

.tutorial-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* =========================================================
   BLOC: TEXT
   ========================================================= */

.tb-text {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-secondary);
}
.tb-text strong { color: var(--text); font-weight: 600; }
.tb-text em { font-style: italic; }
.tb-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
   BLOC: HEADING
   ========================================================= */

.tb-heading {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 36px;
  scroll-margin-top: 100px;
}
h3.tb-heading { font-size: 1.2rem; }

/* =========================================================
   BLOC: IMAGE
   ========================================================= */

.tb-image {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}
.tb-image img {
  width: 100%;
  height: auto;
  display: block;
}
.tb-image figcaption {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* =========================================================
   BLOC: VIDEO
   ========================================================= */

.tb-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow-sm);
}
.tb-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================================================
   BLOC: CODE
   ========================================================= */

.tb-code {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
}
.tb-code-lang {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 6px;
}
.tb-code pre {
  padding: 16px 18px;
  margin: 0;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}

/* =========================================================
   BLOC: LIST
   ========================================================= */

.tb-list {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tb-list li {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.tb-list li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* =========================================================
   BLOC: STEP (interactiv cu checkbox)
   ========================================================= */

.tb-step {
  display: flex;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  margin-top: 20px;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}

.tb-step.is-done {
  background: color-mix(in srgb, var(--success) 6%, var(--bg-glass));
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
}
.tb-step.is-done .step-title {
  color: var(--text-tertiary);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: color-mix(in srgb, var(--success) 50%, transparent);
}
.tb-step.is-done .step-num {
  background: var(--success);
}

.step-check {
  flex-shrink: 0;
  cursor: pointer;
  padding-top: 2px;
}
.step-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.step-check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-elevated);
  color: transparent;
  transition: all .25s var(--ease);
}
.step-check:hover .step-check-box {
  border-color: var(--accent);
  color: var(--accent);
}
.tb-step.is-done .step-check-box {
  background: var(--success);
  border-color: var(--success);
  color: white;
  transform: scale(1.05);
}

.step-content { flex: 1; min-width: 0; }

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 12px var(--accent-soft);
  transition: background .3s var(--ease);
}
.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
  transition: color .3s var(--ease);
}
.step-body {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-left: 42px;
}

/* =========================================================
   BLOC: CHECKLIST
   ========================================================= */

.tb-checklist {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.checklist-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s var(--ease);
  user-select: none;
}
.checklist-item:hover { background: var(--bg-subtle); }
.checklist-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checklist-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--border-strong);
  background: var(--bg-elevated);
  color: transparent;
  flex-shrink: 0;
  transition: all .2s var(--ease);
}
.checklist-item:hover .checklist-box { border-color: var(--accent); }
.checklist-item.is-done .checklist-box {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.checklist-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color .2s var(--ease);
}
.checklist-item.is-done .checklist-label {
  color: var(--text-tertiary);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* =========================================================
   BLOC: QUIZ
   ========================================================= */

.tb-quiz {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.quiz-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.quiz-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: var(--radius-pill);
}
.quiz-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.015em;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.quiz-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.quiz-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: all .18s var(--ease);
}
.quiz-option:hover .quiz-letter {
  background: var(--accent);
  color: white;
}

.quiz-option.is-selected { border-color: var(--accent); }
.quiz-option.is-correct {
  border-color: var(--success);
  background: var(--success-soft);
}
.quiz-option.is-correct .quiz-letter { background: var(--success); color: white; }
.quiz-option.is-wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.quiz-option.is-wrong .quiz-letter { background: var(--danger); color: white; }

.quiz-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  display: none;
}
.quiz-feedback.is-visible { display: block; }
.quiz-feedback.is-correct {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}
.quiz-feedback.is-wrong {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}
.quiz-feedback strong { font-weight: 700; }

/* =========================================================
   BLOC: REVEAL
   ========================================================= */

.tb-reveal {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.reveal-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.reveal-trigger:hover { background: var(--accent-soft); }

.reveal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
  transition: transform .25s var(--ease-out);
}
.tb-reveal.is-revealed .reveal-icon { transform: rotate(180deg); }

.reveal-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease-out);
}
.tb-reveal.is-revealed .reveal-content { grid-template-rows: 1fr; }
.reveal-inner {
  overflow: hidden;
  padding: 0 18px;
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}
.tb-reveal.is-revealed .reveal-inner { padding: 16px 18px; }

/* =========================================================
   BLOC: MATERIALS (in-content)
   ========================================================= */

.tb-materials {
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.tb-materials-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.tb-materials ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tb-materials li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text);
}
.tb-materials li .icon { color: var(--accent); flex-shrink: 0; }

/* =========================================================
   BLOC: CALLOUT
   ========================================================= */

.tb-callout {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  font-size: 0.96rem;
  line-height: 1.6;
}

.tb-callout-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: currentColor;
}
.tb-callout-icon .icon { color: white; }

.tb-callout-body {
  flex: 1;
  color: var(--text-secondary);
}
.tb-callout-body strong {
  color: inherit;
  font-weight: 600;
}

.tb-callout--info {
  background: rgba(59, 130, 246, .10);
  border: 1px solid rgba(59, 130, 246, .25);
  color: #3b82f6;
}
.tb-callout--tip {
  background: rgba(34, 197, 94, .10);
  border: 1px solid rgba(34, 197, 94, .25);
  color: #22c55e;
}
.tb-callout--warning {
  background: rgba(234, 88, 12, .10);
  border: 1px solid rgba(234, 88, 12, .25);
  color: #ea580c;
}
.tb-callout--info    .tb-callout-body strong { color: #2563eb; }
.tb-callout--tip     .tb-callout-body strong { color: #16a34a; }
.tb-callout--warning .tb-callout-body strong { color: #c2410c; }

/* =========================================================
   BLOC: DIVIDER
   ========================================================= */

.tb-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* =========================================================
   TUTORIAL ACTIONS (like / save / share)
   ========================================================= */

.tutorial-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  min-width: 60px;
  transition:
    color .2s var(--ease),
    background .2s var(--ease),
    border-color .2s var(--ease),
    transform .18s var(--ease-out),
    box-shadow .25s var(--ease);
}
.action-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.action-btn:active {
  transform: translateY(0) scale(.97);
}
.action-btn .icon {
  flex-shrink: 0;
  transition: transform .25s var(--ease-out), fill .2s var(--ease);
}

.action-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 12px;
  text-align: center;
}

.action-label { font-size: 0.88rem; }

/* Like */
.action-btn--like.is-active {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}
.action-btn--like.is-active .icon {
  fill: #ef4444;
  transform: scale(1.1);
}
.action-btn--like.is-active:hover {
  background: rgba(239, 68, 68, 0.15);
}
.action-btn--like.is-popping .icon {
  animation: heartPop .45s cubic-bezier(.4, 0, .2, 1);
}
@keyframes heartPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.35); }
  60%  { transform: scale(.9); }
  100% { transform: scale(1); }
}

/* Save */
.action-btn--save.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.action-btn--save.is-active .icon {
  fill: var(--accent);
  transform: scale(1.08);
}
.action-btn--save.is-active:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Share */
.action-btn--share:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* =========================================================
   COMPLETE BUTTON
   ========================================================= */

.tutorial-complete-wrap {
  max-width: 720px;
  margin: 40px auto 0;
  display: flex;
  justify-content: center;
}

.btn-complete {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--accent-text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 24px var(--accent-soft);
  transition: all .25s var(--ease);
}
.btn-complete:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 12px 30px var(--accent-glow);
}
.btn-complete:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.btn-complete.is-complete {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 24px var(--success-soft);
}

/* =========================================================
   TOAST — peste bottom nav
   ========================================================= */

.action-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 1150;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
  transition:
    opacity .25s var(--ease),
    visibility .25s var(--ease),
    transform .3s var(--ease-out);
}
.action-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.action-toast.toast--success {
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  color: var(--success);
}
.action-toast.toast--error {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
}

/* =========================================================
   COMPLETE BANNER
   ========================================================= */

.complete-banner {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 1150;
  opacity: 0;
  transition: opacity .35s var(--ease), transform .4s var(--ease-out);
}
.complete-banner.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.complete-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--success);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), 0 0 0 4px var(--success-soft);
}
.complete-icon { font-size: 1.8rem; line-height: 1; }
.complete-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.complete-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.complete-text span {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

/* =========================================================
   SHARE BOTTOM SHEET (TikTok-style)
   ========================================================= */

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s var(--ease);
}
.share-sheet.is-open {
  opacity: 1;
  visibility: visible;
}

.share-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.share-sheet-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-elevated);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
  overflow-y: auto;
}
.share-sheet.is-open .share-sheet-panel {
  transform: translateY(0);
}

.share-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.share-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.share-sheet-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.share-sheet-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.share-sheet-close:hover {
  color: var(--text);
  background: var(--bg-sunken);
}

/* Preview */
.share-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.share-preview-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.share-preview-fallback {
  color: var(--accent);
  opacity: .5;
}

.share-preview-info {
  flex: 1;
  min-width: 0;
}
.share-preview-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}
.share-preview-url {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grid platforme */
.share-platforms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
  margin-bottom: 20px;
}

.share-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.share-platform:hover {
  background: var(--bg-subtle);
  transform: translateY(-2px);
}
.share-platform:active {
  transform: translateY(0) scale(.95);
}

.share-platform-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--bg-subtle);
  color: var(--text);
  transition: transform .2s var(--ease-out);
}
.share-platform-icon svg {
  width: 26px;
  height: 26px;
}
.share-platform:hover .share-platform-icon {
  transform: scale(1.08);
}

.share-platform-icon--whatsapp { background: #25d366; color: white; }
.share-platform-icon--facebook { background: #1877f2; color: white; }
.share-platform-icon--twitter  { background: #000; color: white; }
.share-platform-icon--telegram { background: #0088cc; color: white; }
.share-platform-icon--linkedin { background: #0a66c2; color: white; }
.share-platform-icon--reddit   { background: #ff4500; color: white; }
.share-platform-icon--email    { background: #6b7280; color: white; }
.share-platform-icon--sms      { background: #22c55e; color: white; }
.share-platform-icon--copy     { background: var(--accent); color: var(--accent-text); }

[data-theme="dark"] .share-platform-icon--twitter {
  background: #1d1d1f;
  border: 1px solid rgba(255, 255, 255, .15);
}

.share-platform-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.share-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.share-more:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* =========================================================
   CÂND SHARE E DESCHIS → ascunde nav + header
   ========================================================= */

body.share-open .bottom-nav {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
body.share-open .site-header {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Tranziții implicite (revenire) */
.bottom-nav,
.site-header {
  transition: transform .3s var(--ease-out), opacity .25s var(--ease);
}

/* =========================================================
   FALLBACK — fără backdrop-filter
   ========================================================= */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tutorial-materials,
  .tb-step,
  .tb-checklist,
  .tb-quiz,
  .tb-reveal { background: var(--bg-elevated); }
}

/* =========================================================
   RESPONSIVE — TABLETĂ
   ========================================================= */

@media (min-width: 640px) {
  .tutorial-page { padding: 32px 0 80px; }
  .tutorial-header { margin-bottom: 40px; }
  .tutorial-lead { font-size: 1.12rem; }

  .tutorial-body > * + * { margin-top: 24px; }
  .tb-text { font-size: 1.05rem; }
  .tb-heading { font-size: 1.6rem; }
  h3.tb-heading { font-size: 1.3rem; }

  .materials-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
  }

  .tb-step { padding: 24px 26px; }
  .step-num { width: 36px; height: 36px; font-size: 1rem; }
  .step-title { font-size: 1.25rem; }
  .step-body { font-size: 1rem; padding-left: 48px; }
}

/* =========================================================
   RESPONSIVE — DESKTOP
   ========================================================= */

@media (min-width: 900px) {
  .tutorial-page { padding: 40px 0 100px; }
  .tutorial-header h1 { letter-spacing: -0.035em; }
  .tutorial-cover img { max-height: 480px; }

  /* Share sheet → modal centrat */
  .share-sheet-panel {
    position: absolute;
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    width: 420px;
    max-height: 80vh;
    padding: 20px;
    border-radius: 20px;
    transform: translate(-50%, -50%) scale(.95);
  }
  .share-sheet.is-open .share-sheet-panel {
    transform: translate(-50%, -50%) scale(1);
  }
  .share-sheet-handle { display: none; }
}

/* =========================================================
   RESPONSIVE — MOBIL
   ========================================================= */

@media (max-width: 899px) {
  .action-toast {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  body.share-open .action-toast {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  /* Progress */
  .tutorial-progress { padding: 10px 12px; gap: 8px; }
  .progress-info { min-width: 0; }
  .progress-title { display: none; }
  .progress-counter { font-size: 0.85rem; }
  .progress-track { height: 5px; }
  .progress-label { font-size: 0.78rem; min-width: 36px; }

  /* Steps */
  .tb-step { padding: 14px; gap: 10px; }
  .step-check-box { width: 24px; height: 24px; }
  .step-num { width: 26px; height: 26px; font-size: 0.82rem; }
  .step-title { font-size: 1rem; }
  .step-body { padding-left: 36px; font-size: 0.92rem; }

  /* Quiz */
  .tb-quiz { padding: 16px; }
  .quiz-question { font-size: 0.98rem; }
  .quiz-option { padding: 10px 12px; font-size: 0.9rem; }

  /* Actions */
  .tutorial-actions { gap: 8px; margin-top: 32px; padding-top: 20px; }
  .action-btn {
    padding: 10px 14px;
    font-size: 0.84rem;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .action-btn--share .action-label { display: none; }
  .action-btn--share { min-width: 48px; flex: 0 0 auto; }
  .action-count { font-size: 0.8rem; }

  /* Complete */
  .btn-complete { font-size: 0.88rem; padding: 12px 22px; }
  .complete-banner {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 12px);
    width: calc(100% - 24px);
  }
  .complete-banner-inner { padding: 12px 16px; }
  .complete-icon { font-size: 1.5rem; }
  .complete-text strong { font-size: 0.88rem; }

  /* Share sheet */
  .share-platforms {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 4px;
  }
  .share-platform-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  .share-platform-icon svg { width: 24px; height: 24px; }
  .share-platform-label { font-size: 0.68rem; }
  .share-sheet-panel { padding-left: 16px; padding-right: 16px; }
}

/* =========================================================
   AUTOR — meta link + card
   ========================================================= */

/* ---------- Meta autor cu avatar ---------- */
.meta-item--author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.meta-item--author:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.meta-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--accent-text);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.meta-author-name {
  font-size: 0.85rem;
  letter-spacing: -0.01em;
}

/* ---------- Author Card (mare, sub conținut) ---------- */
.author-card {
  max-width: 720px;
  margin: 40px auto 0;
  padding: 0;
}

.author-card-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition:
    transform .25s var(--ease-out),
    border-color .25s var(--ease),
    box-shadow .25s var(--ease),
    background .25s var(--ease);
  position: relative;
  overflow: hidden;
}

.author-card-link::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.author-card-link:hover::before { opacity: 1; }

.author-card-link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.author-card-avatar {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--accent-text);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    0 6px 18px var(--accent-soft);
  transition: transform .3s var(--ease-out);
}
.author-card-link:hover .author-card-avatar {
  transform: scale(1.05) rotate(-3deg);
}

.author-card-info {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.author-card-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.author-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
}

.author-card-hint {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin: 0;
}

.author-card-arrow {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  transition: all .25s var(--ease);
}
.author-card-link:hover .author-card-arrow {
  background: var(--accent);
  color: var(--accent-text);
  transform: translateX(4px);
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .meta-item--author {
    padding: 3px 8px 3px 3px;
  }
  .meta-avatar {
    width: 20px;
    height: 20px;
    font-size: 0.62rem;
  }
  .meta-author-name { font-size: 0.8rem; }

  .author-card { margin-top: 28px; }
  .author-card-link {
    padding: 16px 16px;
    gap: 12px;
  }
  .author-card-avatar {
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
  }
  .author-card-name { font-size: 0.95rem; }
  .author-card-hint { font-size: 0.75rem; }
  .author-card-arrow { width: 32px; height: 32px; }
}

/* =========================================================
   OWNER ACTIONS (Editează + Istoric versiuni)
   ========================================================= */

.tutorial-owner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  max-width: 420px;
}

.owner-btn {
  flex: 1 1 0;                 /* ← lățime egală pentru toate */
  min-width: 0;                /* ← permite shrink corect */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    color .2s var(--ease),
    background .2s var(--ease),
    border-color .2s var(--ease),
    transform .18s var(--ease-out),
    box-shadow .25s var(--ease);
}

.owner-btn .icon {
  flex-shrink: 0;
  transition: transform .25s var(--ease-out);
}

.owner-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.owner-btn:hover .icon {
  transform: scale(1.1);
}

.owner-btn:active {
  transform: translateY(0) scale(.97);
}

/* Buton principal — Editează */
.owner-btn:not(.owner-btn--ghost) {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-color: transparent;
  color: white;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 6px 18px var(--accent-soft);
}

.owner-btn:not(.owner-btn--ghost):hover {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 10px 26px var(--accent-glow);
}

/* Buton secundar — Istoric versiuni */
.owner-btn--ghost {
  color: var(--text-secondary);
}

.owner-btn--ghost .icon {
  color: var(--text-tertiary);
  transition: color .2s var(--ease), transform .25s var(--ease-out);
}

.owner-btn--ghost:hover .icon {
  color: var(--accent);
}

/* Mobil */
@media (max-width: 640px) {
  .tutorial-owner-actions {
    gap: 8px;
    margin-top: 18px;
    padding-top: 18px;
    max-width: none;
  }

  .owner-btn {
    padding: 9px 12px;
    font-size: 0.8rem;
    gap: 5px;
  }
}