/* Mobile Voice Training — FR-E3 */

.mvt-overlay {
  position: fixed;
  inset: 0;
  /* Reserve room for tab-bar (z 11000 sits above this z 10300).
     See mobile-tab-bar.css → "UNIVERSAL MOBILE-MODAL BOTTOM RESERVATION". */
  padding-bottom: var(--mobile-control-panel-height, 56px);
  /* Primary mobile modal tier (per Z_INDEX_HIERARCHY.md). Was 120000 —
     same anti-pattern that trapped UMI under Face Training. */
  z-index: 10300;
  background: #0d1f1f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.mvt-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: #111d1d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mvt-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.mvt-title {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mvt-progress {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

/* Body */
.mvt-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Prompt area */
.mvt-prompt-area {
  flex-shrink: 0;
  padding: 28px 24px 20px;
  text-align: center;
}

.mvt-prompt-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 12px;
}

.mvt-prompt-text {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 500;
  color: #fff;
  line-height: 1.45;
  margin: 0;
}

/* Passage mode — multi-paragraph prompt (e.g. Julia passage) */
.mvt-prompt-area--passage {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  padding: 20px 24px 16px;
}

.mvt-prompt-area--passage .mvt-prompt-label {
  text-align: center;
}

.mvt-prompt-area--passage .mvt-prompt-text {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 12px;
}

.mvt-prompt-area--passage .mvt-prompt-text:last-child {
  margin-bottom: 0;
}

/* Waveform canvas */
.mvt-waveform-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 80px;
  max-height: 120px;
}

.mvt-waveform {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

/* Recording status */
.mvt-status-bar {
  flex-shrink: 0;
  padding: 8px 24px;
  text-align: center;
}

.mvt-timer {
  font-family: 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.05em;
  margin: 0;
}

.mvt-status-text {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 4px 0 0;
}

.mvt-status-text.recording {
  color: #ef4444;
}

.mvt-rec-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 6px;
  animation: mvt-pulse 1s ease-in-out infinite;
}

@keyframes mvt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Controls row */
.mvt-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px 32px calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: #0d1f1f;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Record button (center) */
.mvt-record-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ef4444;
  border: 4px solid rgba(239, 68, 68, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.1);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s, box-shadow 0.2s;
}

.mvt-record-btn:active {
  transform: scale(0.92);
}

.mvt-record-btn.recording {
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.1), 0 0 20px rgba(239, 68, 68, 0.4);
  animation: mvt-record-pulse 1.5s ease-in-out infinite;
}

@keyframes mvt-record-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.1), 0 0 20px rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.05), 0 0 30px rgba(239, 68, 68, 0.5); }
}

.mvt-record-btn svg {
  pointer-events: none;
}

/* Stop icon (shown during recording) */
.mvt-record-icon-stop {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #ef4444;
  display: none;
}

.mvt-record-btn.recording .mvt-record-icon-stop {
  display: block;
}

.mvt-record-btn.recording .mvt-record-icon-mic {
  display: none;
}

/* Side buttons */
.mvt-side-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mvt-side-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Invisible placeholder to keep record button centered when skip-prompt is hidden */
.mvt-side-spacer {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

/* Playback bar (shown after recording) */
.mvt-playback-bar {
  flex-shrink: 0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  display: none;
}

.mvt-playback-bar.visible {
  display: flex;
}

.mvt-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(42, 117, 117, 0.3);
  border: 1.5px solid rgba(42, 117, 117, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.mvt-playback-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  flex: 1;
}

.mvt-playback-duration {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

/* Submit + navigation row */
.mvt-action-row {
  flex-shrink: 0;
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mvt-submit-btn {
  width: 100%;
  padding: 16px;
  background: #2a7575;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.mvt-submit-btn:active {
  background: #1a5555;
}

.mvt-submit-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.mvt-skip-btn {
  width: 100%;
  padding: 12px;
  background: none;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Done screen */
.mvt-done-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  gap: 16px;
  text-align: center;
}

.mvt-done-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(42, 117, 117, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 8px;
}

.mvt-done-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.mvt-done-detail {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  line-height: 1.5;
}

.mvt-done-close {
  margin-top: 16px;
  padding: 16px 40px;
  background: #2a7575;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Loading overlay */
.mvt-loading {
  position: absolute;
  inset: 0;
  background: rgba(13, 31, 31, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  display: none;
}

.mvt-loading.visible {
  display: flex;
}

.mvt-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #2a7575;
  border-radius: 50%;
  animation: mvt-spin 0.8s linear infinite;
}

@keyframes mvt-spin {
  to { transform: rotate(360deg); }
}

.mvt-loading-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}
