/* ==========================================================================
   Академия Нормографа — Стили интерактивного курса обучения (T112 / T295)
   100% чистый CSS, 0 внешних шрифтов/CDN, 0 эмодзи, 0 хардкод-цветов.
   ========================================================================== */

/* 1. Полноэкранный оверлей с подсветкой целевого элемента */
.norm-academy-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999980;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.norm-academy-overlay--visible {
  opacity: 1;
}

.norm-academy-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 2. Рамка подсветки с акцентным свечением */
.norm-academy-highlight {
  position: fixed;
  z-index: 999982;
  border: 2px solid var(--c-accent);
  border-radius: 6px;
  box-shadow: var(--c-focus-ring), var(--shadow-lg);
  pointer-events: none;
  box-sizing: border-box;
  opacity: 0;
  transition: top 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease;
}

.norm-academy-highlight--visible {
  opacity: 1;
}

.norm-academy-highlight--speaking {
  border-color: var(--c-info-solid);
  box-shadow: var(--c-focus-ring), var(--shadow-lg);
}

/* 3. Плавающая карточка активного урока */
.norm-academy-card {
  position: fixed;
  z-index: 999985;
  width: 420px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 18px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--c-text);
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.norm-academy-card--visible {
  opacity: 1;
  transform: translateY(0);
}

.norm-academy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.norm-academy-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.norm-academy-badge-module {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-info-badge-text);
  background-color: var(--c-info-badge-bg);
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.2px;
}

.norm-academy-badge-step {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-muted);
  background-color: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  padding: 1px 7px;
  border-radius: 12px;
}

.norm-academy-close {
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.norm-academy-close:hover {
  color: var(--c-text);
  background-color: var(--c-surface-hover);
}

.norm-academy-title {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--c-text);
}

.norm-academy-theory {
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text-muted);
  margin-bottom: 12px;
}

/* T278: Голосовой блок объяснения урока */
.norm-academy-voice {
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 9px 11px;
  margin-bottom: 12px;
}

.norm-academy-voice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.norm-academy-voice-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text);
}

.norm-academy-voice-gender {
  display: inline-flex;
  border: 1px solid var(--c-border-strong);
  border-radius: 5px;
  overflow: hidden;
  background: var(--c-surface);
}

.norm-academy-voice-gender-btn {
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
  line-height: 1.3;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.norm-academy-voice-gender-btn + .norm-academy-voice-gender-btn {
  border-left: 1px solid var(--c-border-strong);
}

.norm-academy-voice-gender-btn.is-active {
  background: var(--c-info-solid);
  color: var(--c-text-inverse);
}

.norm-academy-voice-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.norm-academy-voice-play {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--c-info-solid);
  color: var(--c-text-inverse);
  border: 1px solid var(--c-info-solid);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.norm-academy-voice-play:hover {
  background: var(--c-primary-hover);
}

.norm-academy-voice-play.is-playing {
  background: var(--c-success-solid);
  border-color: var(--c-success-solid);
}

.norm-academy-voice-stop {
  background: var(--c-surface);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border-strong);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.norm-academy-voice-stop:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
}

.norm-academy-voice-progress {
  flex: 1;
  height: 6px;
  background: var(--c-border);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  min-width: 60px;
}

.norm-academy-voice-progress-fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: 3px;
  transition: width 0.12s linear;
}

.norm-academy-voice-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.norm-academy-voice-caption {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed var(--c-border-strong);
  font-size: 11px;
  line-height: 1.4;
  color: var(--c-text);
  font-weight: 500;
}

/* Блок конкретного задания */
.norm-academy-task-box {
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border-strong);
  border-left: 4px solid var(--c-info-solid);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.norm-academy-task-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-info-text);
  margin-bottom: 4px;
}

.norm-academy-task-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.4;
}

.norm-academy-task-hint {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: 4px;
  line-height: 1.35;
}

/* Статус выполнения задания */
.norm-academy-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.norm-academy-status-bar--pending {
  background: var(--c-warning-bg);
  border: 1px solid var(--c-warning-border);
  color: var(--c-warning-text);
}

.norm-academy-status-bar--success {
  background: var(--c-success-bg);
  border: 1px solid var(--c-success-border);
  color: var(--c-success-text);
}

/* Футер карточки урока */
.norm-academy-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
}

.norm-academy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  min-height: 34px;
  box-sizing: border-box;
}

.norm-academy-btn--primary {
  background-color: var(--c-info-solid);
  color: var(--c-text-inverse);
  border-color: var(--c-info-solid);
}

.norm-academy-btn--primary:hover {
  background-color: var(--c-primary-hover);
  border-color: var(--c-primary-hover);
}

.norm-academy-btn--secondary {
  background-color: var(--c-surface-alt);
  color: var(--c-text);
  border-color: var(--c-border-strong);
}

.norm-academy-btn--secondary:hover {
  background-color: var(--c-surface-hover);
}

