/* Shared email-on-vCard toggle (create + edit forms) */

.vc-email-pref {
  margin-top: 0.65rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  box-sizing: border-box;
}

.vc-email-pref__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.vc-email-pref__text {
  flex: 1;
  min-width: 0;
}

.vc-email-pref__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.vc-email-pref__desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748b;
}

.vc-email-pref__status {
  margin: 0.65rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.75rem;
  line-height: 1.4;
  color: #475569;
}

.vc-email-pref__status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
  background: #22c55e;
}

.vc-email-pref.is-off .vc-email-pref__status::before {
  background: #94a3b8;
}

.vc-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem;
  margin: -0.25rem -0.25rem -0.25rem 0;
  -webkit-tap-highlight-color: transparent;
}

.vc-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  flex-grow: 0 !important;
  font-weight: 400 !important;
}

.vc-switch__track {
  display: block;
  width: 3rem;
  height: 1.75rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.22s ease, box-shadow 0.22s ease;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.vc-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18), 0 1px 1px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.vc-switch input:checked + .vc-switch__track {
  background: #0066cc;
}

.vc-switch input:checked + .vc-switch__track .vc-switch__thumb {
  transform: translateX(1.25rem);
}

.vc-switch input:focus-visible + .vc-switch__track {
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.25);
}

.vc-email-pref__backend {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.vc-email-pref .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Override global .input-group label/input rules on vc.php */
.input-group .vc-email-pref {
  display: block !important;
  width: 100%;
  min-width: 0 !important;
  align-self: stretch !important;
}

.input-group .vc-switch {
  display: inline-flex !important;
  align-items: center !important;
  min-width: 0 !important;
  width: auto !important;
  font-weight: 400 !important;
  font-size: inherit !important;
  color: inherit !important;
  gap: 0 !important;
  flex-shrink: 0 !important;
  margin-bottom: 0 !important;
}

@media (max-width: 640px) {
  .vc-email-pref {
    padding: 0.85rem 0.9rem;
  }

  .vc-email-pref__row {
    position: relative;
    display: block;
    padding-right: 3.35rem;
    min-height: 1.75rem;
  }

  .vc-email-pref__text {
    display: block;
  }

  .vc-email-pref__title {
    width: 100%;
    box-sizing: border-box;
    padding-left: 3.35rem;
    text-align: center;
  }

  .vc-email-pref__desc {
    margin-top: 0.5rem;
    text-align: center;
  }

  .input-group .vc-switch,
  .vc-switch {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0 !important;
    padding: 0.1rem;
  }

  .vc-email-pref__status {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .vc-switch__track {
    width: 2.75rem;
    height: 1.625rem;
  }

  .vc-switch__thumb {
    width: 1.25rem;
    height: 1.25rem;
  }

  .vc-switch input:checked + .vc-switch__track .vc-switch__thumb {
    transform: translateX(1.125rem);
  }
}
