/* ============================================================
   peregruz-yurist.ru — собственные формы заявки (вместо форм Битрикс24).
   Заявки уходят на /api/lead → АИ-РОП. Вид повторяет согласованный макет:
   телефон и имя в ряд, УИН строкой, «Приложить постановление» пунктиром,
   крупная оранжевая кнопка и поясняющая подпись.
   ============================================================ */

.pf-form {
  --pf-accent: #f59e0b;
  --pf-accent-light: #ffb020;
  --pf-field-bg: #0a0a0b;
  --pf-field-border: rgba(255, 255, 255, 0.09);
  --pf-text: #fff6f0;
  --pf-muted: rgba(255, 246, 240, 0.45);
  --pf-error: #f25830;
  padding: 20px;
  font-family: inherit;
  color: var(--pf-text);
}

.pf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pf-wide { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-form { padding: 16px; }
}

/* поля */
.pf-field { position: relative; }
.pf-input {
  width: 100%;
  height: 56px;
  box-sizing: border-box;
  padding: 20px 14px 6px;
  background: var(--pf-field-bg);
  border: 1px solid var(--pf-field-border);
  border-radius: 10px;
  color: var(--pf-text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.pf-input:focus { border-color: rgba(245, 158, 11, 0.55); }

/* Автозаполнение браузера красит поле в белый и подменяет шрифт — возвращаем свой вид.
   Длинный transition — известный приём: он не даёт браузеру перекрасить фон обратно. */
.pf-input:-webkit-autofill,
.pf-input:-webkit-autofill:hover,
.pf-input:-webkit-autofill:focus,
.pf-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--pf-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--pf-field-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--pf-field-bg) inset !important;
  caret-color: var(--pf-text);
  border: 1px solid var(--pf-field-border) !important;
  font: inherit !important;
  font-size: 16px !important;
  transition: background-color 100000s ease-in-out 0s;
}
.pf-input:-webkit-autofill + .pf-label { top: 15px; font-size: 11px; transform: none; }
.pf-input::placeholder { color: transparent; }

.pf-label {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--pf-muted);
  pointer-events: none;
  transition: all 0.13s ease;
}
.pf-input:focus + .pf-label,
.pf-input:not(:placeholder-shown) + .pf-label {
  top: 15px;
  font-size: 11px;
  transform: none;
}
.pf-req { color: var(--pf-accent); }

.pf-field.pf-invalid .pf-input { border-color: var(--pf-error); }
.pf-hint {
  display: none;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--pf-error);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
}
.pf-field.pf-invalid .pf-hint { display: block; }

/* приложить файл */
.pf-file {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  transition: border-color 0.15s ease;
}
.pf-file:hover { border-color: rgba(245, 158, 11, 0.5); }
.pf-file-btn {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--pf-text);
  font: 600 15px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.pf-file-icon {
  width: 20px;
  height: 20px;
  flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M17 8l-5-5-5 5'/%3E%3Cpath d='M12 3v12'/%3E%3C/svg%3E") no-repeat center / 20px 20px;
}
.pf-file-list { margin: 0; padding: 0 8px 6px; list-style: none; }
.pf-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--pf-text);
}
.pf-file-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-file-item small { color: var(--pf-muted); }
.pf-file-drop { border-color: rgba(245, 158, 11, 0.8); background: rgba(245, 158, 11, 0.06); }
.pf-file-remove {
  background: none;
  border: none;
  color: var(--pf-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.pf-file-remove:hover { color: var(--pf-text); }

/* согласие */
.pf-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--pf-muted);
  cursor: pointer;
}
.pf-consent input {
  margin: 2px 0 0;
  width: 14px;
  height: 14px;
  flex: none;
  accent-color: var(--pf-accent);
  cursor: pointer;
}
.pf-consent a { color: rgba(255, 246, 240, 0.75); text-decoration: underline; }
.pf-consent a:hover { color: var(--pf-accent); }
.pf-consent.pf-invalid { color: var(--pf-error); }
.pf-consent.pf-invalid a { color: var(--pf-error); }

/* кнопка и подпись */
.pf-submit {
  width: 100%;
  height: 60px;
  margin-top: 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--pf-accent-light) 0%, var(--pf-accent) 100%);
  color: #111;
  font: 700 18px/1.2 inherit;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.pf-submit:hover { filter: brightness(1.06); }
.pf-submit[disabled] { opacity: 0.65; cursor: default; filter: none; }
.pf-note {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  color: var(--pf-muted);
}
.pf-error-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(242, 88, 48, 0.15);
  border: 1px solid rgba(242, 88, 48, 0.5);
  color: #ffd9cf;
  font-size: 13px;
  line-height: 1.4;
}
.pf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* модальное окно */
.pf-modal {
  position: fixed;
  inset: 0;
  z-index: 1100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}
.pf-modal[hidden] { display: none; }
.pf-modal-window {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 16px;
}
.pf-modal-head { padding: 24px 20px 0; text-align: center; }
.pf-modal-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--pf-text); }
.pf-modal-sub { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: rgba(255, 246, 240, 0.45); }
.pf-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff6f0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.pf-modal-close:hover { background: rgba(255, 255, 255, 0.16); }

/* согласие на cookie */
.pf-cookie {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1100000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(18, 18, 20, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 246, 240, 0.8);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.pf-cookie[hidden] { display: none; }
.pf-cookie p { margin: 0; flex: 1 1 380px; }
.pf-cookie a { color: rgba(255, 246, 240, 0.95); text-decoration: underline; }
.pf-cookie-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.pf-cookie button {
  height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  font: 600 14px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
}
.pf-cookie-accept { background: linear-gradient(90deg, #ffb020, #f59e0b); color: #111; }
.pf-cookie-decline { background: transparent; border-color: rgba(255, 255, 255, 0.25); color: rgba(255, 246, 240, 0.85); }
.pf-cookie-decline:hover { border-color: rgba(255, 255, 255, 0.5); }

@media (max-width: 600px) {
  .pf-cookie {
    left: 8px;
    right: 8px;
    bottom: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
  }
  .pf-cookie p { flex: 1 1 auto; }
  .pf-cookie button { height: 36px; padding: 0 12px; font-size: 13px; }
  .pf-cookie-actions button { flex: 1; }
}
