/* ==========================================================================
   Spotlight Tour Stylesheet — Нормограф (T98 / T295)
   Ванильный CSS, 0 зависимостей, 0 внешних шрифтов/CDN, 0 хардкод-цветов.
   ========================================================================== */

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

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

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

/* 2. Рамка подсветки выреза с мягким свечением */
.norm-tour-highlight {
  position: fixed;
  z-index: 999992;
  border: 2px solid var(--c-accent, var(--op-accent));
  border-radius: 6px;
  box-shadow: var(--c-focus-ring, var(--op-focus-ring)), var(--shadow-lg, var(--op-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-tour-highlight--visible {
  opacity: 1;
}

/* 3. Карточка шага */
.norm-tour-card {
  position: fixed;
  z-index: 999995;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: var(--c-surface, var(--op-surface));
  border: 1px solid var(--c-border-strong, var(--op-border-strong));
  border-radius: 8px;
  box-shadow: var(--shadow-lg, var(--op-shadow-lg));
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--c-text, var(--op-text));
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

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

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

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

.norm-tour-close {
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text-muted, var(--op-text-muted));
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  box-sizing: border-box;
  transition: background-color 0.15s, color 0.15s;
}

.norm-tour-close:hover {
  background-color: var(--c-surface-hover, var(--op-surface-hover));
  color: var(--c-danger-text, var(--op-danger-text));
}

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

.norm-tour-content {
  margin: 0 0 16px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text-muted, var(--op-text-muted));
}

.norm-tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.norm-tour-footer-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.norm-tour-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, border-color 0.15s;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.norm-tour-btn--back {
  background-color: var(--c-surface-alt, var(--op-surface-alt));
  border-color: var(--c-border-strong, var(--op-border-strong));
  color: var(--c-text, var(--op-text));
}

.norm-tour-btn--back:hover:not(:disabled) {
  background-color: var(--c-surface-hover, var(--op-surface-hover));
  border-color: var(--c-border-strong, var(--op-border-strong));
}

.norm-tour-btn--back:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.norm-tour-btn--next {
  background-color: var(--c-success-solid, var(--op-primary));
  border-color: var(--c-success-solid, var(--op-primary));
  color: var(--c-text-inverse, var(--op-text-inverse));
  font-weight: 600;
}

.norm-tour-btn--next:hover {
  background-color: var(--c-success-solid-hover, var(--op-primary-hover));
  border-color: var(--c-success-solid-hover, var(--op-primary-hover));
}

.norm-tour-btn--next:focus {
  outline: 2px solid var(--c-accent, var(--op-accent));
  outline-offset: 2px;
}

/* 3а. Голосовые подсказки (T277): плашка включения, тумблер, выбор голоса и повтор */
.norm-tour-voice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: var(--c-info-bg, var(--op-info-bg));
  border: 1px solid var(--c-info-border, var(--op-info-border));
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--c-info-text, var(--op-info-text));
}

.norm-tour-voice-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.norm-tour-voice-banner-enable {
  background-color: var(--c-info-solid, var(--op-primary));
  color: var(--c-text-inverse, var(--op-text-inverse));
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.norm-tour-voice-banner-enable:hover {
  background-color: var(--c-primary-hover, var(--op-primary-hover));
}

.norm-tour-voice-banner-dismiss {
  background: none;
  border: none;
  color: var(--c-text-muted, var(--op-text-muted));
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}

.norm-tour-voice-banner-dismiss:hover {
  color: var(--c-text, var(--op-text));
}

.norm-tour-voice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  background-color: var(--c-surface-alt, var(--op-surface-alt));
  border: 1px solid var(--c-border, var(--op-border));
  border-radius: 6px;
  flex-wrap: wrap;
}

.norm-tour-voice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text, var(--op-text));
  user-select: none;
  -webkit-user-select: none;
}

.norm-tour-voice-switch {
  position: relative;
  width: 30px;
  height: 17px;
  background-color: var(--c-border-strong, var(--op-border-strong));
  border-radius: 10px;
  transition: background-color 0.18s ease;
  flex-shrink: 0;
}

.norm-tour-voice-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  background-color: var(--c-surface, var(--op-surface));
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: var(--shadow-sm, var(--op-shadow-sm));
}

.norm-tour-voice-toggle[aria-checked="true"] .norm-tour-voice-switch {
  background-color: var(--c-success-solid, var(--op-success-text));
}

.norm-tour-voice-toggle[aria-checked="true"] .norm-tour-voice-switch-thumb {
  transform: translateX(13px);
}

.norm-tour-voice-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: transparent;
  display: inline-block;
  transition: background-color 0.15s ease;
}

.norm-tour-voice-bar--playing .norm-tour-voice-indicator {
  background-color: var(--c-success-solid, var(--op-success-text));
  box-shadow: var(--c-focus-ring, var(--op-focus-ring));
}

.norm-tour-voice-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.norm-tour-voice-gender {
  display: inline-flex;
  border: 1px solid var(--c-border-strong, var(--op-border-strong));
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--c-surface, var(--op-surface));
}

.norm-tour-voice-gender-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--c-text-muted, var(--op-text-muted));
  cursor: pointer;
  line-height: 1.3;
}

.norm-tour-voice-gender-btn.is-active {
  background-color: var(--c-info-solid, var(--op-primary));
  color: var(--c-text-inverse, var(--op-text-inverse));
  font-weight: 600;
}

.norm-tour-voice-replay {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--c-surface, var(--op-surface));
  border: 1px solid var(--c-border-strong, var(--op-border-strong));
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--c-text, var(--op-text));
  cursor: pointer;
  line-height: 1.4;
  transition: background-color 0.15s, border-color 0.15s;
}

.norm-tour-voice-replay:hover {
  background-color: var(--c-surface-hover, var(--op-surface-hover));
  border-color: var(--c-border-strong, var(--op-border-strong));
}

/* 4. Мобильный контур (тач-таргеты >= 44px, адаптивная ширина) */
@media (max-width: 600px) {
  .norm-tour-card {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .norm-tour-close {
    min-width: 44px;
    min-height: 44px;
    font-size: 18px;
  }

  .norm-tour-btn {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 14px;
  }
}
