/* Голосовая заявка — стиль «Студия» (вариант A) */

.voice-lead {
  padding: 60px 16px;
  background: #ece6d8;
}

.voice-lead__inner {
  max-width: 1180px;
  margin: 0 auto;
}

/* Карточка-paper с soft shadow */
.voice-lead__card {
  background: #fdf8ee;
  border-radius: 24px;
  border: 1px solid #ead9b5;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(60,30,10,0.18), 0 4px 12px rgba(60,30,10,0.04);
}

.voice-lead__card::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  background: radial-gradient(closest-side, rgba(250,175,28,0.18), transparent 70%);
  pointer-events: none;
}

.voice-lead__grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .voice-lead__grid {
    grid-template-columns: 1.25fr 1fr;
  }
}

/* === Левая колонка (форма) === */
.voice-lead__main {
  padding: 32px 24px;
  position: relative;
}

@media (min-width: 900px) {
  .voice-lead__main {
    padding: 56px 56px 48px;
  }
}

.voice-lead__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'TTMedium', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d36718;
  font-weight: 700;
  margin-bottom: 14px;
}

.voice-lead__eyebrow svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.voice-lead__title {
  font-family: 'TTMedium', system-ui, sans-serif;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
  color: #1a1a1a;
}

@media (min-width: 900px) {
  .voice-lead__title {
    font-size: 38px;
    max-width: 460px;
  }
}

.voice-lead__title-line { display: block; }

/* На мобиле: 2-я и 3-я строки сливаются в одну "мы рассчитаем цену" */
@media (max-width: 899px) {
  .voice-lead__title-line:nth-child(2),
  .voice-lead__title-line:nth-child(3) {
    display: inline;
  }
}

.voice-lead__lead {
  display: none;
}

/* === Блок записи === */
.voice-lead__record {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #f0e3c8;
}

.voice-lead__btn-mic {
  flex: 0 0 auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #faaf1c 0%, #d36718 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  box-shadow: 0 12px 28px -10px rgba(211, 103, 24, 0.55);
  transition: transform 0.2s;
}

.voice-lead__btn-mic::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(250, 175, 28, 0.35);
  animation: voiceLeadRing 2.4s ease-out infinite;
}

@keyframes voiceLeadRing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-lead__btn-mic::after { animation: none; opacity: 0; }
}

.voice-lead__btn-mic:hover { transform: scale(1.05); }
.voice-lead__btn-mic[disabled] { opacity: 0.5; cursor: not-allowed; }
.voice-lead__btn-mic svg { width: 30px; height: 30px; }

