/* ── Noise overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

/* ── Base resets ── */
body { background-color: #fff; overflow-x: hidden; }

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

a, button, label {
  -webkit-tap-highlight-color: transparent;
}

/* iOS Safari: font-size ≥ 16px предотвращает автозум при фокусе */
input, textarea, select {
  font-size: 16px;
}

/* Единый вид полей — убираем системные стили iOS/Android */
input[type="text"],
input[type="url"],
input[type="email"],
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* ── Form modal ── */
#form-content {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
}

#form-content::-webkit-scrollbar { width: 4px; }
#form-content::-webkit-scrollbar-track { background: transparent; }
#form-content::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 2px; }
#form-content { scrollbar-width: thin; scrollbar-color: #d4d4d8 transparent; }

#form-footer-bar {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* ── Floating contact — magnetic glow ── */
.tg-float {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px) + 12px);
  right: max(20px, env(safe-area-inset-right, 0px) + 12px);
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  border-radius: 18px;
  background: rgba(228, 228, 231, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(228, 228, 231, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  z-index: 30;
  text-decoration: none;
  cursor: pointer;
  transition: max-width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              padding 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              background 0.3s ease,
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}
@media (min-width: 640px) {
  .tg-float { min-width: 44px; max-width: 44px; height: 44px; bottom: 28px; right: 28px; border-radius: 22px; }
}
.tg-float .tg-icon {
  flex-shrink: 0;
  color: #52525b;
  opacity: 0.5;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.tg-float .tg-label {
  font-size: 13px;
  font-weight: 500;
  color: #52525b;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  min-width: 0;
  padding-left: 6px;
  overflow: hidden;
  transition: opacity 0.2s ease, max-width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@media (hover: hover) {
  .tg-float:hover {
    max-width: 200px;
    padding: 0 16px;
    background: rgba(234, 140, 14, 0.2);
    box-shadow: 0 0 20px rgba(234, 140, 14, 0.25);
    border-color: rgba(234, 140, 14, 0.3);
  }
  .tg-float:hover .tg-icon { opacity: 1; color: #ea8c0e; }
  .tg-float:hover .tg-label { opacity: 1; max-width: 100px; color: #ea8c0e; }
}

/* ── Pill (interactive button/link) ── */
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  background: #e4e4e7;
  color: #52525b;
  padding: 5px 13px;
  border-radius: 8px;
  letter-spacing: 0.01em;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
}
.pill:hover {
  background: #ea8c0e;
  color: #ffffff;
}
.pill.active {
  background: #18181b;
  color: #ffffff;
}
.pill.active:hover {
  background: #ea8c0e;
}

/* ── Tag (non-interactive label) ── */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  background: #e4e4e7;
  color: #52525b;
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

/* ── Form: consent declined ── */
.consent-declined {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}
.consent-declined input[value="нет"] {
  accent-color: #ef4444;
}

/* ── Form: field validation errors ── */
.form-error input,
.form-error textarea {
  border-color: #ef4444;
}
.form-error .space-y-1,
.form-error .space-y-2 {
  outline: 1px solid #ef4444;
  outline-offset: 4px;
}