.norm-academy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Ссылка на Академию в футере обычного тура */
.norm-tour-academy-link {
  font-size: 11px;
  color: var(--c-link);
  text-decoration: underline;
  cursor: pointer;
  margin-right: auto;
  padding-left: 4px;
}

.norm-tour-academy-link:hover {
  color: var(--c-accent-hover);
}

/* 4. Стили страницы /academy */
.academy-container {
  max-width: 1040px;
  margin: 0 auto;
}

.academy-hero {
  background: var(--c-header-bg);
  color: var(--c-header-text);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.academy-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.academy-hero-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
  color: var(--c-header-text);
}

.academy-hero-subtitle {
  font-size: 14px;
  color: var(--c-header-btn-muted);
  margin: 0;
  max-width: 680px;
  line-height: 1.45;
}

.academy-progress-wrapper {
  background: var(--c-header-pill-bg);
  border: 1px solid var(--c-header-pill-border);
  border-radius: 8px;
  padding: 16px 20px;
}

.academy-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.academy-progress-bar {
  background: var(--c-header-logout-bg);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
  position: relative;
}

.academy-progress-fill {
  background: var(--c-info-border);
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.academy-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Модули и карточки уроков */
.academy-modules-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.academy-module-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.academy-module-header {
  padding: 14px 20px;
  background: var(--c-surface-alt);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.academy-module-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.academy-module-num {
  font-size: 11px;
  font-weight: 700;
  background: var(--c-info-solid);
  color: var(--c-text-inverse);
  padding: 3px 8px;
  border-radius: 4px;
}

.academy-module-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
}

.academy-module-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-muted);
}

.academy-lessons-list {
  display: flex;
  flex-direction: column;
}

.academy-lesson-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border);
  transition: background-color 0.15s ease;
  gap: 14px;
}

.academy-lesson-row:last-child {
  border-bottom: none;
}

.academy-lesson-row:hover {
  background-color: var(--c-surface-hover);
}

.academy-lesson-info {
  flex: 1;
  min-width: 0;
}

.academy-lesson-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.academy-lesson-index {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-muted);
  min-width: 22px;
}

.academy-lesson-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.academy-lesson-meta {
  font-size: 12px;
  color: var(--c-text-muted);
  line-height: 1.35;
}

.academy-lesson-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Статусные бейджи уроков */
.academy-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
}

.academy-badge--not-started {
  background: var(--c-surface-alt);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}

.academy-badge--in-progress {
  background: var(--c-warning-badge-bg);
  color: var(--c-warning-badge-text);
  border: 1px solid var(--c-warning-border);
}

.academy-badge--completed {
  background: var(--c-success-badge-bg);
  color: var(--c-success-badge-text);
  border: 1px solid var(--c-success-border);
}

.academy-badge--new {
  background: var(--c-info-badge-bg);
  color: var(--c-info-badge-text);
  border: 1px solid var(--c-info-border);
}

.academy-lesson-row--new {
  background-color: var(--c-surface-alt);
  border-left: 3px solid var(--c-info-solid);
}

/* Итоговая сводка завершения курса */
.academy-completion-card {
  background: var(--c-success-bg);
  border: 2px solid var(--c-success-border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.academy-completion-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-success-text);
  margin: 0 0 6px 0;
}

.academy-completion-text {
  font-size: 14px;
  color: var(--c-success-text);
  line-height: 1.5;
  margin: 0 0 14px 0;
}

.academy-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.academy-summary-item {
  background: var(--c-surface);
  border: 1px solid var(--c-success-border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--c-success-text);
  font-weight: 500;
}

/* T279: Чек-лист первого рабочего дня и полноэкранный оверлей завершения */
.academy-first-day-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.norm-academy-final-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999990;
  background: var(--c-active-badge-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.norm-academy-final-modal {
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px 28px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--c-text);
}

.norm-academy-final-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.norm-academy-final-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-info-badge-text);
  background: var(--c-info-badge-bg);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.norm-academy-final-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
}

.norm-academy-final-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--c-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.norm-academy-final-close:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
}

.norm-academy-final-lead {
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text-muted);
  margin: 0 0 16px 0;
}

.norm-academy-final-checklist-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  margin-bottom: 8px;
}

.norm-academy-final-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.norm-academy-final-checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: 7px;
  color: var(--c-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.norm-academy-final-checklist-item:hover {
  background: var(--c-info-bg);
  border-color: var(--c-info-border);
  color: var(--c-info-text);
}

.norm-academy-final-checklist-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-info-solid);
  color: var(--c-text-inverse);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.norm-academy-final-checklist-text {
  flex: 1;
  line-height: 1.35;
}

.norm-academy-final-checklist-arrow {
  color: var(--c-text-muted);
  font-weight: 700;
}

.norm-academy-final-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .norm-academy-card {
    width: calc(100vw - 20px);
    padding: 14px;
  }
  .academy-hero {
    padding: 16px;
  }
  .academy-lesson-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .academy-lesson-actions {
    width: 100%;
    justify-content: space-between;
  }
}