.voice-lead__btn-mic-label {
  font-family: 'TTMedium', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.voice-lead__btn-mic-timer {
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 700;
}

.voice-lead__btn-mic--recording {
  background: linear-gradient(135deg, #d92525 0%, #a30000 100%);
  animation: voiceLeadPulse 1.6s ease-in-out infinite;
}

@keyframes voiceLeadPulse {
  0%, 100% { box-shadow: 0 12px 28px -8px rgba(217,37,37,0.45); transform: scale(1); }
  50% { box-shadow: 0 14px 36px -6px rgba(217,37,37,0.65); transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .voice-lead__btn-mic--recording { animation: none; }
}

.voice-lead__record-info {
  flex: 1;
  min-width: 0;
}

.voice-lead__status {
  margin: 0 0 18px;
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 14px;
  color: #555;
}

.voice-lead__status--warning { color: #d36718; font-weight: 500; }
.voice-lead__status--danger  { color: #d92525; font-weight: 600; }

.voice-lead__levels {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 28px;
  margin-bottom: 6px;
}

.voice-lead__levels i {
  display: block;
  width: 4px;
  background: linear-gradient(180deg, #faaf1c 0%, #d36718 100%);
  border-radius: 2px;
  height: 4px;
  transition: height 0.08s linear;
}

/* Статичные высоты в idle — при записи JS перебивает inline-style'ом */
.voice-lead__levels i:nth-child(1) { height: 30%; }
.voice-lead__levels i:nth-child(2) { height: 65%; }
.voice-lead__levels i:nth-child(3) { height: 90%; }
.voice-lead__levels i:nth-child(4) { height: 50%; }
.voice-lead__levels i:nth-child(5) { height: 75%; }
.voice-lead__levels i:nth-child(6) { height: 40%; }
.voice-lead__levels i:nth-child(7) { height: 60%; }
.voice-lead__levels i:nth-child(8) { height: 35%; }

.voice-lead__progress-time {
  margin: 0;
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 13px;
  color: #999;
  font-variant-numeric: tabular-nums;
}

/* === Список сегментов === */
.voice-lead__segments {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-lead__segment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #f0e3c8;
  border-radius: 12px;
}

.voice-lead__segment-play {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #faaf1c 0%, #d36718 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voice-lead__segment-play svg { width: 14px; height: 14px; }

.voice-lead__segment-progress {
  flex: 1;
  height: 4px;
  background: #f0e3c8;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.voice-lead__segment-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #faaf1c, #d36718);
  width: 0;
  transition: width 0.05s linear;
}

.voice-lead__segment-label {
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 13px;
  color: #555;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.voice-lead__segment-delete {
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.voice-lead__segment-delete:hover { color: #d92525; background: #fff0f0; }
.voice-lead__segment-delete svg { width: 16px; height: 16px; }

/* === Form-row: phone + photo + submit === */
.voice-lead__form-row {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 600px) {
  .voice-lead__form-row {
    flex-direction: row;
    align-items: stretch;
    flex-wrap: wrap;
  }
  .voice-lead__form-row .voice-lead__phone-input { flex: 1 1 220px; min-width: 200px; }
  .voice-lead__form-row .voice-lead__photo-btn { flex: 0 0 auto; }
  .voice-lead__form-row [data-submit] { flex: 0 0 auto; min-width: 160px; }
}

.voice-lead__phone-input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 17px;
  border: 1.5px solid #e0d1ad;
  border-radius: 12px;
  background: #fff;
  color: #1a1a1a;
  outline: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  height: 52px;
  line-height: 1.2;
}

.voice-lead__phone-input:focus {
  border-color: #faaf1c;
  box-shadow: 0 0 0 4px rgba(250,175,28,0.18);
}

.voice-lead__photo-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 16px;
  border: 1.5px dashed #e0d1ad;
  background: #fff;
  border-radius: 12px;
  font-family: 'TTMedium', system-ui, sans-serif;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.voice-lead__photo-btn:hover { border-color: #d36718; color: #d36718; background: #fff8e8; }
.voice-lead__photo-btn svg { color: #d36718; flex-shrink: 0; }

.voice-lead__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  font-family: 'TTMedium', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}

.voice-lead__btn--primary {
  background: linear-gradient(135deg, #faaf1c 0%, #d36718 100%);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(211,103,24,0.55);
}

.voice-lead__btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px rgba(211,103,24,0.6);
}

.voice-lead__btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.voice-lead__btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.voice-lead__btn.is-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: voiceLeadSpin 0.8s linear infinite;
}

@keyframes voiceLeadSpin { to { transform: rotate(360deg); } }

/* === Photos === */
.voice-lead__photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.voice-lead__photo-list:empty { display: none; }

.voice-lead__photo-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f0e3c8;
}

.voice-lead__photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.voice-lead__photo-thumb--loading {
  position: relative;
}

.voice-lead__photo-thumb--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  width: 18px; height: 18px;
  border: 2px solid #d36718;
  border-top-color: transparent;
  border-radius: 50%;
  animation: voiceLeadSpin 0.8s linear infinite;
}

.voice-lead__photo-thumb--loading .voice-lead__photo-remove {
  z-index: 2;
}

.voice-lead__photo-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-lead__photo-msg {
  margin-top: 8px;
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 13px;
  color: #d36718;
}

/* === Consent === */
.voice-lead__consent {
  margin: 18px 0 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 12.5px;
  color: #7a6f63;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f7f7;
  outline: 2px solid transparent;
  transition: outline-color .2s, background-color .2s;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}
.voice-lead__consent label {
  cursor: pointer;
}

.voice-lead__consent.is-error {
  outline-color: #e53935;
  background: rgba(229,57,53,0.06);
}

.voice-lead__consent input[type="checkbox"] {
  margin-top: 2px;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: #d36718;
  cursor: pointer;
}

.voice-lead__consent a {
  color: #d36718;
  text-decoration: underline;
  cursor: pointer;
}

.voice-lead__btn--full {
  width: 100%;
  margin-top: 14px;
}

/* === Error === */
.voice-lead__error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff0f0;
  color: #c00;
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

/* === Правая колонка: памятка (фирменный фиолетовый лендинга) === */
.voice-lead__hint {
  background: linear-gradient(165deg, #391085 0%, #2e0d6a 100%);
  color: #f5e9d0;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .voice-lead__hint {
    padding: 56px 44px;
  }
}

.voice-lead__hint::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(250,175,28,0.22), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(137,80,216,0.35), transparent 55%);
  pointer-events: none;
}

.voice-lead__hint-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'TTMedium', system-ui, sans-serif;
  color: inherit;
  position: relative;
  z-index: 1;
}

.voice-lead__hint-title {
  font-family: 'TTMedium', system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: #fff;
  font-weight: 700;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.voice-lead__hint-title::before {
  content: '?';
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #faaf1c, #d36718);
  color: #2e0d6a;
  text-align: center;
  line-height: 28px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'TTMedium', system-ui, sans-serif;
}

.voice-lead__hint-arrow {
  width: 22px;
  height: 22px;
  color: #faaf1c;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.voice-lead__hint-toggle[aria-expanded="true"] .voice-lead__hint-arrow {
  transform: rotate(90deg);
}

.voice-lead__hint-body {
  display: none;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.voice-lead__hint-toggle[aria-expanded="true"] + .voice-lead__hint-body {
  display: block;
}

.voice-lead__hint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.voice-lead__hint-list li {
  position: relative;
  padding-left: 20px;
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 15px;
  color: #fff;
  line-height: 1.5;
}

.voice-lead__hint-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #faaf1c, #d36718);
}

.voice-lead__hint-foot {
  margin: 22px 0 0;
  padding-top: 16px;
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 15px;
  color: #fff;
  border-top: 1px solid rgba(255,255,255,0.2);
  line-height: 1.5;
}

/* На десктопе памятка раскрыта всегда */
@media (min-width: 900px) {
  .voice-lead__hint-toggle {
    cursor: default;
    pointer-events: none;
  }
  .voice-lead__hint-arrow { display: none; }
  .voice-lead__hint-body {
    display: block !important;
    margin-top: 22px;
  }
}

/* === Шаг 2: success === */
.voice-lead__success {
  display: none;
  text-align: center;
  padding: 48px 24px;
}

.voice-lead__success.is-active { display: flex; flex-direction: column; align-items: center; justify-content: center; }

@media (min-width: 900px) {
  .voice-lead__main, .voice-lead__success { grid-column: 1; grid-row: 1; }
  .voice-lead__hint { grid-column: 2; grid-row: 1; }
}

.voice-lead__success-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #faaf1c, #d36718);
  border-radius: 50%;
  box-shadow: 0 12px 30px -8px rgba(211,103,24,0.45);
}

.voice-lead__success-icon svg { width: 48px; height: 48px; color: #fff; }

.voice-lead__success-title {
  font-family: 'TTMedium', system-ui, sans-serif;
  font-size: 28px;
  color: #1a1a1a;
  margin: 0 0 16px;
}

.voice-lead__success-text {
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 20px;
  color: #555;
  line-height: 1.5;
  margin: 0;
}

.voice-lead__success-text b { color: #1a1a1a; }

/* === Toast undo === */
.voice-lead__toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40,40,40,0.95);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  font-family: 'TTRegular', system-ui, sans-serif;
  font-size: 14px;
  max-width: calc(100vw - 40px);
}

.voice-lead__toast button {
  background: none;
  border: none;
  color: #faaf1c;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  font-family: 'TTMedium', system-ui, sans-serif;
}
